aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-04-13 16:06:49 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-04-13 16:06:49 +0200
commit4fcb1d141cf197be1de67002db932c1f9167b2f3 (patch)
tree329542bde1de2b99700ff2fb927d685c65e2ed90 /main/src/cgeo
parentbb81e7802261664be5de6aa4037ef55473c0cb8a (diff)
downloadcgeo-4fcb1d141cf197be1de67002db932c1f9167b2f3.zip
cgeo-4fcb1d141cf197be1de67002db932c1f9167b2f3.tar.gz
cgeo-4fcb1d141cf197be1de67002db932c1f9167b2f3.tar.bz2
fix #3758: send2cgeo times out in presence of caches
Diffstat (limited to 'main/src/cgeo')
-rw-r--r--main/src/cgeo/geocaching/CacheListActivity.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/CacheListActivity.java b/main/src/cgeo/geocaching/CacheListActivity.java
index 6b639e4..b2404d9 100644
--- a/main/src/cgeo/geocaching/CacheListActivity.java
+++ b/main/src/cgeo/geocaching/CacheListActivity.java
@@ -1179,11 +1179,11 @@ public class CacheListActivity extends AbstractListActivity implements FilteredA
@Override
public void run() {
- final long startTime = System.currentTimeMillis();
+ long baseTime = System.currentTimeMillis();
final String deviceCode = StringUtils.defaultString(Settings.getWebDeviceCode());
final Parameters params = new Parameters("code", deviceCode);
- while (!handler.isCancelled() && System.currentTimeMillis() - startTime < 3 * 60000) { // maximum: 3 minutes
+ while (!handler.isCancelled() && System.currentTimeMillis() - baseTime < 3 * 60000) { // maximum: 3 minutes
// Download new code
final HttpResponse responseFromWeb = Network.getRequest("http://send2.cgeo.org/read.html", params);
@@ -1195,6 +1195,7 @@ public class CacheListActivity extends AbstractListActivity implements FilteredA
Geocache.storeCache(null, response, listIdLFW, false, null);
handler.sendMessage(handler.obtainMessage(MSG_LOADED, response));
+ baseTime = System.currentTimeMillis();
} else if ("RG".equals(response)) {
//Server returned RG (registration) and this device no longer registered.
Settings.setWebNameCode(null, null);