Revert xhtml regressions in i2ptunnel code; fixes for various validation issues.

This commit is contained in:
z3d
2009-08-17 20:17:30 +00:00
parent 1b63aa411b
commit 6a8dd0f053
15 changed files with 79 additions and 80 deletions

View File

@ -345,7 +345,7 @@ public class I2PTunnelConnectClient extends I2PTunnelClientBase implements Runna
if (targetRequest != null) {
out.write(targetRequest.getBytes());
if (usingWWWProxy)
out.write(("<br>WWW proxy: " + wwwProxy).getBytes());
out.write(("<br />WWW proxy: " + wwwProxy).getBytes());
}
out.write("</div>".getBytes());
out.write("\n</body></html>\n".getBytes());

View File

@ -388,7 +388,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
String conflictURL = protocol + alias + ".i2p/?" + initialFragments;
out.write(header);
out.write(("To visit the destination in your host database, click <a href=\"" + trustedURL + "\">here</a>. To visit the conflicting addresshelper link by temporarily giving it a random alias, click <a href=\"" + conflictURL + "\">here</a>.<P/>").getBytes());
out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes());
out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes());
out.write(new Date().toString().getBytes());
out.write("</i></div></body></html>\n".getBytes());
out.flush();
@ -705,9 +705,9 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
out.write("\">http://".getBytes());
out.write(uri.getBytes());
out.write("</a>".getBytes());
if (usingWWWProxy) out.write(("<br>WWW proxy: " + wwwProxy).getBytes());
if (usingWWWProxy) out.write(("<br />WWW proxy: " + wwwProxy).getBytes());
if (showAddrHelper) {
out.write("<br><br>Click a link below to look for an address helper by using a \"jump\" service:<br>".getBytes());
out.write("<br /><br />Click a link below to look for an address helper by using a \"jump\" service:<br />".getBytes());
for (int i = 0; i < jumpServers.length; i++) {
// Skip jump servers we don't know
String jumphost = jumpServers[i].substring(7); // "http://"
@ -719,7 +719,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
continue;
}
out.write("<br><a href=\"".getBytes());
out.write("<br /><a href=\"".getBytes());
out.write(jumpServers[i].getBytes());
out.write(uri.getBytes());
out.write("\">".getBytes());
@ -729,7 +729,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
}
}
}
out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes());
out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes());
out.write(new Date().toString().getBytes());
out.write("</i></div></body></html>\n".getBytes());
out.flush();

View File

