Author: toad
Date: 2008-01-17 12:40:29 +0000 (Thu, 17 Jan 2008)
New Revision: 17090

Modified:
   trunk/freenet/src/freenet/io/comm/MessageFilter.java
   trunk/freenet/src/freenet/node/OpennetManager.java
   trunk/freenet/src/freenet/node/RequestSender.java
Log:
Remove confusing and unused option to not match dropped or restarted 
connections.
We can always reinstate it later if we need it, it's not used right now.

Modified: trunk/freenet/src/freenet/io/comm/MessageFilter.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/MessageFilter.java        2008-01-17 
12:35:36 UTC (rev 17089)
+++ trunk/freenet/src/freenet/io/comm/MessageFilter.java        2008-01-17 
12:40:29 UTC (rev 17090)
@@ -47,15 +47,11 @@
     private int _initialTimeout;
     private MessageFilter _or;
     private Message _message;
-    private boolean _matchesDroppedConnections;
-    private boolean _matchesRestartedConnections;
     private long _oldBootID;
     private AsyncMessageFilterCallback _callback;

     private MessageFilter() {
         setTimeout(DEFAULT_TIMEOUT);
-        _matchesDroppedConnections = true; // on by default
-        _matchesRestartedConnections = true; // also on by default
         _timeoutFromWait = true;
     }

@@ -160,16 +156,6 @@
                return this;
        }

-       public MessageFilter setMatchesDroppedConnection(boolean m) {
-           _matchesDroppedConnections = m;
-           return this;
-       }
-       
-       public MessageFilter setMatchesRestartedConnections(boolean m) {
-               _matchesRestartedConnections = m;
-               return this;
-       }
-       
        public MessageFilter setAsyncCallback(AsyncMessageFilterCallback cb) {
                _callback = cb;
                return this;
@@ -251,13 +237,13 @@
     }

     public boolean matchesDroppedConnection(PeerContext ctx) {
-       if(_matchesDroppedConnections && _source == ctx) return true;
+       if(_source == ctx) return true;
        if(_or != null) return _or.matchesDroppedConnection(ctx);
        return false;
     }

     public boolean matchesRestartedConnection(PeerContext ctx) {
-       if(_matchesRestartedConnections && _source == ctx) return true;
+       if(_source == ctx) return true;
        if(_or != null) return _or.matchesRestartedConnection(ctx);
        return false;
     }

Modified: trunk/freenet/src/freenet/node/OpennetManager.java
===================================================================
--- trunk/freenet/src/freenet/node/OpennetManager.java  2008-01-17 12:35:36 UTC 
(rev 17089)
+++ trunk/freenet/src/freenet/node/OpennetManager.java  2008-01-17 12:40:29 UTC 
(rev 17090)
@@ -571,7 +571,6 @@
                                
MessageFilter.create().setSource(source).setField(DMT.UID, 
uid).setTimeout(RequestSender.OPENNET_TIMEOUT).setType(DMT.FNPOpennetCompletedAck);
                        mf = mfAck.or(mf);
                }
-               
mf.setMatchesDroppedConnection(true).setMatchesRestartedConnections(true);
                Message msg;

                try {

Modified: trunk/freenet/src/freenet/node/RequestSender.java
===================================================================
--- trunk/freenet/src/freenet/node/RequestSender.java   2008-01-17 12:35:36 UTC 
(rev 17089)
+++ trunk/freenet/src/freenet/node/RequestSender.java   2008-01-17 12:40:29 UTC 
(rev 17090)
@@ -686,7 +686,7 @@

     /** Wait for the opennet completion message and discard it */
     private void finishOpennetNull(PeerNode next) {
-       MessageFilter mf = 
MessageFilter.create().setSource(next).setField(DMT.UID, 
uid).setTimeout(OPENNET_TIMEOUT).setType(DMT.FNPOpennetCompletedAck).setMatchesDroppedConnection(true).setMatchesRestartedConnections(true);
+       MessageFilter mf = 
MessageFilter.create().setSource(next).setField(DMT.UID, 
uid).setTimeout(OPENNET_TIMEOUT).setType(DMT.FNPOpennetCompletedAck);

        try {
                        node.usm.addAsyncFilter(mf, new 
NullAsyncMessageFilterCallback());


Reply via email to