- * hints, data for non-existing ranges
+ v hints, data for non-existing ranges
* opens multiple channels to the same address
- * hints do not expire
- * RTT calculations need improvement (test)
- * google-log is unnecessary
+ v hints do not expire
+ v RTT calculations need improvement (test)
+ v google-log is unnecessary
* reduce template use (peer queue)
v hints do not expire
- * survive 10% loss
+ v survive 10% loss
* unlimited ping pong
- * git
- * check hints agains ack_out?_
- * check data against ack_in
+ v git sha-1
+ v check hints agains ack_out?_
+ v check data against ack_in
v channel suspend/wake. 3 cong modes state machine - ???
* minimize the number of template instantiations
- * Channel thinks how much it HINTs a second,
+ v Channel thinks how much it HINTs a second,
picker thinks which HINTs are snubbed
* dead Channels are not killed => cannot open a new one
(have a channel already)
- * peers don't cooperate
+ v peers don't cooperate
+ * RecoverProgress fails sometime
+ * leecher can't see file is done already
hint_in_.pop_front();
send = file().ack_out().find_filtered
(ack_in_,hint,0,bins::FILLED);
- dprintf("%s #%i may_send %lli\n",tintstr(),id,send.base_offset());
+ dprintf("%s #%i dequeued %lli\n",tintstr(),id,send.base_offset());
if (send!=bin64_t::NONE)
while (send!=hint) {
hint = hint.towards(send);
cc_->OnDataSent(data);
if (dgram.Send()==-1)
print_error("can't send datagram");
- last_send_time_ = NOW;
- RequeueSend(cc_->NextSendTime());
}
cc_->OnDataRecvd(data);
last_recv_time_ = NOW;
if (data!=bin64_t::ALL)
- RequeueSend(NOW);
+ Send(); //RequeueSend(NOW);
}
dev_avg_ = ( dev_avg_*3 + abs(rtt-rtt_avg_) ) >> 2;
dprintf("%s #%i rtt %lli dev %lli\n",
tintstr(),id,rtt_avg_,dev_avg_);
- cc_->OnAckRcvd(data_out_[i].bin);
+ cc_->OnAckRcvd(data_out_[i].bin); // may be invoked twice FIXME FIXME FIXME
}
ack_in_.set(ackd_pos);
while (data_out_.size() && ack_in_.get(data_out_.front().bin)==bins::FILLED)
dprintf("%s #%i sch_send %s\n",tintstr(),sender->id,
tintstr(send_time));
sender->Send();
+ sender->last_send_time_ = NOW;
+ sender->RequeueSend(sender->cc_->NextSendTime());
pop_heap(send_queue.begin(), send_queue.end(), tblater);
send_queue.pop_back();
} else {