has to be reworked
authorvictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Sun, 15 Nov 2009 08:09:55 +0000 (08:09 +0000)
committervictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Sun, 15 Nov 2009 08:09:55 +0000 (08:09 +0000)
git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@560 e16421f0-f15b-0410-abcd-98678b794739

sendrecv.cpp

index 0c1bcad..fb8493e 100644 (file)
@@ -94,7 +94,8 @@ void  Channel::AddHandshake (Datagram& dgram) {
 void    Channel::ClearStaleDataOut() {
     int oldsize = data_out_.size();
     tint timeout = NOW - max( rtt_avg_-dev_avg_*4, 500*TINT_MSEC );
-    while ( data_out_.size() && data_out_.front().time < timeout ) {
+    while ( data_out_.size() && data_out_.front().time < timeout &&
+            ack_in_.get(data_out_.front().bin)==bins::EMPTY ) {
         dprintf("%s #%i Tdata %s\n",tintstr(),id,data_out_.front().bin.str());
         data_out_.pop_front();
     }