Author: toad
Date: 2005-11-12 00:13:09 +0000 (Sat, 12 Nov 2005)
New Revision: 7531

Modified:
   trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
   trunk/freenet/src/freenet/io/comm/DummyPeerContext.java
   trunk/freenet/src/freenet/io/comm/PeerContext.java
   trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
   trunk/freenet/src/freenet/node/PeerNode.java
   trunk/freenet/src/freenet/node/Version.java
Log:
168:
When we get a throwable from the low level code, force a disconnect.
This will then cause a reconnect with a new KeyTracker, and clear any old 
problems.

Modified: trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java
===================================================================
--- trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java     
2005-11-11 21:58:05 UTC (rev 7530)
+++ trunk/freenet/src/freenet/client/HighLevelSimpleClientImpl.java     
2005-11-12 00:13:09 UTC (rev 7531)
@@ -41,7 +41,7 @@
        /** If set, only check the local datastore, don't send an actual 
request out.
         * Don't turn this off either. */
        static final boolean LOCAL_REQUESTS_ONLY = false;
-       static final int SPLITFILE_INSERT_THREADS = 10;
+       static final int SPLITFILE_INSERT_THREADS = 50;
        static final int SPLITFILE_INSERT_RETRIES = 0;
        // going by memory usage only; 4kB per stripe
        static final int MAX_SPLITFILE_BLOCKS_PER_SEGMENT = 1024;

Modified: trunk/freenet/src/freenet/io/comm/DummyPeerContext.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/DummyPeerContext.java     2005-11-11 
21:58:05 UTC (rev 7530)
+++ trunk/freenet/src/freenet/io/comm/DummyPeerContext.java     2005-11-12 
00:13:09 UTC (rev 7531)
@@ -18,4 +18,8 @@
         peer = p;
     }

+       public void forceDisconnect() {
+               // Do nothing
+       }
+
 }

Modified: trunk/freenet/src/freenet/io/comm/PeerContext.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/PeerContext.java  2005-11-11 21:58:05 UTC 
(rev 7530)
+++ trunk/freenet/src/freenet/io/comm/PeerContext.java  2005-11-12 00:13:09 UTC 
(rev 7531)
@@ -9,4 +9,7 @@
 public interface PeerContext {
     // Largely opaque interface for now
     Peer getPeer();
+
+    /** Force the peer to disconnect */
+       void forceDisconnect();
 }

Modified: trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/UdpSocketManager.java     2005-11-11 
21:58:05 UTC (rev 7530)
+++ trunk/freenet/src/freenet/io/comm/UdpSocketManager.java     2005-11-12 
00:13:09 UTC (rev 7531)
@@ -358,7 +358,14 @@
                }
                byte[] blockToSend = m.encodeToPacket(lowLevelFilter, 
destination);
                if(lowLevelFilter != null) {
-                   lowLevelFilter.processOutgoing(blockToSend, 0, 
blockToSend.length, destination);
+                       try {
+                               lowLevelFilter.processOutgoing(blockToSend, 0, 
blockToSend.length, destination);
+                               return;
+                       } catch (Throwable t) {
+                               Logger.error(this, "Caught "+t+" sending "+m+" 
to "+destination, t);
+                               destination.forceDisconnect();
+                               throw new NotConnectedException("Error 
"+t.toString()+" forced disconnect");
+                       }
                } else {
                    sendPacket(blockToSend, destination.getPeer());
                }

Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java        2005-11-11 21:58:05 UTC 
(rev 7530)
+++ trunk/freenet/src/freenet/node/PeerNode.java        2005-11-12 00:13:09 UTC 
(rev 7531)
@@ -81,8 +81,8 @@
      * handshake.
      */
     private boolean isConnected;
-

+    
     /** Current location in the keyspace */
     private Location currentLocation;

@@ -327,6 +327,10 @@
         node.lm.lostOrRestartedNode(this);
     }

+    public void forceDisconnect() {
+       disconnected();
+    }
+    
     /**
      * Grab all queued Message's.
      * @return Null if no messages are queued, or an array of

Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2005-11-11 21:58:05 UTC (rev 
7530)
+++ trunk/freenet/src/freenet/node/Version.java 2005-11-12 00:13:09 UTC (rev 
7531)
@@ -20,10 +20,10 @@
        public static final String protocolVersion = "1.0";

        /** The build number of the current revision */
-       public static final int buildNumber = 167;
+       public static final int buildNumber = 168;

        /** Oldest build of Fred we will talk to */
-       public static final int lastGoodBuild = 166;
+       public static final int lastGoodBuild = 168;

        /** The highest reported build of fred */
        public static int highestSeenBuild = buildNumber;


Reply via email to