forked from I2P_Developers/i2p.i2p
* Update:
- Check proxy setting before calling runner for method
This commit is contained in:
@ -4,6 +4,7 @@ import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.router.web.ConfigUpdateHandler;
|
||||
import net.i2p.update.*;
|
||||
import static net.i2p.update.UpdateType.*;
|
||||
import static net.i2p.update.UpdateMethod.*;
|
||||
@ -40,8 +41,10 @@ class UpdateHandler implements Updater {
|
||||
*/
|
||||
public UpdateTask update(UpdateType type, UpdateMethod method, List<URI> updateSources,
|
||||
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) ||
|
||||
( method != HTTP && method != HTTP_CLEARNET && method != HTTPS_CLEARNET) ||
|
||||
(shouldProxy && method != HTTP) ||
|
||||
((!shouldProxy) && method != HTTP_CLEARNET && method != HTTPS_CLEARNET) ||
|
||||
updateSources.isEmpty())
|
||||
return null;
|
||||
UpdateRunner update = new UpdateRunner(_context, _mgr, type, method, updateSources);
|
||||
|
Reference in New Issue
Block a user