From 566e8267e15032dfd9f12320c83deee4d74d13cb Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Mon, 1 Dec 2008 17:56:53 +0000 Subject: Live Sync for peers that do not come back too early. --- trackerlogic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'trackerlogic.c') diff --git a/trackerlogic.c b/trackerlogic.c index faca19b..05c00b0 100644 --- a/trackerlogic.c +++ b/trackerlogic.c @@ -103,6 +103,16 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer WANT_SYNC_PARAM( } else { stats_issue_event( EVENT_RENEW, 0, OT_PEERTIME( peer_dest ) ); +#ifdef WANT_SYNC_LIVE + /* Won't live sync peers that come back too fast. Only exception: + fresh "completed" reports */ + if( !from_sync ) { + if( OT_PEERTIME( peer_dest ) > OT_CLIENT_SYNC_RENEW_BOUNDARY || + ( !(OT_FLAG(peer_dest) & PEER_FLAG_COMPLETED ) && (OT_FLAG(peer) & PEER_FLAG_COMPLETED ) ) ) + livesync_tell( hash, peer ); + } +#endif + if( (OT_FLAG(peer_dest) & PEER_FLAG_SEEDING ) && !(OT_FLAG(peer) & PEER_FLAG_SEEDING ) ) torrent->peer_list->seed_count--; if( !(OT_FLAG(peer_dest) & PEER_FLAG_SEEDING ) && (OT_FLAG(peer) & PEER_FLAG_SEEDING ) ) -- cgit v1.2.3