Update of /cvsroot/freenet/freenet/src/freenet/node/states/FNP
In directory sc8-pr-cvs1:/tmp/cvs-serv3827/src/freenet/node/states/FNP
Modified Files:
NewRequest.java
Log Message:
6189:
Don't open new connections just to send QueryRejected messages (at least not on
initial receipt of *Request), it's not worth it, there's only a 1 hop timeout on the
other end. Thanks to sanity and lostlogic for the so-obvious-it's-invisible solution.
Implement support in logger for selective logging.
Reduce multiplier for bandwidth limits to 1.2.
Add commented-out code for Linux-specific load estimation based on /proc/stat.
Logging
Index: NewRequest.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/FNP/NewRequest.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- NewRequest.java 15 Aug 2003 00:12:06 -0000 1.29
+++ NewRequest.java 10 Sep 2003 21:19:52 -0000 1.30
@@ -60,8 +60,14 @@
Logger.MINOR);
Message m = new QueryRejected(id, mo.hopsToLive,
reason, mo.otherFields);
- ConnectionHandler ch = n.makeConnection(origRec, 0);
- ch.sendMessageAsync(m); // don't care what happens
+ ConnectionHandler ch = n.getConnection(origRec);
+ if(ch != null) {
+ ch.sendMessageAsync(m); // don't care what happens
+ } else {
+ if(n.logger.shouldLog(Logger.DEBUG, this))
+ n.logger.log(this, "Dropped QueryRejected: no free connection,
not opening a new one for "+this, Logger.DEBUG);
+ // It's only a 1 hop timeout. It's not worth opening a connection
for
+ }
n.loadStats.receivedQuery(false);
throw new RequestAbortException(null);
}
@@ -103,8 +109,14 @@
Message m = new QueryRejected(id, htl, 1, reason,
// ^--- attenuate routing.
mo.otherFields);
- ConnectionHandler ch = n.makeConnection(origRec, 0);
- ch.sendMessageAsync(m); // don't care what happens
+ ConnectionHandler ch = n.getConnection(origRec);
+ if(ch != null) {
+ ch.sendMessageAsync(m); // don't care what happens
+ } else {
+ if(n.logger.shouldLog(Logger.DEBUG, this))
+ n.logger.log(this, "Dropped QueryRejected: no free connection,
not opening a new one for "+this, Logger.DEBUG);
+ // It's only a 1 hop timeout. It's not worth opening a connection
for
+ }
n.loadStats.receivedQuery(false);
Core.diagnostics.occurrenceBinomial("inboundAggregateRequests",1, 0);
throw new RequestAbortException(null);
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs