I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit bebe5f8a authored by zzz's avatar zzz
Browse files

PortMapper: Status output for /debug

parent c3af9968
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
*/ */
ctx.routerAppManager().renderStatusHTML(out); ctx.routerAppManager().renderStatusHTML(out);
/*
* Print out the status for the PortMapper
*/
ctx.portMapper().renderStatusHTML(out);
/* /*
* Print out the status for all the SessionKeyManagers * Print out the status for all the SessionKeyManagers
*/ */
......
package net.i2p.util; package net.i2p.util;
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import net.i2p.I2PAppContext; import net.i2p.I2PAppContext;
...@@ -73,4 +78,18 @@ public class PortMapper { ...@@ -73,4 +78,18 @@ public class PortMapper {
return def; return def;
return port.intValue(); return port.intValue();
} }
/**
* For debugging only
* @since 0.9.20
*/
public void renderStatusHTML(Writer out) throws IOException {
List<String> services = new ArrayList(_dir.keySet());
out.write("<h2>Port Mapper</h2><table><tr><th>Service<th>Port\n");
Collections.sort(services);
for (String s : services) {
out.write("<tr><td>" + s + "<td>" + _dir.get(s) + '\n');
}
out.write("</table>\n");
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment