fix looooong-standing bug that choked tracker connections
This commit is contained in:
parent
c7beebd1eb
commit
1d932b07c7
|
@ -329,14 +329,14 @@ int tr_fdSocketCreate( int type, int priority )
|
|||
int s = -1;
|
||||
|
||||
tr_lockLock( &gFd->lock );
|
||||
if( ( priority && gFd->reserved < TR_RESERVED_FDS ) ||
|
||||
( !priority && gFd->normal < gFd->normalMax ) )
|
||||
{
|
||||
|
||||
if( priority && gFd->reserved >= TR_RESERVED_FDS )
|
||||
priority = FALSE;
|
||||
|
||||
if( priority || ( gFd->normal < gFd->normalMax ) )
|
||||
if( ( s = socket( AF_INET, type, 0 ) ) < 0 )
|
||||
{
|
||||
tr_err( "Could not create socket (%s)", strerror( errno ) );
|
||||
}
|
||||
}
|
||||
|
||||
if( s > -1 )
|
||||
{
|
||||
SocketSetPriority( s, priority );
|
||||
|
|
|
@ -969,10 +969,13 @@ tr_torrentFree( tr_torrent_t * tor )
|
|||
}
|
||||
}
|
||||
|
||||
tr_free( tor );
|
||||
|
||||
h->torrentCount--;
|
||||
|
||||
fprintf(stderr, "closing torrent %s... %d torrents left",
|
||||
tor->info.name, h->torrentCount );
|
||||
|
||||
tr_free( tor );
|
||||
|
||||
tr_sharedUnlock( h->shared );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue