* confignet: Add UDP disable option

This commit is contained in:
zzz
2012-01-27 18:55:41 +00:00
parent 65504e8660
commit b54c9fd2c1
4 changed files with 34 additions and 0 deletions

View File

@ -49,6 +49,7 @@ public class ConfigNetHandler extends FormHandler {
private boolean _enableLoadTesting;
private String _sharePct;
private boolean _ratesOnly;
private boolean _udpDisabled;
private final Map<String, String> 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"));

View File

@ -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) {

View File

@ -68,6 +68,8 @@
</p><p><b><%=intl._("UDP Configuration:")%></b><br>
<%=intl._("UDP port:")%>
<input name ="udpPort" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="configuredUdpPort" />" ><br>
<input type="checkbox" class="optbox" name="disableUDP" value="disabled" <%=nethelper.getUdpDisabledChecked() %> >
<%=intl._("Completely disable")%> <i><%=intl._("(select only if behind a firewall that blocks outbound UDP)")%></i><br>
<% /********
<!-- let's keep this simple...
<input type="checkbox" class="optbox" name="requireIntroductions" value="true" <jsp:getProperty name="nethelper" property="requireIntroductionsChecked" /> />

View File

@ -1,3 +1,9 @@
2012-01-27 zzz
* Build: Repack release jars with pack200 -r, saves about 1% and
might save a little memory at runtime too
* confignet: Add UDP disable option
* SAM: Remove client demo classes from sam.jar
2012-01-26 zzz
* configclients: Fix form action default
* NetDB: Increase min ff to 200