Changeset 5b05d86


Ignore:
Timestamp:
Dec 16, 2011 12:24:37 PM (9 years ago)
Author:
dream <dream@…>
Branches:
master
Children:
1488cd0, a7311a57
Parents:
7864404 (diff), 212981d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of '577418047ed3ead63f9f7dc4211cf4ac7e19d251'

and 'c5d321a2c838422c5e813359c2e86f9b98561cf9'

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java

    r7864404 r5b05d86  
    1919import net.i2p.util.FileUtil;
    2020import net.i2p.util.I2PAppThread;
     21import net.i2p.util.PortMapper;
    2122import net.i2p.util.SecureDirectory;
    2223import net.i2p.util.SecureFileOutputStream;
     
    208209            // add standard listeners
    209210            if (_listenPort != null) {
     211                Integer lport = Integer.parseInt(_listenPort);
    210212                StringTokenizer tok = new StringTokenizer(_listenHost, " ,");
    211213                while (tok.hasMoreTokens()) {
     
    216218                        //else
    217219                        //    _server.addListener(host + ':' + _listenPort);
    218                         Integer lport = Integer.parseInt(_listenPort);
    219220                        InetAddrPort iap = new InetAddrPort(host, lport);
    220221                        SocketListener lsnr = new SocketListener(iap);
     
    231232                    }
    232233                }
     234                // XXX: what if listenhosts do not include 127.0.0.1? (Should that ever even happen?)
     235                I2PAppContext.getGlobalContext().portMapper().register(PortMapper.SVC_CONSOLE,lport);
    233236            }
    234237
     
    268271                        }
    269272                    }
     273                    I2PAppContext.getGlobalContext().portMapper().register(PortMapper.SVC_HTTPS_CONSOLE,sslPort);
    270274                } else {
    271275                    System.err.println("Unable to create or access keystore for SSL: " + keyStore.getAbsolutePath());
  • apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java

    r7864404 r5b05d86  
    1313import net.i2p.util.Log;
    1414import net.i2p.util.SecureDirectory;
     15import net.i2p.util.PortMapper;
    1516
    1617import org.mortbay.http.HttpContext;
     
    142143            HttpListener[] hl = s.getListeners();
    143144            for (int j = 0; j < hl.length; j++) {
    144                 if (hl[j].getPort() == 7657)
     145                if (hl[j].getPort() == I2PAppContext.getGlobalContext().portMapper().getPort(PortMapper.SVC_CONSOLE))
    145146                    return s;
    146147            }
  • core/java/src/net/i2p/util/PortMapper.java

    r7864404 r5b05d86  
    5959     */
    6060    public int getPort(String service) {
    61         return getPort(service, -1);
     61        int port = getPort(service, -1);
     62        if(-1==port)
     63            throw new RuntimeException("No port registered for service "+service);
     64        return port;
    6265    }
    6366
Note: See TracChangeset for help on using the changeset viewer.