propagate from branch 'i2p.i2p.zzz.test3' (head e19da9b978ed2ec03adb0e326fff6870746cc4fc)

to branch 'i2p.i2p' (head 179b9a7974d64853c0c91924a5ad86e8b04ee7ba)
This commit is contained in:
zzz
2009-08-24 00:08:30 +00:00
17 changed files with 157 additions and 63 deletions

View File

@ -1109,7 +1109,11 @@ public class Router {
return;
}
System.out.println("INFO: Update file exists [" + UPDATE_FILE + "] - installing");
boolean ok = FileUtil.extractZip(updateFile, _context.getBaseDir());
// verify the whole thing first
// we could remember this fails, and not bother restarting, but who cares...
boolean ok = FileUtil.verifyZip(updateFile);
if (ok)
ok = FileUtil.extractZip(updateFile, _context.getBaseDir());
if (ok)
System.out.println("INFO: Update installed");
else
@ -1132,6 +1136,7 @@ public class Router {
updateFile.deleteOnExit();
}
}
// exit whether ok or not
if (System.getProperty("wrapper.version") != null)
System.out.println("INFO: Restarting after update");
else

View File

@ -111,10 +111,11 @@ class ProfileOrganizerRenderer {
if (isIntegrated) buf.append(", Integrated");
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
if (info != null) {
buf.append(" (").append(info.getCapabilities());
// prevent HTML injection in the caps and version
buf.append(" (").append(DataHelper.stripHTML(info.getCapabilities()));
String v = info.getOption("router.version");
if (v != null)
buf.append(' ').append(v);
buf.append(' ').append(DataHelper.stripHTML(v));
buf.append(')');
}
@ -153,6 +154,9 @@ class ProfileOrganizerRenderer {
buf.append("<td nowrap align=\"center\"><a target=\"_blank\" href=\"dumpprofile.jsp?peer=").append(peer.toBase64().substring(0,6)).append("\">profile</a>");
buf.append("&nbsp;<a href=\"configpeer.jsp?peer=").append(peer.toBase64()).append("\">+-</a></td>\n");
buf.append("</tr>");
// let's not build the whole page in memory (~500 bytes per peer)
out.write(buf.toString());
buf.setLength(0);
}
buf.append("</table>");
@ -189,7 +193,7 @@ class ProfileOrganizerRenderer {
buf.append("</td>");
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
if (info != null)
buf.append("<td align=\"center\">" + info.getCapabilities() + "</td>");
buf.append("<td align=\"center\">").append(DataHelper.stripHTML(info.getCapabilities())).append("</td>");
else
buf.append("<td>&nbsp;</td>");
buf.append("</code></td>");

View File

@ -645,20 +645,20 @@ public class NTCPTransport extends TransportImpl {
buf.append("<p><b id=\"ntcpcon\"><h3>NTCP connections: ").append(peers.size());
buf.append(". Limit: ").append(getMaxConnections());
buf.append(". Timeout: ").append(DataHelper.formatDuration(_pumper.getIdleTimeout()));
buf.append(".</b></h3>\n");
buf.append("<div class=\"wideload\"><table>\n");
buf.append("<tr><th><a href=\"#def.peer\">Peer</a></th>");
buf.append("<th>Dir</th>");
buf.append("<th align=\"right\"><a href=\"#def.idle\">Idle</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.rate\">In/Out</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.up\">Up</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.skew\">Skew</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.send\">TX</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.recv\">RX</a></th>");
buf.append("<th>Out queue</th>");
buf.append("<th>Backlogged?</th>");
buf.append("<th>Reading?</th>");
buf.append(" </tr>\n");
buf.append(".</b></h3>\n" +
"<div class=\"wideload\"><table>\n" +
"<tr><th><a href=\"#def.peer\">Peer</a></th>" +
"<th>Dir</th>" +
"<th align=\"right\"><a href=\"#def.idle\">Idle</a></th>" +
"<th align=\"right\"><a href=\"#def.rate\">In/Out</a></th>" +
"<th align=\"right\"><a href=\"#def.up\">Up</a></th>" +
"<th align=\"right\"><a href=\"#def.skew\">Skew</a></th>" +
"<th align=\"right\"><a href=\"#def.send\">TX</a></th>" +
"<th align=\"right\"><a href=\"#def.recv\">RX</a></th>" +
"<th>Out queue</th>" +
"<th>Backlogged?</th>" +
"<th>Reading?</th>" +
" </tr>\n");
out.write(buf.toString());
buf.setLength(0);
for (Iterator iter = peers.iterator(); iter.hasNext(); ) {
@ -726,8 +726,8 @@ public class NTCPTransport extends TransportImpl {
buf.append("</td> <td align=\"center\"><b>").append(DataHelper.formatDuration(totalUptime/peers.size()));
buf.append("</b></td> <td align=\"center\"><b>").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
buf.append("</b></td> <td align=\"center\"><b>").append(totalSend).append("</b></td> <td align=\"center\"><b>").append(totalRecv);
buf.append("</b></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;");
buf.append("</td></tr>\n");
buf.append("</b></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;" +
"</td></tr>\n");
}
buf.append("</table></div></p>\n");