From 2873de399c18d1683039cb97847f0ffb1852d2bc Mon Sep 17 00:00:00 2001 From: Victor Grishchenko Date: Wed, 16 Dec 2009 16:45:40 +0100 Subject: [PATCH] this bug almost killed me --- send_control.cpp | 10 ++++++---- sendrecv.cpp | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/send_control.cpp b/send_control.cpp index 4938c2d..d6d553b 100644 --- a/send_control.cpp +++ b/send_control.cpp @@ -128,10 +128,12 @@ tint Channel::SlowStartNextSendTime () { tint Channel::AimdNextSendTime () { if (ack_not_rcvd_recent_) BackOffOnLosses(); - if (cwnd_>1) - cwnd_ += ack_rcvd_recent_/cwnd_; - else - cwnd_ *= 2; + if (ack_rcvd_recent_) { + if (cwnd_>1) + cwnd_ += ack_rcvd_recent_/cwnd_; + else + cwnd_ *= 2; + } ack_rcvd_recent_=0; return CwndRateNextSendTime(); } diff --git a/sendrecv.cpp b/sendrecv.cpp index 84577c0..6e31e4a 100644 --- a/sendrecv.cpp +++ b/sendrecv.cpp @@ -123,11 +123,13 @@ void Channel::Send () { tintstr(),id,dgram.size(),peer().str(),peer_channel_id_); if (dgram.size()==4) {// only the channel id; bare keep-alive data = bin64_t::ALL; + //dprintf("%s #%u considering keepalive %i %f %s\n", + // tintstr(),id,(int)data_out_.size(),cwnd_,SEND_CONTROL_MODES[send_control_]); if (data_out_.size()