2006-01-25 jrandom
* Run the peer profile coalescing/reorganization outside the job queue (on one of the timers), to cut down on some job queue congestion. Also, trim old profiles while running, not just when starting up. * Slightly more sane intra-floodfill-node netDb activity (only flood new entries) * Workaround in the I2PTunnelHTTPServer for some bad requests (though the source of the bug is not yet addressed) * Better I2PSnark reconnection handling * Further cleanup in the new tunnel build process * Make sure we expire old participants properly * Remove much of the transient overload throttling (it wasn't using a good metric)
This commit is contained in:
@ -113,10 +113,10 @@ public class ConnectionAcceptor implements Runnable
|
|||||||
// ok, already updated
|
// ok, already updated
|
||||||
socketChanged = false;
|
socketChanged = false;
|
||||||
}
|
}
|
||||||
if (serverSocket == null) {
|
while ( (serverSocket == null) && (!stop)) {
|
||||||
Snark.debug("Server socket went away.. boo hiss", Snark.ERROR);
|
serverSocket = I2PSnarkUtil.instance().getServerSocket();
|
||||||
stop = true;
|
if (serverSocket == null)
|
||||||
return;
|
try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -128,9 +128,7 @@ public class ConnectionAcceptor implements Runnable
|
|||||||
I2PServerSocket ss = I2PSnarkUtil.instance().getServerSocket();
|
I2PServerSocket ss = I2PSnarkUtil.instance().getServerSocket();
|
||||||
if (ss != serverSocket) {
|
if (ss != serverSocket) {
|
||||||
serverSocket = ss;
|
serverSocket = ss;
|
||||||
} else {
|
socketChanged = true;
|
||||||
Snark.debug("Null socket accepted, but socket wasn't changed?", Snark.ERROR);
|
|
||||||
try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -154,7 +152,8 @@ public class ConnectionAcceptor implements Runnable
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
serverSocket.close();
|
if (serverSocket != null)
|
||||||
|
serverSocket.close();
|
||||||
}
|
}
|
||||||
catch (I2PException ignored) { }
|
catch (I2PException ignored) { }
|
||||||
|
|
||||||
|
@ -152,7 +152,11 @@ public class I2PSnarkUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public I2PServerSocket getServerSocket() {
|
public I2PServerSocket getServerSocket() {
|
||||||
return _manager.getServerSocket();
|
I2PSocketManager mgr = _manager;
|
||||||
|
if (mgr != null)
|
||||||
|
return mgr.getServerSocket();
|
||||||
|
else
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String getOurIPString() {
|
String getOurIPString() {
|
||||||
|
@ -38,18 +38,21 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
|||||||
super(host, port, privData, l, notifyThis, tunnel);
|
super(host, port, privData, l, notifyThis, tunnel);
|
||||||
_spoofHost = spoofHost;
|
_spoofHost = spoofHost;
|
||||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
||||||
|
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpNullWorkaround", "How often an http server works around a streaming lib or i2ptunnel bug", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
public I2PTunnelHTTPServer(InetAddress host, int port, File privkey, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
public I2PTunnelHTTPServer(InetAddress host, int port, File privkey, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||||
super(host, port, privkey, privkeyname, l, notifyThis, tunnel);
|
super(host, port, privkey, privkeyname, l, notifyThis, tunnel);
|
||||||
_spoofHost = spoofHost;
|
_spoofHost = spoofHost;
|
||||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
||||||
|
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpNullWorkaround", "How often an http server works around a streaming lib or i2ptunnel bug", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
public I2PTunnelHTTPServer(InetAddress host, int port, InputStream privData, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
public I2PTunnelHTTPServer(InetAddress host, int port, InputStream privData, String privkeyname, String spoofHost, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) {
|
||||||
super(host, port, privData, privkeyname, l, notifyThis, tunnel);
|
super(host, port, privData, privkeyname, l, notifyThis, tunnel);
|
||||||
_spoofHost = spoofHost;
|
_spoofHost = spoofHost;
|
||||||
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpserver.blockingHandleTime", "how long the blocking handle takes to complete", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000, 3*60*60*1000 });
|
||||||
|
getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpNullWorkaround", "How often an http server works around a streaming lib or i2ptunnel bug", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000 });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -291,6 +294,19 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
|||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug("Read the http command [" + command.toString() + "]");
|
_log.debug("Read the http command [" + command.toString() + "]");
|
||||||
|
|
||||||
|
int trimmed = 0;
|
||||||
|
if (command.length() > 0) {
|
||||||
|
for (int i = 0; i < command.length(); i++) {
|
||||||
|
if (command.charAt(i) == 0) {
|
||||||
|
command = command.deleteCharAt(i);
|
||||||
|
i--;
|
||||||
|
trimmed++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (trimmed > 0)
|
||||||
|
getTunnel().getContext().statManager().addRateData("i2ptunnel.httpNullWorkaround", trimmed, 0);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
buf.setLength(0);
|
buf.setLength(0);
|
||||||
ok = DataHelper.readLine(in, buf);
|
ok = DataHelper.readLine(in, buf);
|
||||||
|
@ -115,7 +115,9 @@ public class User {
|
|||||||
for (Iterator iter = _petnames.getNames().iterator(); iter.hasNext(); ) {
|
for (Iterator iter = _petnames.getNames().iterator(); iter.hasNext(); ) {
|
||||||
String name = (String)iter.next();
|
String name = (String)iter.next();
|
||||||
PetName pn = _petnames.getByName(name);
|
PetName pn = _petnames.getByName(name);
|
||||||
if (AddressesServlet.PROTO_TAG.equals(pn.getProtocol()))
|
if (pn == null) continue;
|
||||||
|
String proto = pn.getProtocol();
|
||||||
|
if ( (proto != null) && (AddressesServlet.PROTO_TAG.equals(proto)) )
|
||||||
rv.add(pn.getLocation());
|
rv.add(pn.getLocation());
|
||||||
}
|
}
|
||||||
if (rv.size() <= 0) {
|
if (rv.size() <= 0) {
|
||||||
|
@ -176,8 +176,8 @@ public class Rate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void coalesce() {
|
public void coalesce() {
|
||||||
|
long now = now();
|
||||||
synchronized (_lock) {
|
synchronized (_lock) {
|
||||||
long now = now();
|
|
||||||
long measuredPeriod = now - _lastCoalesceDate;
|
long measuredPeriod = now - _lastCoalesceDate;
|
||||||
if (measuredPeriod < _period) {
|
if (measuredPeriod < _period) {
|
||||||
// no need to coalesce
|
// no need to coalesce
|
||||||
|
16
history.txt
16
history.txt
@ -1,4 +1,18 @@
|
|||||||
$Id: history.txt,v 1.394 2006/01/22 19:51:57 jrandom Exp $
|
$Id: history.txt,v 1.395 2006/01/25 10:34:28 dust Exp $
|
||||||
|
|
||||||
|
2006-01-25 jrandom
|
||||||
|
* Run the peer profile coalescing/reorganization outside the job queue
|
||||||
|
(on one of the timers), to cut down on some job queue congestion. Also,
|
||||||
|
trim old profiles while running, not just when starting up.
|
||||||
|
* Slightly more sane intra-floodfill-node netDb activity (only flood new
|
||||||
|
entries)
|
||||||
|
* Workaround in the I2PTunnelHTTPServer for some bad requests (though the
|
||||||
|
source of the bug is not yet addressed)
|
||||||
|
* Better I2PSnark reconnection handling
|
||||||
|
* Further cleanup in the new tunnel build process
|
||||||
|
* Make sure we expire old participants properly
|
||||||
|
* Remove much of the transient overload throttling (it wasn't using a good
|
||||||
|
metric)
|
||||||
|
|
||||||
2006-01-25 dust
|
2006-01-25 dust
|
||||||
* Fix IRC client proxy to use ISO-8859-1.
|
* Fix IRC client proxy to use ISO-8859-1.
|
||||||
|
Reference in New Issue
Block a user