forked from I2P_Developers/i2p.i2p
Fixes for a bunch of old unused code to make it compile
This commit is contained in:
@ -11,9 +11,10 @@ import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.data.DataHelper
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.router.Router;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.router.web.StatsGenerator;
|
||||
import net.i2p.util.I2PThread;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
@ -49,7 +50,7 @@ class AdminRunner implements Runnable {
|
||||
} else if ( (command.indexOf("routerStats.html") >= 0) || (command.indexOf("oldstats.jsp") >= 0) ) {
|
||||
try {
|
||||
out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n"));
|
||||
_generator.generateStatsPage(new OutputStreamWriter(out));
|
||||
_generator.generateStatsPage(new OutputStreamWriter(out), true);
|
||||
out.close();
|
||||
} catch (IOException ioe) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
@ -63,7 +64,8 @@ class AdminRunner implements Runnable {
|
||||
} else if (true || command.indexOf("routerConsole.html") > 0) {
|
||||
try {
|
||||
out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n"));
|
||||
_context.router().renderStatusHTML(new OutputStreamWriter(out));
|
||||
// TODO Not technically the same as router().renderStatusHTML() was
|
||||
_context.routerAppManager().renderStatusHTML(new OutputStreamWriter(out));
|
||||
out.close();
|
||||
} catch (IOException ioe) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
|
@ -5,6 +5,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class TestCreateSessionDatagram {
|
||||
|
@ -5,6 +5,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.Clock;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
|
@ -37,11 +37,8 @@ public class TestDatagramTransfer {
|
||||
line = reader.readLine();
|
||||
_log.info("Response from the lookup for ME: " + line);
|
||||
_log.debug("The above should be a NAMING REPLY");
|
||||
|
||||
StringTokenizer tok = new StringTokenizer(line);
|
||||
String maj = tok.nextToken();
|
||||
String min = tok.nextToken();
|
||||
Properties props = SAMUtils.parseParams(tok);
|
||||
|
||||
Properties props = SAMUtils.parseParams(line);
|
||||
String value = props.getProperty("VALUE");
|
||||
if (value == null) {
|
||||
_log.error("No value for ME found! [" + line + "]");
|
||||
@ -53,10 +50,7 @@ public class TestDatagramTransfer {
|
||||
String send = "DATAGRAM SEND DESTINATION=" + value + " SIZE=3\nYo!";
|
||||
out.write(DataHelper.getASCII(send));
|
||||
line = reader.readLine();
|
||||
tok = new StringTokenizer(line);
|
||||
maj = tok.nextToken();
|
||||
min = tok.nextToken();
|
||||
props = SAMUtils.parseParams(tok);
|
||||
props = SAMUtils.parseParams(line);
|
||||
String size = props.getProperty("SIZE");
|
||||
String from = props.getProperty("DESTINATION");
|
||||
if ( (value == null) || (size == null) ||
|
||||
|
@ -5,6 +5,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class TestDest {
|
||||
|
@ -5,6 +5,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class TestNaming {
|
||||
|
@ -7,6 +7,7 @@ import java.net.Socket;
|
||||
import java.util.Properties;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
public class TestRawTransfer {
|
||||
@ -36,11 +37,8 @@ public class TestRawTransfer {
|
||||
line = reader.readLine();
|
||||
_log.info("Response from the lookup for ME: " + line);
|
||||
_log.debug("The above should be a NAMING REPLY");
|
||||
|
||||
StringTokenizer tok = new StringTokenizer(line);
|
||||
String maj = tok.nextToken();
|
||||
String min = tok.nextToken();
|
||||
Properties props = SAMUtils.parseParams(tok);
|
||||
|
||||
Properties props = SAMUtils.parseParams(line);
|
||||
String value = props.getProperty("VALUE");
|
||||
if (value == null) {
|
||||
_log.error("No value for ME found! [" + line + "]");
|
||||
@ -53,10 +51,7 @@ public class TestRawTransfer {
|
||||
out.write(DataHelper.getASCII(send));
|
||||
line = reader.readLine();
|
||||
try {
|
||||
tok = new StringTokenizer(line);
|
||||
maj = tok.nextToken();
|
||||
min = tok.nextToken();
|
||||
props = SAMUtils.parseParams(tok);
|
||||
props = SAMUtils.parseParams(line);
|
||||
} catch (Exception e) {
|
||||
_log.error("Error parsing response line: [" + line + "]", e);
|
||||
return;
|
||||
|
@ -75,10 +75,7 @@ public class TestStreamTransfer {
|
||||
req = "NAMING LOOKUP NAME=ME\n";
|
||||
out.write(DataHelper.getASCII(req));
|
||||
line = reader.readLine();
|
||||
StringTokenizer tok = new StringTokenizer(line);
|
||||
String maj = tok.nextToken();
|
||||
String min = tok.nextToken();
|
||||
Properties props = SAMUtils.parseParams(tok);
|
||||
Properties props = SAMUtils.parseParams(line);
|
||||
String value = props.getProperty("VALUE");
|
||||
if (value == null) {
|
||||
_log.error("No value for ME found! [" + line + "]");
|
||||
@ -124,10 +121,9 @@ public class TestStreamTransfer {
|
||||
private void doRun() throws IOException, SAMException {
|
||||
String line = _reader.readLine();
|
||||
_log.debug("Read: " + line);
|
||||
StringTokenizer tok = new StringTokenizer(line);
|
||||
String maj = tok.nextToken();
|
||||
String min = tok.nextToken();
|
||||
Properties props = SAMUtils.parseParams(tok);
|
||||
Properties props = SAMUtils.parseParams(line);
|
||||
String maj = props.getProperty(SAMUtils.COMMAND);
|
||||
String min = props.getProperty(SAMUtils.OPCODE);
|
||||
if ( ("STREAM".equals(maj)) && ("CONNECTED".equals(min)) ) {
|
||||
String dest = props.getProperty("DESTINATION");
|
||||
String id = props.getProperty("ID");
|
||||
@ -225,10 +221,7 @@ public class TestStreamTransfer {
|
||||
out.write(DataHelper.getASCII(req));
|
||||
line = reader.readLine();
|
||||
_log.info("Response to the stream connect from "+sessionName+" to Alice: " + line);
|
||||
StringTokenizer tok = new StringTokenizer(line);
|
||||
String maj = tok.nextToken();
|
||||
String min = tok.nextToken();
|
||||
Properties props = SAMUtils.parseParams(tok);
|
||||
Properties props = SAMUtils.parseParams(line);
|
||||
_log.info("props = " + props);
|
||||
String result = props.getProperty("RESULT");
|
||||
if (!("OK".equals(result))) {
|
||||
|
@ -143,15 +143,15 @@ public class TestSwarm {
|
||||
_samOut.write(DataHelper.getASCII("HELLO VERSION MIN=1.0 MAX=1.0\n"));
|
||||
_samOut.flush();
|
||||
_log.debug("Hello sent");
|
||||
boolean ok = _eventHandler.waitForHelloReply();
|
||||
_log.debug("Hello reply found: " + ok);
|
||||
if (!ok)
|
||||
String serverVersion = _eventHandler.waitForHelloReply();
|
||||
_log.debug("Hello reply found: " + serverVersion);
|
||||
if (serverVersion == null)
|
||||
throw new IOException("wtf, hello failed?");
|
||||
String req = "SESSION CREATE STYLE=STREAM DESTINATION=" + _destFile + " " + _conOptions + "\n";
|
||||
_samOut.write(DataHelper.getUTF8(req));
|
||||
_samOut.flush();
|
||||
_log.debug("Session create sent");
|
||||
ok = _eventHandler.waitForSessionCreateReply();
|
||||
boolean ok = _eventHandler.waitForSessionCreateReply();
|
||||
_log.debug("Session create reply found: " + ok);
|
||||
|
||||
req = "NAMING LOOKUP NAME=ME\n";
|
||||
|
Reference in New Issue
Block a user