I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 82b1eb7c authored by zzz's avatar zzz
Browse files

* Update:

   - Check proxy setting before calling runner for method
parent 4bd27ea1
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ import java.net.URI; ...@@ -4,6 +4,7 @@ import java.net.URI;
import java.util.List; import java.util.List;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.web.ConfigUpdateHandler;
import net.i2p.update.*; import net.i2p.update.*;
import static net.i2p.update.UpdateType.*; import static net.i2p.update.UpdateType.*;
import static net.i2p.update.UpdateMethod.*; import static net.i2p.update.UpdateMethod.*;
...@@ -40,8 +41,10 @@ class UpdateHandler implements Updater { ...@@ -40,8 +41,10 @@ class UpdateHandler implements Updater {
*/ */
public UpdateTask update(UpdateType type, UpdateMethod method, List<URI> updateSources, public UpdateTask update(UpdateType type, UpdateMethod method, List<URI> updateSources,
String id, String newVersion, long maxTime) { String id, String newVersion, long maxTime) {
boolean shouldProxy = _context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY);
if ((type != ROUTER_SIGNED && type != ROUTER_SIGNED_SU3) || if ((type != ROUTER_SIGNED && type != ROUTER_SIGNED_SU3) ||
( method != HTTP && method != HTTP_CLEARNET && method != HTTPS_CLEARNET) || (shouldProxy && method != HTTP) ||
((!shouldProxy) && method != HTTP_CLEARNET && method != HTTPS_CLEARNET) ||
updateSources.isEmpty()) updateSources.isEmpty())
return null; return null;
UpdateRunner update = new UpdateRunner(_context, _mgr, type, method, updateSources); UpdateRunner update = new UpdateRunner(_context, _mgr, type, method, updateSources);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment