Author: toad
Date: 2008-01-25 17:11:58 +0000 (Fri, 25 Jan 2008)
New Revision: 17278
Modified:
trunk/freenet/src/freenet/io/comm/MessageFilter.java
Log:
Async callbacks may not be reused!
Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/MessageFilter.java 2008-01-25
16:37:50 UTC (rev 17277)
+++ trunk/freenet/src/freenet/io/comm/MessageFilter.java 2008-01-25
17:11:58 UTC (rev 17278)
@@ -200,7 +200,10 @@
}
public boolean timedOut(long time) {
- if(_matched) return false;
+ if(_matched) {
+
+ return false;
+ }
if(_callback != null && _callback.shouldTimeout())
_timeout = -1; // timeout immediately
return _timeout < time;
@@ -283,6 +286,7 @@
public void onMatched() {
if(_callback != null) {
_callback.onMatched(_message);
+ clearMatched();
}
synchronized(this) {
notifyAll();