@ -464,7 +464,7 @@ public class TunnelController implements Logging {
private void getHttpClientSummary(StringBuilder buf) {
String description = getDescription();
if ( (description != null) && (description.trim().length() > 0) )
buf.append("<i>").append(description).append("</i><br>\n");
buf.append("<i>").append(description).append("</i><br />\n");
buf.append("HTTP proxy listening on port ").append(getListenPort());
String listenOn = getListenOnInterface();
if ("0.0.0.0".equals(listenOn))
@ -473,19 +473,19 @@ public class TunnelController implements Logging {
buf.append(" (reachable locally only)");
else
buf.append(" (reachable at the ").append(listenOn).append(" interface)");
buf.append("<br>\n");
buf.append("<br />\n");
String proxies = getProxyList();
if ( (proxies == null) || (proxies.trim().length() <= 0) )
buf.append("Outproxy: default [squid.i2p]<br>\n");
buf.append("Outproxy: default [squid.i2p]<br />\n");
else
buf.append("Outproxy: ").append(proxies).append("<br>\n");
buf.append("Outproxy: ").append(proxies).append("<br />\n");
getOptionSummary(buf);
}
private void getClientSummary(StringBuilder buf) {
String description = getDescription();
if ( (description != null) && (description.trim().length() > 0) )
buf.append("<i>").append(description).append("</i><br>\n");
buf.append("<i>").append(description).append("</i><br />\n");
buf.append("Client tunnel listening on port ").append(getListenPort());
buf.append(" pointing at ").append(getTargetDestination());
String listenOn = getListenOnInterface();
@ -495,58 +495,58 @@ public class TunnelController implements Logging {
buf.append(" (reachable locally only)");
else
buf.append(" (reachable at the ").append(listenOn).append(" interface)");
buf.append("<br>\n");
buf.append("<br />\n");
getOptionSummary(buf);
}
private void getServerSummary(StringBuilder buf) {
String description = getDescription();
if ( (description != null) && (description.trim().length() > 0) )
buf.append("<i>").append(description).append("</i><br>\n");
buf.append("<i>").append(description).append("</i><br />\n");
buf.append("Server tunnel pointing at port ").append(getTargetPort());
buf.append(" on ").append(getTargetHost());
buf.append("<br>\n");
buf.append("Private destination loaded from ").append(getPrivKeyFile()).append("<br>\n");
buf.append("<br />\n");
buf.append("Private destination loaded from ").append(getPrivKeyFile()).append("<br />\n");
getOptionSummary(buf);
}
private void getHttpServerSummary(StringBuilder buf) {
String description = getDescription();
if ( (description != null) && (description.trim().length() > 0) )
buf.append("<i>").append(description).append("</i><br>\n");
buf.append("<i>").append(description).append("</i><br />\n");
buf.append("Server tunnel pointing at port ").append(getTargetPort());
buf.append(" on ").append(getTargetHost());
buf.append(" for the site ").append(getSpoofedHost());
buf.append("<br>\n");
buf.append("Private destination loaded from ").append(getPrivKeyFile()).append("<br>\n");
buf.append("<br />\n");
buf.append("Private destination loaded from ").append(getPrivKeyFile()).append("<br />\n");
getOptionSummary(buf);
}
private void getOptionSummary(StringBuilder buf) {
String opts = getClientOptions();
if ( (opts != null) && (opts.length() > 0) )
buf.append("Network options: ").append(opts).append("<br>\n");
buf.append("Network options: ").append(opts).append("<br />\n");
if (_running) {
List sessions = _tunnel.getSessions();
for (int i = 0; i < sessions.size(); i++) {
I2PSession session = (I2PSession)sessions.get(i);
Destination dest = session.getMyDestination();
if (dest != null) {
buf.append("Destination hash: ").append(dest.calculateHash().toBase64()).append("<br>\n");
buf.append("Destination hash: ").append(dest.calculateHash().toBase64()).append("<br />\n");
if ( ("server".equals(getType())) || ("httpserver".equals(getType())) ) {
buf.append("Full destination: ");
buf.append("<input type=\"text\" size=\"10\" onclick=\"this.select();\" ");
buf.append("value=\"").append(dest.toBase64()).append("\" />\n");
long val = new Random().nextLong();
if (val < 0) val = 0 - val;
buf.append("<br>You can <a href=\"http://temp").append(val);
buf.append("<br />You can <a href=\"http://temp").append(val);
buf.append(".i2p/?i2paddresshelper=").append(dest.toBase64()).append("\">view</a>");
buf.append(" it in a browser (only when you're using the eepProxy)\n");
buf.append("<br>If you are going to share this on IRC, you need to split it up:<br>\n");
buf.append("<br />If you are going to share this on IRC, you need to split it up:<br />\n");
String str = dest.toBase64();
buf.append(str.substring(0, str.length()/2)).append("<br>\n");
buf.append(str.substring(str.length()/2)).append("<br>\n");
buf.append("You can also post it to <a href=\"http://forum.i2p/viewforum.php?f=16\">Eepsite announcement forum</a><br>");
buf.append(str.substring(0, str.length()/2)).append("<br />\n");
buf.append(str.substring(str.length()/2)).append("<br />\n");
buf.append("You can also post it to <a href=\"http://forum.i2p/viewforum.php?f=16\">Eepsite announcement forum</a><br />");
}
}
}

View File

@ -50,7 +50,7 @@
</div>
<div class="separator">
<hr>
<hr />
</div>
<div id="nameField" class="rowItem">
@ -71,7 +71,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="accessField" class="rowItem">
@ -129,7 +129,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<% if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType)) {
@ -197,7 +197,7 @@
</div>
<div class="separator">
<hr>
<hr />
</div>
<div id="tunnelOptionsField" class="rowItem">
@ -265,7 +265,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="optionsField" class="rowItem">
@ -286,7 +286,7 @@
<% if (!"streamrclient".equals(tunnelType)) { // streamr client sends pings so it will never be idle %>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="optionsField" class="rowItem">
@ -314,7 +314,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="optionsField" class="rowItem">
@ -335,10 +335,10 @@
<table border="0"><tr><!-- I give up -->
<td><input value="1" type="radio" id="startOnLoad" name="newDest" title="New Destination"
<%=(editBean.getNewDest(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
<td valign="center">Enable
<td>Enable
<td><input value="0" type="radio" id="startOnLoad" name="newDest" title="New Destination"
<%=(editBean.getNewDest(curTunnel) || editBean.getPersistentClientKey(curTunnel) ? "" : " checked=\"checked\"")%> class="tickbox" />
<td valign="center">Disable
<td>Disable
</table>
</div>
<div id="portField" class="rowItem">
@ -349,7 +349,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="optionsField" class="rowItem">
@ -366,7 +366,7 @@
<% } // !streamrclient %>
<div class="subdivider">
<hr>
<hr />
</div>
<% if ("client".equals(tunnelType) || "ircclient".equals(tunnelType)) { %>
@ -393,7 +393,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<% } %>

View File

@ -50,7 +50,7 @@
</div>
<div class="separator">
<hr>
<hr />
</div>
<div id="nameField" class="rowItem">
@ -78,7 +78,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="targetField" class="rowItem">
@ -110,7 +110,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<% if ("httpserver".equals(tunnelType)) {
@ -164,7 +164,7 @@
</div>
<div class="separator">
<hr>
<hr />
</div>
<div id="tunnelOptionsField" class="rowItem">
@ -232,7 +232,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="optionsField" class="rowItem">
@ -252,7 +252,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="optionsField" class="rowItem">
@ -281,7 +281,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="optionsField" class="rowItem">
@ -304,7 +304,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="optionsField" class="rowItem">
@ -332,7 +332,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="tunnelOptionsField" class="rowItem">
@ -382,7 +382,7 @@
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<div id="customOptionsField" class="rowItem">

View File

@ -27,13 +27,13 @@ p-equiv="Content-Type" content="text/html; charset=UTF-8" />
</div>
<div class="separator">
<hr>
<hr />
</div>
<textarea id="statusMessages" rows="4" cols="60" readonly="readonly"><jsp:getProperty name="indexBean" property="messages" /></textarea>
<div class="separator">
<hr>
<hr />
</div>
<div class="footer">
@ -74,7 +74,7 @@ p-equiv="Content-Type" content="text/html; charset=UTF-8" />
</div>
<div class="statusHeaderField rowItem">
<label>Status:</label>
<hr> </div>
<hr /> </div>
<%
for (int curServer = 0; curServer < indexBean.getTunnelCount(); curServer++) {
@ -106,7 +106,7 @@ p-equiv="Content-Type" content="text/html; charset=UTF-8" />
<a class="control" title="Test HTTP server through I2P" href="http://<%=indexBean.getDestHashBase32(curServer)%>.b32.i2p">Preview</a>
<%
} else if (indexBean.getTunnelStatus(curServer) == IndexBean.RUNNING) {
%><span class="text">Base32 Address:<br><%=indexBean.getDestHashBase32(curServer)%>.b32.i2p</span>
%><span class="text">Base32 Address:<br /><%=indexBean.getDestHashBase32(curServer)%>.b32.i2p</span>
<%
} else {
%><span class="comment">No Preview</span>
@ -141,13 +141,13 @@ p-equiv="Content-Type" content="text/html; charset=UTF-8" />
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<%
}
%>
<div class="separator">
<hr>
<hr />
</div>
<div class="footer">
@ -194,7 +194,7 @@ p-equiv="Content-Type" content="text/html; charset=UTF-8" />
</div>
<div class="separator">
<hr>
<hr />
</div>
<%
for (int curClient = 0; curClient < indexBean.getTunnelCount(); curClient++) {
@ -262,13 +262,13 @@ p-equiv="Content-Type" content="text/html; charset=UTF-8" />
</div>
<div class="subdivider">
<hr>
<hr />
</div>
<%
}
%>
<div class="separator">
<hr>
<hr />
</div>
<div class="footer">

View File

@ -74,7 +74,7 @@ public class ConfigTunnelsHelper extends HelperBase {
out.getQuantity() + out.getBackupQuantity() >= WARN_QUANTITY)
buf.append("<tr><th colspan=\"3\"><font color=\"red\">PERFORMANCE WARNING - Settings include high tunnel quantities.</font></th></tr>");
buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound Tunnels\"/>&nbsp;&nbsp;Inbound</th><th><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound Tunnels\" title=\"Outbound\"/>&nbsp;&nbsp;Outbound</th></tr>\n");
buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound Tunnels\">&nbsp;&nbsp;Inbound</th><th><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound Tunnels\" title=\"Outbound\">&nbsp;&nbsp;Outbound</th></tr>\n");
// buf.append("<tr><th></th><th>Inbound</th><th>Outbound</th></tr>\n");

View File

@ -66,7 +66,7 @@ public class GraphHelper extends HelperBase {
+ "&amp;periodCount=" + _periodCount
+ "&amp;width=" + _width
+ "&amp;height=" + (_height - 14)
+ "\" title=\"Combined bandwidth graph\" /></a>\n");
+ "\" alt=\"Combined bandwidth graph\" title=\"Combined bandwidth graph\"></a>\n");
}
for (Iterator iter = ordered.iterator(); iter.hasNext(); ) {
@ -80,7 +80,7 @@ public class GraphHelper extends HelperBase {
+ "&amp;periodCount=" + (3 * _periodCount)
+ "&amp;width=" + (3 * _width)
+ "&amp;height=" + (3 * _height)
+ "\" target=\"_blank\" />");
+ "\" target=\"_blank\">");
_out.write("<img class=\"statimage\" border=\"0\" width=\""
+ (_width + 83) + "\" height=\"" + (_height + 92)
+ "\" src=\"viewstat.jsp?stat="
@ -90,11 +90,12 @@ public class GraphHelper extends HelperBase {
+ "&amp;periodCount=" + _periodCount
+ "&amp;width=" + _width
+ "&amp;height=" + _height
+ "\" title=\"" + title + "\" /></a>\n");
+ "\" alt=\"" + title
+ "\" title=\"" + title + "\"></a>\n");
}
if (_refreshDelaySeconds > 0)
// shorten the refresh by 3 seconds so we beat the iframe
_out.write("<meta http-equiv=\"refresh\" content=\"" + (_refreshDelaySeconds - 3) + "\" />\n");
_out.write("<meta http-equiv=\"refresh\" content=\"" + (_refreshDelaySeconds - 3) + "\">\n");
} catch (IOException ioe) {
ioe.printStackTrace();
@ -103,17 +104,16 @@ public class GraphHelper extends HelperBase {
}
public String getForm() {
try {
_out.write("<br><h3>Configure Graph Display</h3>");
_out.write("<p />[<a href=\"configstats.jsp\">Select Stats to Graph</a>]<p />");
_out.write("<br><h3>Configure Graph Display [<a href=\"configstats.jsp\">Select Stats</a>]</h3>");
_out.write("<form action=\"graphs.jsp\" method=\"GET\">");
_out.write("Periods: <input size=\"3\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\" /><br>\n");
_out.write("Plot averages: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"true\" ") + " /> ");
_out.write("or plot events: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"true\" " : "") + " /><br>\n");
_out.write("Periods: <input size=\"3\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\"><br>\n");
_out.write("Plot averages: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"true\" ") + "> ");
_out.write("or plot events: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"true\" " : "") + "><br>\n");
_out.write("Image sizes: width: <input size=\"4\" type=\"text\" name=\"width\" value=\"" + _width
+ "\" /> pixels, height: <input size=\"4\" type=\"text\" name=\"height\" value=\"" + _height
+ "\" /><br>\n");
+ "\"> pixels, height: <input size=\"4\" type=\"text\" name=\"height\" value=\"" + _height
+ "\"><br>\n");
_out.write("Refresh delay: <select name=\"refreshDelay\"><option value=\"60\">1 minute</option><option value=\"120\">2 minutes</option><option value=\"300\">5 minutes</option><option value=\"600\">10 minutes</option><option value=\"1800\">30 minutes</option><option value=\"3600\">1 hour</option><option value=\"-1\">Never</option></select><br>\n");
_out.write("<br><div class=\"formaction\"><input type=\"submit\" value=\"Redraw\" /></div></div>");
_out.write("<hr><div class=\"formaction\"><input type=\"submit\" value=\"Redraw\"></div></form>");
} catch (IOException ioe) {
ioe.printStackTrace();
}

