* i2ptunnel:

- IRCClient: Use tunnel log instance
      - Server: Full queue log tweak
This commit is contained in:
zzz
2011-02-05 23:21:56 +00:00
parent b08efb6700
commit c38d72d178
5 changed files with 45 additions and 14 deletions

View File

@ -89,9 +89,9 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
i2ps = createI2PSocket(clientDest);
i2ps.setReadTimeout(readTimeout);
StringBuffer expectedPong = new StringBuffer();
Thread in = new I2PAppThread(new IrcInboundFilter(s,i2ps, expectedPong), "IRC Client " + __clientId + " in", true);
Thread in = new I2PAppThread(new IrcInboundFilter(s,i2ps, expectedPong, _log), "IRC Client " + __clientId + " in", true);
in.start();
Thread out = new I2PAppThread(new IrcOutboundFilter(s,i2ps, expectedPong), "IRC Client " + __clientId + " out", true);
Thread out = new I2PAppThread(new IrcOutboundFilter(s,i2ps, expectedPong, _log), "IRC Client " + __clientId + " out", true);
out.start();
} catch (Exception ex) {
if (_log.shouldLog(Log.ERROR))
@ -128,13 +128,13 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
private Socket local;
private I2PSocket remote;
private StringBuffer expectedPong;
// shadows _log in super()
private final Log _log = new Log(I2PTunnelIRCClient.class);
private final Log _log;
public IrcInboundFilter(Socket _local, I2PSocket _remote, StringBuffer pong) {
public IrcInboundFilter(Socket _local, I2PSocket _remote, StringBuffer pong, Log log) {
local=_local;
remote=_remote;
expectedPong=pong;
_log = log;
}
public void run() {
@ -207,13 +207,13 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
private Socket local;
private I2PSocket remote;
private StringBuffer expectedPong;
// shadows _log in super()
private final Log _log = new Log(I2PTunnelIRCClient.class);
private final Log _log;
public IrcOutboundFilter(Socket _local, I2PSocket _remote, StringBuffer pong) {
public IrcOutboundFilter(Socket _local, I2PSocket _remote, StringBuffer pong, Log log) {
local=_local;
remote=_remote;
expectedPong=pong;
_log = log;
}
public void run() {

View File

@ -302,9 +302,10 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
try {
i2ps.close();
} catch (IOException ioe) {}
if (open && _log.shouldLog(Log.ERROR))
_log.error("ServerHandler queue full for " + remoteHost + ':' + remotePort +
"; increase " + PROP_HANDLER_COUNT + '?', ree);
if (open)
_log.logAlways(Log.WARN, "ServerHandler queue full, dropping incoming connection to " +
remoteHost + ':' + remotePort +
"; increase server max threads or " + PROP_HANDLER_COUNT);
}
} else {
// use only for standard servers that can't get slowlorissed! Not for http or irc

View File

@ -50,9 +50,11 @@ public class I2PSOCKSIRCTunnel extends I2PSOCKSTunnel {
Socket clientSock = serv.getClientSocket();
I2PSocket destSock = serv.getDestinationI2PSocket(this);
StringBuffer expectedPong = new StringBuffer();
Thread in = new I2PAppThread(new I2PTunnelIRCClient.IrcInboundFilter(clientSock, destSock, expectedPong), "SOCKS IRC Client " + (++__clientId) + " in", true);
Thread in = new I2PAppThread(new I2PTunnelIRCClient.IrcInboundFilter(clientSock, destSock, expectedPong, _log),
"SOCKS IRC Client " + (++__clientId) + " in", true);
in.start();
Thread out = new I2PAppThread(new I2PTunnelIRCClient.IrcOutboundFilter(clientSock, destSock, expectedPong), "SOCKS IRC Client " + __clientId + " out", true);
Thread out = new I2PAppThread(new I2PTunnelIRCClient.IrcOutboundFilter(clientSock, destSock, expectedPong, _log),
"SOCKS IRC Client " + __clientId + " out", true);
out.start();
} catch (SOCKSException e) {
_log.error("Error from SOCKS connection", e);