Skip to content

Commit

Permalink
UrlTileDataSource: fix #1074
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Oct 19, 2023
1 parent 9274a19 commit 7e1afa6
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions vtm/src/org/oscim/tiling/source/UrlTileDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@ public UrlTileDataSource(UrlTileSource tileSource, ITileDecoder tileDecoder, Htt
public void query(MapTile tile, ITileDataSink sink) {
ITileCache cache = mTileSource.tileCache;

QueryResult res = QueryResult.FAILED;

TileWriter cacheWriter = null;
try {
if (mUseCache) {
TileReader c = cache.getTile(tile);
if (c != null) {
InputStream is = c.getInputStream();
try {
if (mTileDecoder.decode(tile, sink, is)) {
sink.completed(QueryResult.SUCCESS);
return;
}
} catch (IOException e) {
log.debug("{} Cache read: {}", tile, e);
} finally {
IOUtils.closeQuietly(is);
if (mUseCache) {
TileReader c = cache.getTile(tile);
if (c != null) {
InputStream is = c.getInputStream();
try {
if (mTileDecoder.decode(tile, sink, is)) {
sink.completed(QueryResult.SUCCESS);
return;
}
} catch (IOException e) {
log.debug("{} Cache read: {}", tile, e);
} finally {
IOUtils.closeQuietly(is);
}
}
}

QueryResult res = QueryResult.FAILED;

TileWriter cacheWriter = null;
try {
mConn.sendRequest(tile);
InputStream is = mConn.read();
if (mUseCache) {
Expand Down

0 comments on commit 7e1afa6

Please sign in to comment.