forked from I2P_Developers/i2p.i2p
Add hooks so the new PortMapper lets i2p plugins not fail when the router console is not on port 7657. Also raise an exception when requesting unregistered ports so as to encourage swift adding of the registration hooks when those ports are taken.
This commit is contained in:
@ -12,6 +12,7 @@ import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.FileUtil;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SecureDirectory;
|
||||
import net.i2p.util.PortMapper;
|
||||
|
||||
import org.mortbay.http.HttpContext;
|
||||
import org.mortbay.http.HttpListener;
|
||||
@ -141,7 +142,7 @@ public class WebAppStarter {
|
||||
Server s = (Server) c.toArray()[i];
|
||||
HttpListener[] hl = s.getListeners();
|
||||
for (int j = 0; j < hl.length; j++) {
|
||||
if (hl[j].getPort() == 7657)
|
||||
if (hl[j].getPort() == I2PAppContext.getGlobalContext().portMapper().getPort(PortMapper.SVC_CONSOLE))
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user