forked from I2P_Developers/i2p.i2p
* Console: Display full path to config file
* i2ptunnel: More escaping
This commit is contained in:
@@ -58,7 +58,7 @@ public class EditBean extends IndexBean {
|
||||
public String getTargetHost(int tunnel) {
|
||||
TunnelController tun = getController(tunnel);
|
||||
if (tun != null && tun.getTargetHost() != null)
|
||||
return tun.getTargetHost();
|
||||
return DataHelper.escapeHTML(tun.getTargetHost());
|
||||
else
|
||||
return "127.0.0.1";
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class EditBean extends IndexBean {
|
||||
public String getTargetPort(int tunnel) {
|
||||
TunnelController tun = getController(tunnel);
|
||||
if (tun != null && tun.getTargetPort() != null)
|
||||
return tun.getTargetPort();
|
||||
return DataHelper.escapeHTML(tun.getTargetPort());
|
||||
else
|
||||
return "";
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class EditBean extends IndexBean {
|
||||
public String getSpoofedHost(int tunnel) {
|
||||
TunnelController tun = getController(tunnel);
|
||||
if (tun != null && tun.getSpoofedHost() != null)
|
||||
return tun.getSpoofedHost();
|
||||
return DataHelper.escapeHTML(tun.getSpoofedHost());
|
||||
else
|
||||
return "";
|
||||
}
|
||||
@@ -295,44 +295,44 @@ public class EditBean extends IndexBean {
|
||||
}
|
||||
|
||||
/** all of these are @since 0.8.3 */
|
||||
public String getLimitMinute(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_CONNS_MIN, "0");
|
||||
public int getLimitMinute(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_CONNS_MIN, 0);
|
||||
}
|
||||
|
||||
public String getLimitHour(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_CONNS_HOUR, "0");
|
||||
public int getLimitHour(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_CONNS_HOUR, 0);
|
||||
}
|
||||
|
||||
public String getLimitDay(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_CONNS_DAY, "0");
|
||||
public int getLimitDay(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_CONNS_DAY, 0);
|
||||
}
|
||||
|
||||
public String getTotalMinute(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_MIN, "0");
|
||||
public int getTotalMinute(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_MIN, 0);
|
||||
}
|
||||
|
||||
public String getTotalHour(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_HOUR, "0");
|
||||
public int getTotalHour(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_HOUR, 0);
|
||||
}
|
||||
|
||||
public String getTotalDay(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_DAY, "0");
|
||||
public int getTotalDay(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_TOTAL_CONNS_DAY, 0);
|
||||
}
|
||||
|
||||
public String getMaxStreams(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_STREAMS, "0");
|
||||
public int getMaxStreams(int tunnel) {
|
||||
return getProperty(tunnel, PROP_MAX_STREAMS, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST limits
|
||||
* @since 0.9.9
|
||||
*/
|
||||
public String getPostMax(int tunnel) {
|
||||
return getProperty(tunnel, I2PTunnelHTTPServer.OPT_POST_MAX, "0");
|
||||
public int getPostMax(int tunnel) {
|
||||
return getProperty(tunnel, I2PTunnelHTTPServer.OPT_POST_MAX, 0);
|
||||
}
|
||||
|
||||
public String getPostTotalMax(int tunnel) {
|
||||
return getProperty(tunnel, I2PTunnelHTTPServer.OPT_POST_TOTAL_MAX, "0");
|
||||
public int getPostTotalMax(int tunnel) {
|
||||
return getProperty(tunnel, I2PTunnelHTTPServer.OPT_POST_TOTAL_MAX, 0);
|
||||
}
|
||||
|
||||
public int getPostCheckTime(int tunnel) {
|
||||
@@ -371,8 +371,11 @@ public class EditBean extends IndexBean {
|
||||
TunnelController tun = getController(tunnel);
|
||||
if (tun != null) {
|
||||
Properties opts = getOptions(tun);
|
||||
if (opts != null)
|
||||
return opts.getProperty(prop, def);
|
||||
if (opts != null) {
|
||||
String rv = opts.getProperty(prop);
|
||||
if (rv != null)
|
||||
return DataHelper.escapeHTML(rv);
|
||||
}
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
@@ -19,4 +19,9 @@ public class ConfigAdvancedHelper extends HelperBase {
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/** @since 0.9.14.1 */
|
||||
public String getConfigFileName() {
|
||||
return _context.router().getConfigFilename();
|
||||
}
|
||||
}
|
||||
|
@@ -38,6 +38,6 @@
|
||||
<br><b><%=intl._("NOTE")%>:</b> <%=intl._("Some changes may require a restart to take effect.")%>
|
||||
</div></form>
|
||||
<% } else { %>
|
||||
To make changes, edit the router.config file.
|
||||
<%=intl._("To make changes, edit the file {0}.", "<tt>" + advancedhelper.getConfigFileName() + "</tt>")%>
|
||||
<% } // isAdvanced %>
|
||||
</div></div></div></body></html>
|
||||
|
@@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 4;
|
||||
public final static long BUILD = 5;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "-rc";
|
||||
|
Reference in New Issue
Block a user