diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java index cf1caf99b..3561def58 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java @@ -49,6 +49,7 @@ public class ConfigNetHandler extends FormHandler { private boolean _enableLoadTesting; private String _sharePct; private boolean _ratesOnly; + private boolean _udpDisabled; private final Map changes = new HashMap(); private static final String PROP_HIDDEN = Router.PROP_HIDDEN_HIDDEN; // see Router for other choice @@ -130,6 +131,11 @@ public class ConfigNetHandler extends FormHandler { _ratesOnly = true; } + /** @since 0.8.13 */ + public void setDisableUDP(String foo) { + _udpDisabled = true; + } + private void recheckReachability() { _context.commSystem().recheckReachability(); addFormNotice(_("Rechecking router reachability...")); @@ -270,6 +276,16 @@ public class ConfigNetHandler extends FormHandler { } changes.put(UDPTransport.PROP_LAPTOP_MODE, "" + _laptop); + if (_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP) != + !_udpDisabled) { + if (_udpDisabled) + addFormNotice(_("Disabling UDP")); + else + addFormNotice(_("Enabling UDP")); + restartRequired = true; + } + changes.put(TransportManager.PROP_ENABLE_UDP, "" + (!_udpDisabled)); + if (_requireIntroductions) { changes.put(UDPTransport.PROP_FORCE_INTRODUCERS, "true"); addFormNotice(_("Requiring SSU introducers")); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java index fdbe77f9e..e9d3b1529 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java @@ -135,6 +135,16 @@ public class ConfigNetHelper extends HelperBase { return ""; } + /** + * default false, inverse of default true property + * @since 0.8.13 + */ + public String getUdpDisabledChecked() { + if (!_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP)) + return CHECKED; + return ""; + } + public String getRequireIntroductionsChecked() { short status = _context.commSystem().getReachabilityStatus(); switch (status) { diff --git a/apps/routerconsole/jsp/confignet.jsp b/apps/routerconsole/jsp/confignet.jsp index d11dfba91..59b3f27d3 100644 --- a/apps/routerconsole/jsp/confignet.jsp +++ b/apps/routerconsole/jsp/confignet.jsp @@ -68,6 +68,8 @@

<%=intl._("UDP Configuration:")%>
<%=intl._("UDP port:")%> " >
+ > + <%=intl._("Completely disable")%> <%=intl._("(select only if behind a firewall that blocks outbound UDP)")%>
<% /********