cgeo/c-geo-opensource — Issue #1240: Exception when importing from web (send2cgeo) and there are no caches
Author: stephanme
Created: 2012-03-06 21:18:15+00:00
State: open

03-05 00:12:31.656: D/cgeo(12923): GET http://send2.cgeo.org/read.html?code=...
03-05 00:12:32.016: D/cgeo(12923): 200 (360 ms) GET http://send2.cgeo.org/read.html?code=...
03-05 00:12:32.016: E/cgeo(12923): getResponseData
03-05 00:12:32.016: E/cgeo(12923): java.lang.IllegalStateException: Content has been consumed
03-05 00:12:32.016: E/cgeo(12923):	at org.apache.http.entity.BasicHttpEntity.getContent(BasicHttpEntity.java:84)
03-05 00:12:32.016: E/cgeo(12923):	at org.apache.http.conn.BasicManagedEntity.getContent(BasicManagedEntity.java:100)
03-05 00:12:32.016: E/cgeo(12923):	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:112)
03-05 00:12:32.016: E/cgeo(12923):	at cgeo.geocaching.cgBase.getResponseDataNoError(cgBase.java:2222)
03-05 00:12:32.016: E/cgeo(12923):	at cgeo.geocaching.cgBase.getResponseData(cgBase.java:2238)
03-05 00:12:32.016: E/cgeo(12923):	at cgeo.geocaching.cgBase.getResponseData(cgBase.java:2231)
03-05 00:12:32.016: E/cgeo(12923):	at cgeo.geocaching.cgeocaches$LoadFromWebThread.run(cgeocaches.java:1964)

This is easy to fix. But is there no way to find out that the send2cgeo server has no more caches? I see that the server returns 'X' in this case. Can we stop importing in this case? Currently 'Import from web' waits for 3 minutes for new caches.