forked from I2P_Developers/i2p.i2p
2006-02-17 jrandom
* Disable the message history log file by default (duh - feel free to delete messageHistory.txt after upgrading. thanks deathfatty!) * Limit the size of the inbound tunnel build request queue so we don't get an insane backlog of requests that we're bound to reject, and adjust the queue processing so we keep on churning through them when we've got a backlog. * Small fixes for the multiuser syndie operation (thanks Complication!) * Renamed modified PRNG classes that were imported from gnu-crypto so we don't conflict with JVMs using that as a JCE provider (thanks blx!)
This commit is contained in:
@@ -39,7 +39,7 @@ public class MessageHistory {
|
||||
|
||||
/** config property determining whether we want to debug with the message history */
|
||||
public final static String PROP_KEEP_MESSAGE_HISTORY = "router.keepHistory";
|
||||
public final static boolean DEFAULT_KEEP_MESSAGE_HISTORY = true;
|
||||
public final static boolean DEFAULT_KEEP_MESSAGE_HISTORY = false;
|
||||
/** config property determining where we want to log the message history, if we're keeping one */
|
||||
public final static String PROP_MESSAGE_HISTORY_FILENAME = "router.historyFilename";
|
||||
public final static String DEFAULT_MESSAGE_HISTORY_FILENAME = "messageHistory.txt";
|
||||
|
@@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
||||
*
|
||||
*/
|
||||
public class RouterVersion {
|
||||
public final static String ID = "$Revision: 1.344 $ $Date: 2006/02/16 05:33:29 $";
|
||||
public final static String ID = "$Revision: 1.345 $ $Date: 2006/02/16 15:44:12 $";
|
||||
public final static String VERSION = "0.6.1.10";
|
||||
public final static long BUILD = 0;
|
||||
public final static long BUILD = 1;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
||||
System.out.println("Router ID: " + RouterVersion.ID);
|
||||
|
@@ -199,7 +199,9 @@ class BuildExecutor implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
_handler.handleInboundRequests();
|
||||
boolean pendingRemaining = _handler.handleInboundRequests();
|
||||
if (pendingRemaining)
|
||||
_repoll = true;
|
||||
|
||||
wanted.clear();
|
||||
pools.clear();
|
||||
|
@@ -57,9 +57,17 @@ class BuildHandler {
|
||||
}
|
||||
|
||||
private static final int MAX_HANDLE_AT_ONCE = 5;
|
||||
/**
|
||||
* Don't keep too many messages on the queue - when it reaches this size, delete the oldest request
|
||||
*/
|
||||
private static final int MAX_QUEUED_REQUESTS = MAX_HANDLE_AT_ONCE * (BuildRequestor.REQUEST_TIMEOUT/1000);
|
||||
private static final int NEXT_HOP_LOOKUP_TIMEOUT = 5*1000;
|
||||
|
||||
void handleInboundRequests() {
|
||||
/**
|
||||
* Blocking call to handle a few of the pending inbound requests, returning true if
|
||||
* there are remaining requeusts we skipped over
|
||||
*/
|
||||
boolean handleInboundRequests() {
|
||||
List handled = null;
|
||||
synchronized (_inboundBuildMessages) {
|
||||
int toHandle = _inboundBuildMessages.size();
|
||||
@@ -101,6 +109,11 @@ class BuildHandler {
|
||||
handleRequestAsInboundEndpoint(state);
|
||||
}
|
||||
}
|
||||
|
||||
// anything else?
|
||||
synchronized (_inboundBuildMessages) {
|
||||
return _inboundBuildMessages.size() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
void handleInboundReplies() {
|
||||
@@ -503,6 +516,8 @@ class BuildHandler {
|
||||
_log.warn("Dropping the reply " + reqId + ", as we used to be building that");
|
||||
} else {
|
||||
synchronized (_inboundBuildMessages) {
|
||||
while (_inboundBuildMessages.size() > MAX_QUEUED_REQUESTS)
|
||||
_inboundBuildMessages.remove(0); // keep the newest requests first, to offer better service
|
||||
_inboundBuildMessages.add(new BuildMessageState(receivedMessage, from, fromHash));
|
||||
}
|
||||
_exec.repoll();
|
||||
|
Reference in New Issue
Block a user