Changeset f564d4d


Ignore:
Timestamp:
Jun 5, 2016 12:57:32 PM (4 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
78d0a54
Parents:
34c611d
Message:

Fixes for a bunch of old unused code to make it compile

Location:
apps
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • apps/admin/java/src/net/i2p/router/admin/AdminRunner.java

    r34c611d rf564d4d  
    1212
    1313import net.i2p.data.Hash;
    14 import net.i2p.data.DataHelper
     14import net.i2p.data.DataHelper;
    1515import net.i2p.router.Router;
    1616import net.i2p.router.RouterContext;
     17import net.i2p.router.web.StatsGenerator;
    1718import net.i2p.util.I2PThread;
    1819import net.i2p.util.Log;
     
    5051            try {
    5152                out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n"));
    52                 _generator.generateStatsPage(new OutputStreamWriter(out));
     53                _generator.generateStatsPage(new OutputStreamWriter(out), true);
    5354                out.close();
    5455            } catch (IOException ioe) {
     
    6465            try {
    6566                out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n"));
    66                 _context.router().renderStatusHTML(new OutputStreamWriter(out));
     67                // TODO Not technically the same as router().renderStatusHTML() was
     68                _context.routerAppManager().renderStatusHTML(new OutputStreamWriter(out));
    6769                out.close();
    6870            } catch (IOException ioe) {
  • apps/sam/java/test/net/i2p/sam/TestCreateSessionDatagram.java

    r34c611d rf564d4d  
    66import java.net.Socket;
    77
     8import net.i2p.data.DataHelper;
    89import net.i2p.util.Log;
    910
  • apps/sam/java/test/net/i2p/sam/TestCreateSessionRaw.java

    r34c611d rf564d4d  
    66import java.net.Socket;
    77
     8import net.i2p.data.DataHelper;
    89import net.i2p.util.Clock;
    910import net.i2p.util.Log;
  • apps/sam/java/test/net/i2p/sam/TestDatagramTransfer.java

    r34c611d rf564d4d  
    3838            _log.info("Response from the lookup for ME: " + line);
    3939            _log.debug("The above should be a NAMING REPLY");
    40            
    41             StringTokenizer tok = new StringTokenizer(line);
    42             String maj = tok.nextToken();
    43             String min = tok.nextToken();
    44             Properties props = SAMUtils.parseParams(tok);
     40
     41            Properties props = SAMUtils.parseParams(line);
    4542            String value = props.getProperty("VALUE");
    4643            if (value == null) {
     
    5451            out.write(DataHelper.getASCII(send));
    5552            line = reader.readLine();
    56             tok = new StringTokenizer(line);
    57             maj = tok.nextToken();
    58             min = tok.nextToken();
    59             props = SAMUtils.parseParams(tok);
     53            props = SAMUtils.parseParams(line);
    6054            String size = props.getProperty("SIZE");
    6155            String from = props.getProperty("DESTINATION");
  • apps/sam/java/test/net/i2p/sam/TestDest.java

    r34c611d rf564d4d  
    66import java.net.Socket;
    77
     8import net.i2p.data.DataHelper;
    89import net.i2p.util.Log;
    910
  • apps/sam/java/test/net/i2p/sam/TestNaming.java

    r34c611d rf564d4d  
    66import java.net.Socket;
    77
     8import net.i2p.data.DataHelper;
    89import net.i2p.util.Log;
    910
  • apps/sam/java/test/net/i2p/sam/TestRawTransfer.java

    r34c611d rf564d4d  
    88import java.util.StringTokenizer;
    99
     10import net.i2p.data.DataHelper;
    1011import net.i2p.util.Log;
    1112
     
    3738            _log.info("Response from the lookup for ME: " + line);
    3839            _log.debug("The above should be a NAMING REPLY");
    39            
    40             StringTokenizer tok = new StringTokenizer(line);
    41             String maj = tok.nextToken();
    42             String min = tok.nextToken();
    43             Properties props = SAMUtils.parseParams(tok);
     40
     41            Properties props = SAMUtils.parseParams(line);
    4442            String value = props.getProperty("VALUE");
    4543            if (value == null) {
     
    5452            line = reader.readLine();
    5553            try {
    56                 tok = new StringTokenizer(line);
    57                 maj = tok.nextToken();
    58                 min = tok.nextToken();
    59                 props = SAMUtils.parseParams(tok);
     54                props = SAMUtils.parseParams(line);
    6055            } catch (Exception e) {
    6156                _log.error("Error parsing response line: [" + line + "]", e);
  • apps/sam/java/test/net/i2p/sam/TestStreamTransfer.java

    r34c611d rf564d4d  
    7676            out.write(DataHelper.getASCII(req));
    7777            line = reader.readLine();
    78             StringTokenizer tok = new StringTokenizer(line);
    79             String maj = tok.nextToken();
    80             String min = tok.nextToken();
    81             Properties props = SAMUtils.parseParams(tok);
     78            Properties props = SAMUtils.parseParams(line);
    8279            String value = props.getProperty("VALUE");
    8380            if (value == null) {
     
    125122            String line = _reader.readLine();
    126123            _log.debug("Read: " + line);
    127             StringTokenizer tok = new StringTokenizer(line);
    128             String maj = tok.nextToken();
    129             String min = tok.nextToken();
    130             Properties props = SAMUtils.parseParams(tok);
     124            Properties props = SAMUtils.parseParams(line);
     125            String maj = props.getProperty(SAMUtils.COMMAND);
     126            String min = props.getProperty(SAMUtils.OPCODE);
    131127            if ( ("STREAM".equals(maj)) && ("CONNECTED".equals(min)) ) {
    132128                String dest = props.getProperty("DESTINATION");
     
    226222            line = reader.readLine();
    227223            _log.info("Response to the stream connect from "+sessionName+" to Alice: " + line);
    228             StringTokenizer tok = new StringTokenizer(line);
    229             String maj = tok.nextToken();
    230             String min = tok.nextToken();
    231             Properties props = SAMUtils.parseParams(tok);
     224            Properties props = SAMUtils.parseParams(line);
    232225            _log.info("props = " + props);
    233226            String result = props.getProperty("RESULT");
  • apps/sam/java/test/net/i2p/sam/TestSwarm.java

    r34c611d rf564d4d  
    144144                _samOut.flush();
    145145                _log.debug("Hello sent");
    146                 boolean ok = _eventHandler.waitForHelloReply();
    147                 _log.debug("Hello reply found: " + ok);
    148                 if (!ok)
     146                String serverVersion = _eventHandler.waitForHelloReply();
     147                _log.debug("Hello reply found: " + serverVersion);
     148                if (serverVersion == null)
    149149                    throw new IOException("wtf, hello failed?");
    150150                String req = "SESSION CREATE STYLE=STREAM DESTINATION=" + _destFile + " " + _conOptions + "\n";
     
    152152                _samOut.flush();
    153153                _log.debug("Session create sent");
    154                 ok = _eventHandler.waitForSessionCreateReply();
     154                boolean ok = _eventHandler.waitForSessionCreateReply();
    155155                _log.debug("Session create reply found: " + ok);
    156156
Note: See TracChangeset for help on using the changeset viewer.