mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
possible fix for Zeph's "too many open files" bug report.
This commit is contained in:
parent
81ea9b4abd
commit
0663c4aef7
2 changed files with 9 additions and 12 deletions
|
@ -246,7 +246,7 @@ escape( char * out, const uint8_t * in, int in_len ) /* rfc2396 */
|
|||
*out = '\0';
|
||||
}
|
||||
|
||||
static void scrapeNow( tr_tracker * );
|
||||
static int onScrapeNow( void * vt );
|
||||
|
||||
tr_tracker *
|
||||
tr_trackerNew( const tr_torrent * torrent )
|
||||
|
@ -301,7 +301,13 @@ tr_trackerNew( const tr_torrent * torrent )
|
|||
assert( nwalk - t->addresses == sum );
|
||||
assert( iwalk - t->tierFronts == sum );
|
||||
|
||||
scrapeNow( t );
|
||||
/* scrape sometime in the next two minutes.
|
||||
scrapes are staggered out like this to prevent
|
||||
hundreds of scrapes from going out at the same time */
|
||||
t->scrapeTimer = tr_timerNew( t->handle,
|
||||
onScrapeNow, t,
|
||||
tr_rand(120)*1000 );
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
@ -487,9 +493,6 @@ findTrackerFromHash( struct torrent_hash * data )
|
|||
****
|
||||
***/
|
||||
|
||||
static int
|
||||
onScrapeNow( void * vt );
|
||||
|
||||
static void
|
||||
onScrapeResponse( struct evhttp_request * req, void * vhash )
|
||||
{
|
||||
|
@ -599,12 +602,6 @@ onScrapeNow( void * vt )
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
scrapeNow( tr_tracker * t )
|
||||
{
|
||||
onScrapeNow( t );
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
**** TRACKER REQUESTS
|
||||
|
|
|
@ -40,7 +40,7 @@ FILE* tr_getLog( void );
|
|||
|
||||
char* tr_getLogTimeStr( char * buf, int buflen );
|
||||
|
||||
int tr_rand ( int );
|
||||
int tr_rand ( int );
|
||||
|
||||
int tr_mkdirp( const char * path, int permissions );
|
||||
|
||||
|
|
Loading…
Reference in a new issue