Updates: Fail fast if HTTP proxy is not running (ticket #1530)

Covers router, unsigned router, plugin, and news updates
This commit is contained in:
zzz
2015-04-24 16:08:08 +00:00
parent 37c6ac3a88
commit aecc95825b
9 changed files with 127 additions and 9 deletions

View File

@@ -32,6 +32,7 @@ import net.i2p.util.ConcurrentHashSet;
import net.i2p.util.FileUtil;
import net.i2p.util.I2PAppThread;
import net.i2p.util.Log;
import net.i2p.util.PortMapper;
import net.i2p.util.SimpleTimer2;
import net.i2p.util.Translate;
import net.i2p.util.VersionComparator;
@@ -146,6 +147,17 @@ public class PluginStarter implements Runnable {
} while (mgr.isUpdateInProgress(TYPE_DUMMY));
}
String proxyHost = ctx.getProperty(ConfigUpdateHandler.PROP_PROXY_HOST, ConfigUpdateHandler.DEFAULT_PROXY_HOST);
int proxyPort = ConfigUpdateHandler.proxyPort(ctx);
if (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
ctx.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
mgr.notifyComplete(null, Messages.getString("Plugin update check failed", ctx) +
" - " +
Messages.getString("HTTP client proxy tunnel must be running", ctx));
return;
}
Log log = ctx.logManager().getLog(PluginStarter.class);
int updated = 0;
for (Map.Entry<String, String> entry : toUpdate.entrySet()) {