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();
}
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()<cwnd_ && send_control_!=KEEP_ALIVE_CONTROL) {
if ( cwnd_ < 1 )
SwitchSendControl(KEEP_ALIVE_CONTROL);
else
- cwnd_ /= 2;
+ cwnd_ = cwnd_/2.0;
}
//if (data_out_.empty() && send_control_!=KEEP_ALIVE_CONTROL)
// SwitchSendControl(KEEP_ALIVE_CONTROL);// we did our best