Author: toad
Date: 2008-01-25 17:50:11 +0000 (Fri, 25 Jan 2008)
New Revision: 17288
Modified:
trunk/freenet/src/freenet/io/comm/MessageFilter.java
Log:
Split timedOut() - reallyTimedOut() is called by matched(), should ignore the
already-matched status.
Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/MessageFilter.java 2008-01-25
17:41:48 UTC (rev 17287)
+++ trunk/freenet/src/freenet/io/comm/MessageFilter.java 2008-01-25
17:50:11 UTC (rev 17288)
@@ -183,7 +183,7 @@
}
}
}
- if(timedOut(System.currentTimeMillis())) return false;
+ if(reallyTimedOut(System.currentTimeMillis())) return false;
_matched=true;
return true;
}
@@ -199,6 +199,12 @@
return _droppedConnection;
}
+ private boolean reallyTimedOut(long time) {
+ if(_callback != null && _callback.shouldTimeout())
+ _timeout = -1; // timeout immediately
+ return _timeout < time;
+ }
+
/**
* @param time The current time in milliseconds.
* @return True if the filter has timed out, or if it has been matched
already. Caller will
@@ -209,9 +215,7 @@
Logger.error(this, "Impossible: filter already matched
in timedOut(): "+this, new Exception("error"));
return true; // Remove it.
}
- if(_callback != null && _callback.shouldTimeout())
- _timeout = -1; // timeout immediately
- return _timeout < time;
+ return reallyTimedOut(time);
}
public Message getMessage() {