From 779df224097a983750161c3fd30f513c3b59be60 Mon Sep 17 00:00:00 2001 From: Denis Ahrens Date: Tue, 7 Oct 2008 02:09:38 +0000 Subject: [PATCH] only sync when the peer is actually added to the first pool. this saves ca. 40% syncdata --- trackerlogic.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/trackerlogic.c b/trackerlogic.c index 4ca8f0a..92e9624 100644 --- a/trackerlogic.c +++ b/trackerlogic.c @@ -60,11 +60,6 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer WANT_SYNC_PARAM( return NULL; } -#ifdef WANT_SYNC_LIVE - if( !from_changeset ) - livesync_tell( hash, peer, PEER_FLAG_LEECHING ); -#endif - if( !exactmatch ) { /* Create a new torrent entry, then */ memmove( &torrent->hash, hash, sizeof( ot_hash ) ); @@ -109,6 +104,11 @@ ot_torrent *add_peer_to_torrent( ot_hash *hash, ot_peer *peer WANT_SYNC_PARAM( memmove( peer_dest, peer, sizeof( ot_peer ) ); torrent->peer_list->peer_count++; +#ifdef WANT_SYNC_LIVE + if( !from_changeset ) + livesync_tell( hash, peer, PEER_FLAG_LEECHING ); +#endif + if( OT_FLAG( peer ) & PEER_FLAG_COMPLETED ) torrent->peer_list->down_count++; @@ -383,4 +383,4 @@ void trackerlogic_deinit( void ) { mutex_deinit( ); } -const char *g_version_trackerlogic_c = "$Source: /home/cvsroot/opentracker/trackerlogic.c,v $: $Revision: 1.104 $\n"; +const char *g_version_trackerlogic_c = "$Source: /home/cvsroot/opentracker/trackerlogic.c,v $: $Revision: 1.105 $\n";