Author: toad
Date: 2008-03-15 18:02:02 +0000 (Sat, 15 Mar 2008)
New Revision: 18543

Modified:
   trunk/freenet/src/freenet/io/xfer/PacketThrottle.java
Log:
Fix not sending packets

Modified: trunk/freenet/src/freenet/io/xfer/PacketThrottle.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/PacketThrottle.java       2008-03-15 
06:52:52 UTC (rev 18542)
+++ trunk/freenet/src/freenet/io/xfer/PacketThrottle.java       2008-03-15 
18:02:02 UTC (rev 18543)
@@ -152,7 +152,9 @@
                        long thisTicket=_packetTicketGenerator++;
                        while(true) {
                                int windowSize = (int) getWindowSize();
-                               boolean 
wereNext=(_packetSeq==(thisTicket-_abandonedTickets));
+                               // If we have different timeouts, and we have 
packets 1 and 2 timeout and 3 and 4 not timeout,
+                               // we could end up not sending 3 and 4 at all 
if we use == here.
+                               boolean 
wereNext=(_packetSeq<=(thisTicket-_abandonedTickets));
                                //If there is room for it in the window, break 
and send it immeadiately
                                if(_packetsInFlight < windowSize && wereNext) {
                                        _packetsInFlight++;


Reply via email to