Implemented safegaurd against bad listen addresses.

This commit is contained in:
dev
2011-08-01 12:05:57 +00:00
parent 7468ac3d14
commit 434042a9d1

View File

@ -165,6 +165,13 @@ public class I2PControlHandler implements RequestHandler {
settingsSaved = true;
} catch (Exception e) {
_conf.setConf("i2pcontrol.listen.address", oldAddress);
Server server;
try {
server = I2PControlController.buildServer();
I2PControlController.setServer(server);
} catch (Exception e2){
_log.log(Log.CRIT, "Unable to resume server on previous listening ip. Fuckballs." );
}
_log.error("Client tried to set listen address to, " + newAddress + " which isn't valid", e);
return new JSONRPC2Response(
new JSONRPC2Error(JSONRPC2Error.INVALID_PARAMS.getCode(),