forked from I2P_Developers/i2p.i2p
i2ptunnel: I2Ping CLI tunnel quantity 1
Show current setting for owndest in CLI Skip a irrelevant log message for I2Ping Break wait on interrupt Log level tweaks
This commit is contained in:
@ -307,6 +307,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
|
||||
try {
|
||||
wait();
|
||||
} catch (InterruptedException ie) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1400,7 +1401,8 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
|
||||
notifyEvent("owndestResult", "ok");
|
||||
} else {
|
||||
l.log("owndest yes|no\n" +
|
||||
" Specifies whether to use its own destination \n" + " for each outgoing tunnel");
|
||||
" Specifies whether to use its own destination \n" + " for each outgoing tunnel\n" +
|
||||
"Current setting: " + (ownDest ? "yes" : "no (shared client)"));
|
||||
notifyEvent("owndestResult", "error");
|
||||
}
|
||||
}
|
||||
@ -1692,6 +1694,10 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
|
||||
_clientOptions.setProperty("inbound.nickname", "I2Ping");
|
||||
if (!_clientOptions.containsKey("outbound.nickname"))
|
||||
_clientOptions.setProperty("outbound.nickname", "I2Ping");
|
||||
if (!_clientOptions.containsKey("inbound.quantity"))
|
||||
_clientOptions.setProperty("inbound.quantity", "1");
|
||||
if (!_clientOptions.containsKey("outbound.quantity"))
|
||||
_clientOptions.setProperty("outbound.quantity", "1");
|
||||
}
|
||||
I2PTunnelClientBase task = new I2Ping(l, ownDest, this, this);
|
||||
task.startRunning();
|
||||
|
@ -564,11 +564,13 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
}
|
||||
|
||||
if (open && listenerReady) {
|
||||
if (localPort > 0) { // -1 for I2Ping
|
||||
boolean openNow = !Boolean.parseBoolean(getTunnel().getClientOptions().getProperty("i2cp.delayOpen"));
|
||||
if (openNow || chained)
|
||||
l.log("Client ready, listening on " + getTunnel().listenHost + ':' + localPort);
|
||||
else
|
||||
l.log("Client ready, listening on " + getTunnel().listenHost + ':' + localPort + ", delaying tunnel open until required");
|
||||
}
|
||||
notifyEvent("openBaseClientResult", "ok");
|
||||
} else {
|
||||
l.log("Client error for " + getTunnel().listenHost + ':' + localPort + ", check logs");
|
||||
|
@ -550,8 +550,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
String val = opts.getProperty(TunnelController.PROP_TUN_GZIP);
|
||||
if ( (val != null) && (!Boolean.parseBoolean(val)) )
|
||||
allowGZIP = false;
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("HTTP server encoding header: " + enc + "/" + altEnc);
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("HTTP server encoding header: " + enc + "/" + altEnc);
|
||||
boolean alt = (altEnc != null) && (altEnc.indexOf("x-i2p-gzip") >= 0);
|
||||
boolean useGZIP = alt || ( (enc != null) && (enc.indexOf("x-i2p-gzip") >= 0) );
|
||||
// Don't pass this on, outproxies should strip so I2P traffic isn't so obvious but they probably don't
|
||||
@ -646,8 +646,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Compressed requestor running");
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("Compressed requestor running");
|
||||
OutputStream serverout = null;
|
||||
OutputStream browserout = null;
|
||||
InputStream browserin = null;
|
||||
@ -701,11 +701,11 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
compressedOut.write(DataHelper.getUTF8(modifiedHeaders));
|
||||
|
||||
s = new Sender(compressedOut, serverin, "server: server to browser", _log);
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Before pumping the compressed response");
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("Before pumping the compressed response");
|
||||
s.run(); // same thread
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("After pumping the compressed response: " + compressedOut.getTotalRead() + "/" + compressedOut.getTotalCompressed());
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("After pumping the compressed response: " + compressedOut.getTotalRead() + "/" + compressedOut.getTotalCompressed());
|
||||
} catch (SSLException she) {
|
||||
_log.error("SSL error", she);
|
||||
try {
|
||||
@ -780,12 +780,12 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info(_name + ": Begin sending");
|
||||
if (_log.shouldDebug())
|
||||
_log.debug(_name + ": Begin sending");
|
||||
try {
|
||||
DataHelper.copy(_in, _out);
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info(_name + ": Done sending");
|
||||
if (_log.shouldDebug())
|
||||
_log.debug(_name + ": Done sending");
|
||||
//_out.flush();
|
||||
} catch (IOException ioe) {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
|
Reference in New Issue
Block a user