From 8a7edafb4e20c8d3ea7eb4f0fed9bba0dfe5572f Mon Sep 17 00:00:00 2001 From: Eric Petit Date: Tue, 26 Sep 2006 11:16:40 +0000 Subject: [PATCH] Don't attach peers to inactive torrents (should fix the CLOSE_WAIT connection leaks) --- libtransmission/transmission.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libtransmission/transmission.c b/libtransmission/transmission.c index ff8e943f5..a0846f9fc 100644 --- a/libtransmission/transmission.c +++ b/libtransmission/transmission.c @@ -828,6 +828,12 @@ static void acceptLoop( void * _h ) for( tor = h->torrentList; tor; tor = tor->next ) { tr_lockLock( &tor->lock ); + if( tor->status & TR_STATUS_INACTIVE ) + { + tr_lockUnlock( &tor->lock ); + continue; + } + if( 0 == memcmp( tor->info.hash, hash, SHA_DIGEST_LENGTH ) ) {