Author: toad
Date: 2009-04-21 11:58:19 +0000 (Tue, 21 Apr 2009)
New Revision: 27150
Modified:
trunk/freenet/src/freenet/node/RequestSender.java
Log:
Simplify, and only put the CHK filters in when waiting for a CHK / SSK filters
when waiting for an SSK
Modified: trunk/freenet/src/freenet/node/RequestSender.java
===================================================================
--- trunk/freenet/src/freenet/node/RequestSender.java 2009-04-21 11:47:37 UTC
(rev 27149)
+++ trunk/freenet/src/freenet/node/RequestSender.java 2009-04-21 11:58:19 UTC
(rev 27150)
@@ -581,15 +581,19 @@
MessageFilter mfDNF =
MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPDataNotFound);
MessageFilter mfRF =
MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPRecentlyFailed);
- MessageFilter mfDF = makeDataFoundFilter(next);
MessageFilter mfRouteNotFound =
MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPRouteNotFound);
MessageFilter mfRejectedOverload =
MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPRejectedOverload);
+
MessageFilter mfPubKey =
MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPSSKPubKey);
MessageFilter mfRealDFCHK =
MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPCHKDataFound);
MessageFilter mfAltDFSSKHeaders =
MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPSSKDataFoundHeaders);
MessageFilter mfAltDFSSKData =
MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPSSKDataFoundData);
- MessageFilter mf =
mfDNF.or(mfRF.or(mfRouteNotFound.or(mfRejectedOverload.or(mfDF.or(mfPubKey.or(mfRealDFCHK.or(mfAltDFSSKHeaders.or(mfAltDFSSKData))))))));
-
+ MessageFilter mf =
mfDNF.or(mfRF.or(mfRouteNotFound.or(mfRejectedOverload)));
+ if(key instanceof NodeCHK) {
+ mf = mfRealDFCHK.or(mf);
+ } else {
+ mf =
mfPubKey.or(mfAltDFSSKHeaders.or(mfAltDFSSKData.or(mf)));
+ }
try {
msg = node.usm.waitFor(mf, this);
@@ -975,18 +979,6 @@
}
}
- /**
- * Note that this must be first on the list.
- */
- private MessageFilter makeDataFoundFilter(PeerNode next) {
- if(key instanceof NodeCHK)
- return MessageFilter.create().setSource(next).setField(DMT.UID,
uid).setTimeout(FETCH_TIMEOUT).setType(DMT.FNPCHKDataFound);
- else if(key instanceof NodeSSK) {
- return MessageFilter.nothing();
- }
- else throw new IllegalStateException("Unknown keytype: "+key);
- }
-
private Message createDataRequest() {
if(key instanceof NodeCHK)
return DMT.createFNPCHKDataRequest(uid, htl, (NodeCHK)key);
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs