forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p' (head 5b24a07e8a843d03ea45e664c59b93937c5efc42)
to branch 'i2p.i2p.str4d.fux' (head 0bfff6086d6f72df836909ae379a95ebbe4b6933)
This commit is contained in:
@ -158,7 +158,7 @@ public class PluginUpdateChecker extends UpdateHandler {
|
||||
try {
|
||||
_get = new PartialEepGet(_context, proxyHost, proxyPort, _baos, _xpi2pURL, TrustedUpdate.HEADER_BYTES);
|
||||
_get.addStatusListener(PluginUpdateCheckerRunner.this);
|
||||
_get.fetch();
|
||||
_get.fetch(CONNECT_TIMEOUT);
|
||||
} catch (Throwable t) {
|
||||
_log.error("Error checking update for plugin", t);
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public class PluginUpdateHandler extends UpdateHandler {
|
||||
else
|
||||
_get = new EepGet(_context, 1, _updateFile, _xpi2pURL, false);
|
||||
_get.addStatusListener(PluginUpdateRunner.this);
|
||||
_get.fetch();
|
||||
_get.fetch(CONNECT_TIMEOUT, -1, shouldProxy ? INACTIVITY_TIMEOUT : NOPROXY_INACTIVITY_TIMEOUT);
|
||||
} catch (Throwable t) {
|
||||
_log.error("Error downloading plugin", t);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class UnsignedUpdateHandler extends UpdateHandler {
|
||||
// 40 retries!!
|
||||
_get = new EepGet(_context, proxyHost, proxyPort, 40, _updateFile, _zipURL, false);
|
||||
_get.addStatusListener(UnsignedUpdateRunner.this);
|
||||
_get.fetch();
|
||||
_get.fetch(CONNECT_TIMEOUT, -1, INACTIVITY_TIMEOUT);
|
||||
} catch (Throwable t) {
|
||||
_log.error("Error updating", t);
|
||||
}
|
||||
|
@ -45,6 +45,10 @@ public class UpdateHandler {
|
||||
static final String PROP_UPDATE_IN_PROGRESS = "net.i2p.router.web.UpdateHandler.updateInProgress";
|
||||
protected static final String PROP_LAST_UPDATE_TIME = "router.updateLastDownloaded";
|
||||
|
||||
protected static final long CONNECT_TIMEOUT = 55*1000;
|
||||
protected static final long INACTIVITY_TIMEOUT = 5*60*1000;
|
||||
protected static final long NOPROXY_INACTIVITY_TIMEOUT = 60*1000;
|
||||
|
||||
public UpdateHandler() {
|
||||
this(ContextHelper.getContext(null));
|
||||
}
|
||||
@ -193,7 +197,7 @@ public class UpdateHandler {
|
||||
// no retries
|
||||
_get = new PartialEepGet(_context, proxyHost, proxyPort, _baos, updateURL, TrustedUpdate.HEADER_BYTES);
|
||||
_get.addStatusListener(UpdateRunner.this);
|
||||
_get.fetch();
|
||||
_get.fetch(CONNECT_TIMEOUT);
|
||||
} catch (Throwable t) {
|
||||
_isNewer = false;
|
||||
}
|
||||
@ -210,7 +214,7 @@ public class UpdateHandler {
|
||||
else
|
||||
_get = new EepGet(_context, 1, _updateFile, updateURL, false);
|
||||
_get.addStatusListener(UpdateRunner.this);
|
||||
_get.fetch();
|
||||
_get.fetch(CONNECT_TIMEOUT, -1, shouldProxy ? INACTIVITY_TIMEOUT : NOPROXY_INACTIVITY_TIMEOUT);
|
||||
} catch (Throwable t) {
|
||||
_log.error("Error updating", t);
|
||||
}
|
||||
|
Reference in New Issue
Block a user