From 7df37d37c040d4e76719b2d2862ad1400fd76154 Mon Sep 17 00:00:00 2001 From: victor Date: Wed, 18 Nov 2009 16:24:13 +0000 Subject: [PATCH] leecher restart issue git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@585 e16421f0-f15b-0410-abcd-98678b794739 --- sendrecv.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sendrecv.cpp b/sendrecv.cpp index e059289..1654d8b 100644 --- a/sendrecv.cpp +++ b/sendrecv.cpp @@ -134,7 +134,7 @@ void Channel::Send () { void Channel::CleanStaleHintOut () { - tint timed_out = NOW - 8*rtt_avg_; + tint timed_out = NOW - 8*rtt_avg_; // FIXME BULLSHIT (take rtt=0) while ( !hint_out_.empty() && hint_out_.front().time < timed_out ) { transfer().picker().Expired(hint_out_.front().bin); hint_out_.pop_front(); @@ -437,7 +437,8 @@ void Channel::RecvDatagram (int socket) { RETLOG ("hash unknown, no such file"); dprintf("%s #0 -hash ALL %s\n",tintstr(),hash.hex().c_str()); for(binqueue::iterator i=file->hs_in_.begin(); i!=file->hs_in_.end(); i++) - if (channels[*i] && channels[*i]->peer_==data.addr) + if (channels[*i] && channels[*i]->peer_==data.addr && + channels[*i]->last_recv_time_>NOW-TINT_SEC*2) RETLOG("have a channel already"); channel = new Channel(file, socket, data.address()); } else { -- 2.20.1