Changeset 65ae9138


Ignore:
Timestamp:
May 28, 2009 1:49:57 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b43338bd
Parents:
665b691
Message:
  • Console:
    • config.jsp now cause graceful restart
  • UPnP:
    • Tweak to help startup problems
  • UDP:
    • Only save IP when it changes
Files:
4 edited

Legend:

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

    r665b691 r65ae9138  
    216216                _context.router().setConfigSetting(PROP_HIDDEN, "" + _hiddenMode);
    217217                if (_hiddenMode)
    218                     addFormNotice("Gracefully restarting into Hidden Router Mode. Make sure you have no 0-1 length "
    219                               + "<a href=\"configtunnels.jsp\">tunnels!</a>");
     218                    addFormError("Gracefully restarting into Hidden Router Mode");
    220219                else
    221                     addFormNotice("Gracefully restarting to exit Hidden Router Mode");
     220                    addFormError("Gracefully restarting to exit Hidden Router Mode");
    222221            }
    223222
     
    226225            if (Boolean.valueOf(_context.getProperty(TransportManager.PROP_ENABLE_UPNP)).booleanValue() !=
    227226                _upnp) {
     227                // This is minor, don't set restartRequired
    228228                if (_upnp)
    229229                    addFormNotice("Enabling UPnP, restart required to take effect");
     
    241241
    242242            // Time sync enable, means NOT disabled
    243             _context.router().setConfigSetting(Timestamper.PROP_DISABLED, "false");
     243            // Hmm router sets this at startup, not required here
     244            //_context.router().setConfigSetting(Timestamper.PROP_DISABLED, "false");
    244245           
    245             LoadTestManager.setEnableLoadTesting(_context, _enableLoadTesting);
     246            // Hidden in the GUI
     247            //LoadTestManager.setEnableLoadTesting(_context, _enableLoadTesting);
    246248        }
    247249       
     
    257259            hiddenSwitch();
    258260        } else if (restartRequired) {
     261            // Wow this dumps all conns immediately and really isn't nice
    259262            //addFormNotice("Performing a soft restart");
    260263            //_context.router().restart();
    261264            //addFormNotice("Soft restart complete");
     265
    262266            // Most of the time we aren't changing addresses, just enabling or disabling
    263267            // things, so let's try just a new routerInfo and see how that works.
    264268            // Maybe we should restart if we change addresses though?
    265             _context.router().rebuildRouterInfo();
    266             addFormNotice("Router Info rebuilt");
     269            // No, this doesn't work well, really need to call SSU Transport externalAddressReceived(),
     270            // but that's hard to get to, and doesn't handle port changes, etc.
     271            // So don't do this...
     272            //_context.router().rebuildRouterInfo();
     273            //addFormNotice("Router Info rebuilt");
     274
     275            // There's a few changes that don't really require restart (e.g. enabling inbound TCP)
     276            // But it would be hard to get right, so just do a restart.
     277            addFormError("Gracefully restarting I2P to change published router address");
     278            _context.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
    267279        }
    268280    }
  • apps/routerconsole/jsp/config.jsp

    r665b691 r65ae9138  
    116116    <br />
    117117    <input type="radio" name="udpAutoIP" value="hidden" <%=nethelper.getUdpAutoIPChecked(2) %> />
    118     Hidden mode - do not publish IP <i>(prevents participating traffic; change restarts router)</i><br />
     118    Hidden mode - do not publish IP <i>(prevents participating traffic)</i><br />
    119119 </p><p>
    120120 <b>UDP Configuration:</b><br />
     
    143143    Disable inbound (Firewalled)<br />
    144144    <input type="radio" name="ntcpAutoIP" value="disabled" <%=nethelper.getTcpAutoIPChecked(4) %> />
    145     Completely disable <i>(select only if behind a firewall that throttles or blocks outbound TCP - change requires restart)</i><br />
     145    Completely disable <i>(select only if behind a firewall that throttles or blocks outbound TCP)</i><br />
    146146 </p><p>
    147147 Externally reachable TCP port:<br />
     
    152152    Specify Port:
    153153    <input name ="ntcpport" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="ntcpport" />" /><br />
    154  </p><p><b>Note: changing any of these settings will terminate all of your connections and effectively
    155     restart your router.</b>
     154 </p><p><b>Note: Changing these settings will restart your router.</b>
    156155 </p>
    157156 <input type="submit" name="save" value="Save changes" /> <input type="reset" value="Cancel" /><br />
  • router/java/src/net/i2p/router/transport/UPnPManager.java

    r665b691 r65ae9138  
    3131    private UPnP _upnp;
    3232    private UPnPCallback _upnpCallback;
    33     private boolean _isRunning;
     33    private volatile boolean _isRunning;
    3434    private InetAddress _detectedAddress;
    3535    private TransportManager _manager;
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r665b691 r65ae9138  
    478478            _context.commSystem().queueLookup(ourIP);
    479479            // store these for laptop-mode (change ident on restart... or every time... when IP changes)
    480             _context.router().setConfigSetting(PROP_IP, _externalListenHost.getHostAddress());
    481             _context.router().setConfigSetting(PROP_IP_CHANGE, "" + _context.clock().now());
    482             _context.router().saveConfig();
     480            String oldIP = _context.getProperty(PROP_IP);
     481            if (!_externalListenHost.getHostAddress().equals(oldIP)) {
     482                _context.router().setConfigSetting(PROP_IP, _externalListenHost.getHostAddress());
     483                _context.router().setConfigSetting(PROP_IP_CHANGE, "" + _context.clock().now());
     484                _context.router().saveConfig();
     485            }
    483486            _context.router().rebuildRouterInfo();
    484487        }
Note: See TracChangeset for help on using the changeset viewer.