Author: nextgens
Date: 2005-10-12 11:45:41 +0000 (Wed, 12 Oct 2005)
New Revision: 7420

Modified:
   trunk/freenet/src/freenet/node/PacketSender.java
Log:
We should ack, resend packets and then send new requests...

Modified: trunk/freenet/src/freenet/node/PacketSender.java
===================================================================
--- trunk/freenet/src/freenet/node/PacketSender.java    2005-10-12 11:40:41 UTC 
(rev 7419)
+++ trunk/freenet/src/freenet/node/PacketSender.java    2005-10-12 11:45:41 UTC 
(rev 7420)
@@ -50,17 +50,16 @@
                             pn.disconnected();
                             continue;
                         }
-
-                        if(node.packetMangler == null) continue;
-                        // Any messages to send?
-                        MessageItem[] messages = null;
-                        messages = pn.grabQueuedMessageItems();
-                        if(messages != null) {
-                            // Send packets, right now, blocking, including 
any active notifications
-                            
node.packetMangler.processOutgoingOrRequeue(messages, pn, true);
-                            continue;
+                        
+                        // Any urgent notifications to send?
+                        long urgentTime = pn.getNextUrgentTime();
+                        if(urgentTime <= now) {
+                            // Send them
+                            pn.sendAnyUrgentNotifications();
+                        } else {
+                            nextActionTime = Math.min(nextActionTime, 
urgentTime);
                         }
-
+                        
                         // Any packets to resend?
                         for(int j=0;j<2;j++) {
                             KeyTracker kt;
@@ -88,14 +87,15 @@
                             }

                         }
-                        
-                        // Any urgent notifications to send?
-                        long urgentTime = pn.getNextUrgentTime();
-                        if(urgentTime <= now) {
-                            // Send them
-                            pn.sendAnyUrgentNotifications();
-                        } else {
-                            nextActionTime = Math.min(nextActionTime, 
urgentTime);
+
+                        if(node.packetMangler == null) continue;
+                        // Any messages to send?
+                        MessageItem[] messages = null;
+                        messages = pn.grabQueuedMessageItems();
+                        if(messages != null) {
+                            // Send packets, right now, blocking, including 
any active notifications
+                            
node.packetMangler.processOutgoingOrRequeue(messages, pn, true);
+                            continue;
                         }

                         // Need to send a keepalive packet?


Reply via email to