- Simplify config.jsp some more

- No longer use i2np.udp.forceIntroducers
- Tweak UDP port qualification
- Fix allowing low ports again
- Add option to completely disable NTCP, for those behind nasty firewalls
- Use SSU reachability rather than global reachability for determining NTCP reachability,
  since we are now reporting NTCP reachability too
This commit is contained in:
zzz
2009-05-06 00:54:24 +00:00
parent e82f173f85
commit 0b7fb21263
6 changed files with 49 additions and 32 deletions

View File

@ -28,14 +28,10 @@ public class ConfigNetHelper extends HelperBase {
}
public String getNtcphostname() {
if (!TransportManager.enableNTCP(_context))
return "\" disabled=\"true";
return _context.getProperty(PROP_I2NP_NTCP_HOSTNAME, "");
}
public String getNtcpport() {
if (!TransportManager.enableNTCP(_context))
return "\" disabled=\"true";
return _context.getProperty(PROP_I2NP_NTCP_PORT, "");
}
@ -91,8 +87,6 @@ public class ConfigNetHelper extends HelperBase {
}
public String getTcpAutoPortChecked(int mode) {
if (!TransportManager.enableNTCP(_context))
return DISABLED;
String port = _context.getProperty(PROP_I2NP_NTCP_PORT);
boolean specified = port != null && port.length() > 0;
if ((mode == 1 && specified) ||
@ -102,17 +96,15 @@ public class ConfigNetHelper extends HelperBase {
}
public String getTcpAutoIPChecked(int mode) {
if (!TransportManager.enableNTCP(_context))
return DISABLED;
boolean enabled = TransportManager.enableNTCP(_context);
String hostname = _context.getProperty(PROP_I2NP_NTCP_HOSTNAME);
boolean specified = hostname != null && hostname.length() > 0;
String auto = _context.getProperty(PROP_I2NP_NTCP_AUTO_IP);
if (auto == null)
auto = "false";
if ((mode == 0 && (!specified) && auto.equals("false")) ||
(mode == 1 && specified && auto.equals("false")) ||
(mode == 2 && auto.equals("true")) ||
(mode == 3 && auto.equals("always")))
String auto = _context.getProperty(PROP_I2NP_NTCP_AUTO_IP, "false");
if ((mode == 0 && (!specified) && auto.equals("false") && enabled) ||
(mode == 1 && specified && auto.equals("false") && enabled) ||
(mode == 2 && auto.equals("true") && enabled) ||
(mode == 3 && auto.equals("always") && enabled) ||
(mode == 4 && !enabled))
return CHECKED;
return "";
}