From 93513806454b438a9a741135a1fcbdfb2902721b Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Tue, 28 Jan 2014 00:29:46 +0100 Subject: [PATCH] fix: only write to cache when full content was read --- vtm/src/org/oscim/tiling/source/common/UrlTileDataSource.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vtm/src/org/oscim/tiling/source/common/UrlTileDataSource.java b/vtm/src/org/oscim/tiling/source/common/UrlTileDataSource.java index 7a9eb34c..4db5f7e1 100644 --- a/vtm/src/org/oscim/tiling/source/common/UrlTileDataSource.java +++ b/vtm/src/org/oscim/tiling/source/common/UrlTileDataSource.java @@ -81,7 +81,6 @@ public class UrlTileDataSource implements ITileDataSource { cacheWriter = cache.writeTile(tile); mConn.setCache(cacheWriter.getOutputStream()); } - success = mTileDecoder.decode(tile, sink, is); } } catch (SocketException e) { @@ -93,8 +92,7 @@ public class UrlTileDataSource implements ITileDataSource { } catch (IOException e) { e.printStackTrace(); } finally { - mConn.requestCompleted(success); - + success = mConn.requestCompleted(success); if (cacheWriter != null) cacheWriter.complete(success); }