From: victor Date: Sun, 15 Nov 2009 08:35:54 +0000 (+0000) Subject: small fix; need a big change X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=187b3baddee7adc6a5eaf0c2d6c0068a46c8b657;p=swift-upb.git small fix; need a big change git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@561 e16421f0-f15b-0410-abcd-98678b794739 --- diff --git a/ext/send_control.cpp b/ext/send_control.cpp index 54ed980..495eb16 100644 --- a/ext/send_control.cpp +++ b/ext/send_control.cpp @@ -104,10 +104,11 @@ bool CwndController::MaySendData() { void CwndController::OnDataSent(bin64_t b) { - if ( (b==bin64_t::ALL || b==bin64_t::NONE) && MaySendData() ) { // no more data - Schedule(NOW+ch_->rtt_avg_); - Swap(new KeepAliveController(this)); - } else { + if ( (b==bin64_t::ALL || b==bin64_t::NONE) && MaySendData() ) { // no more data (no hints?) + Schedule(NOW+ch_->rtt_avg_); // soft pause; nothing to send yet + if (ch_->last_send_data_time_ < NOW-ch_->rtt_avg_) + Swap(new KeepAliveController(this)); // really, nothing to send + } else { // FIXME: mandatory rescheduling after send/recv; based on state tint spacing = ch_->rtt_avg_ / cwnd_; if (ch_->data_out_.size() < cwnd_) { // have cwnd; not the right time yet Schedule(ch_->last_send_data_time_+spacing);