fix: only write to cache when full content was read
This commit is contained in:
parent
666803250c
commit
9351380645
@ -81,7 +81,6 @@ public class UrlTileDataSource implements ITileDataSource {
|
|||||||
cacheWriter = cache.writeTile(tile);
|
cacheWriter = cache.writeTile(tile);
|
||||||
mConn.setCache(cacheWriter.getOutputStream());
|
mConn.setCache(cacheWriter.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
success = mTileDecoder.decode(tile, sink, is);
|
success = mTileDecoder.decode(tile, sink, is);
|
||||||
}
|
}
|
||||||
} catch (SocketException e) {
|
} catch (SocketException e) {
|
||||||
@ -93,8 +92,7 @@ public class UrlTileDataSource implements ITileDataSource {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
mConn.requestCompleted(success);
|
success = mConn.requestCompleted(success);
|
||||||
|
|
||||||
if (cacheWriter != null)
|
if (cacheWriter != null)
|
||||||
cacheWriter.complete(success);
|
cacheWriter.complete(success);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user