View File

@ -17,5 +17,5 @@
%>
<jsp:useBean class="net.i2p.router.web.CSSHelper" id="cssHelper" scope="request" />
<jsp:setProperty name="cssHelper" property="contextId" value="<%=(String)session.getAttribute("i2p.contextId")%>" />
<link href="<%=cssHelper.getTheme(request.getHeader("User-Agent"))%>console.css" rel="stylesheet" type="text/css" />
<link href="<%=cssHelper.getTheme(request.getHeader("User-Agent"))%>console.css" rel="stylesheet" type="text/css">
<!--[if IE]><link href="/themes/console/classic/ieshim.css" rel="stylesheet" type="text/css" /><![endif]-->

View File

@ -1,8 +1,7 @@
<html><head><title>I2PTunnel Disabled</title>
<html><head><title>I2P Tunnel Manager Not Running</title>
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
</head>
<body>
I2PTunnel is not running. Go to <a href="/configclients.jsp">the config clients page</a>
to start it.
The I2P Tunnel Manager is not currently running. Please visit the<a href="/configclients.jsp">Client Configuration</a> page to start it.
</body></html>

View File

@ -20,7 +20,8 @@ img {
pre {
overflow: auto;
font-size: 8pt !important;
width: 100%;
width: 95%;
padding-top: 10px;
}
div.logo {

View File

@ -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 = 14;
public final static long BUILD = 15;
/** for example "-test" */
public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;

View File

@ -992,7 +992,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
if (full)
size *= 4;
StringBuilder buf = new StringBuilder(size);
out.write("<h2>Network Database Contents</h2>\n");
out.write("<h2>Network Database Contents (<a href=\"netdb.jsp?l=1\">View LeaseSets</a>)</h2>\n");
if (!_initialized) {
buf.append("<i>Not initialized</i>\n");
out.write(buf.toString());
@ -1000,7 +1000,6 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
return;
}
out.write("<a href=\"netdb.jsp?l=1\">View LeaseSets</a>");
Hash us = _context.routerHash();
out.write("<a name=\"routers\" ></a><h3>Routers (<a href=\"netdb.jsp");
if (full)

View File

@ -643,7 +643,7 @@ public class FIFOBandwidthLimiter {
buf.append("ms ago</li>\n");
}
}
buf.append("</ol></li></ul></p><hr>\n");
buf.append("</ol></li></ul><hr>\n");
out.write(buf.toString());
out.flush();
}

View File

@ -1854,7 +1854,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
}
if (_context.shitlist().isShitlisted(peer.getRemotePeer(), STYLE)) {
if (!appended) buf.append("<br>");
buf.append(" <i>Shitlist</i>");
buf.append(" <i>Banned</i>");
appended = true;
}
//byte[] ip = getIP(peer.getRemotePeer());
@ -2000,7 +2000,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
buf.append("</b></td> <td>&nbsp;</td> <td align=\"center\"><b>");
buf.append(numPeers > 0 ? rtoTotal/numPeers : 0);
buf.append("</b></td>\n <td>&nbsp;</td> <td align=\"center\"><b>");
buf.append(sendTotal).append("</td></b> <td align=\"center\"><b>").append(recvTotal).append("</b></td>\n");
buf.append(sendTotal).append("</b></td> <td align=\"center\"><b>").append(recvTotal).append("</b></td>\n");
buf.append(" <td align=\"center\"><b>").append(resentTotal);
buf.append("</b></td> <td align=\"center\"><b>").append(dupRecvTotal).append("</b></td>\n");
buf.append(" </tr></table></div></p><p>\n");