fast fix
authorvictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Fri, 20 Nov 2009 14:48:43 +0000 (14:48 +0000)
committervictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Fri, 20 Nov 2009 14:48:43 +0000 (14:48 +0000)
git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@610 e16421f0-f15b-0410-abcd-98678b794739

ext/seq_picker.cpp
sendrecv.cpp

index 74557eb..91222fe 100644 (file)
@@ -64,7 +64,7 @@ public:
             hint = hint.left();
         assert(ack_hint_out_.get(hint)==bins::EMPTY);
         ack_hint_out_.set(hint);
-        hint_out_.push_back(hint);
+        hint_out_.push_back(tintbin(NOW,hint));
         return hint;
     }
     
index bb62d37..6895739 100644 (file)
@@ -337,7 +337,8 @@ void    Channel::CleanDataOut (bin64_t ackd_pos) {
         }
         static const int MAX_REORDERING = 2;  // the triple-ACK principle
         if (max_ack_off>MAX_REORDERING) {
-            while (max_ack_off && ack_in_.is_filled(data_out_.front().bin)) {
+            while (max_ack_off && (data_out_.front().bin==bin64_t::NONE
+                                   || ack_in_.is_filled(data_out_.front().bin)) ) {
                 data_out_.pop_front();
                 max_ack_off--;
             }
@@ -352,7 +353,7 @@ void    Channel::CleanDataOut (bin64_t ackd_pos) {
     }
     tint timeout = NOW - rtt_avg_ - 4*std::max(dev_avg_,TINT_MSEC*50);
     while (!data_out_.empty() && data_out_.front().time<timeout) {
-        if (ack_in_.is_empty(data_out_.front().bin)) {
+        if (data_out_.front().bin!=bin64_t::NONE && ack_in_.is_empty(data_out_.front().bin)) {
             cc_->OnAckRcvd(bin64_t::NONE);
             data_out_cap_ = bin64_t::ALL;
             dprintf("%s #%i Tdata %s\n",tintstr(),id,data_out_.front().bin.str());