From bcf34c553bd7e607c887a8e37a3118c209b7d652 Mon Sep 17 00:00:00 2001 From: victor Date: Fri, 13 Nov 2009 12:15:13 +0000 Subject: [PATCH] rotation git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@551 e16421f0-f15b-0410-abcd-98678b794739 --- sendrecv.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sendrecv.cpp b/sendrecv.cpp index 511b018..07151d3 100644 --- a/sendrecv.cpp +++ b/sendrecv.cpp @@ -57,8 +57,8 @@ bin64_t Channel::DequeueHint () { // TODO: resilience bin64_t hint = hint_in_.front().bin; tint time = hint_in_.front().time; hint_in_.pop_front(); - if (time < NOW-2*TINT_SEC ) //NOW-8*rtt_avg_) - continue; + //if (time < NOW-2*TINT_SEC ) //NOW-8*rtt_avg_) + // continue; send = file().ack_out().find_filtered(ack_in_,hint,bins::FILLED); send = send.left_foot(); // single packet dprintf("%s #%i dequeued %lli\n",tintstr(),id,send.base_offset()); @@ -156,8 +156,8 @@ void Channel::AddHint (Datagram& dgram) { if ( hint_out_mark_.time < NOW - TINT_SEC*2 ) { //NOW-rtt_avg_*8-dev_avg_) { hint_out_mark_.bin=bin64_t::NONE; - hint_out_ = hint_out_am_; - hint_out_am_ = 0; + //hint_out_ = hint_out_am_; + //hint_out_am_ = 0; } if ( peer_pps > hint_out_+hint_out_am_ ) { //4*peer_cwnd @@ -171,8 +171,11 @@ void Channel::AddHint (Datagram& dgram) { dgram.Push8(P2TP_HINT); dgram.Push32(hint); dprintf("%s #%i +hint (%i,%lli)\n",tintstr(),id,hint.layer(),hint.offset()); - if (hint_out_mark_.bin==bin64_t::NONE) - hint_out_mark_ = hint; + if (hint_out_mark_.bin==bin64_t::NONE) { + hint_out_mark_ = tintbin(NOW,hint); + hint_out_ = hint_out_am_; + hint_out_am_ = 0; + } hint_out_am_ += hint.width(); //hint_out_ += hint.width(); } @@ -300,8 +303,6 @@ bin64_t Channel::OnData (Datagram& dgram) { last_data_time_ = NOW; if (pos.within(hint_out_mark_.bin)) { hint_out_mark_.bin = bin64_t::NONE; - hint_out_ = hint_out_am_; - hint_out_am_ = 0; } if (hint_out_) hint_out_--; -- 2.20.1