tracker tweaks

This commit is contained in:
Charles Kerr 2007-08-19 00:02:23 +00:00
parent 1e53e9de72
commit b66efdf998
1 changed files with 8 additions and 11 deletions

View File

@ -51,10 +51,10 @@
#define REQ_TIMEOUT_INTERVAL_SEC 60
/* the number of peers that is our goal */
#define NUMWANT 50
#define NUMWANT 75
/* the length of the 'key' argument passed in tracker requests */
#define TR_KEY_LEN 20
#define TR_KEY_LEN 10
/**
@ -277,14 +277,12 @@ static int onTrackerScrapeNow( void* );
static void
tr_trackerScrapeSoon( Tracker * t )
{
#if 0
/* don't start more than one scrape at once for the same tracker... */
if( !tr_ptrArrayEmpty( t->scraping ) )
return;
if( !t->scrapeTag )
t->scrapeTag = tr_timerNew( t->handle, onTrackerScrapeNow, t, NULL, 1000 );
#endif
}
static Tracker*
@ -364,11 +362,10 @@ escape( char * out, const uint8_t * in, int in_len )
{
const uint8_t *end = in + in_len;
while( in != end )
// if( isalnum(*in) )
// *out++ = (char) *in++;
// else
//out += snprintf( out, 4, "%%%02X", (unsigned int)*in++ );
out += snprintf( out, 4, "%%%02x", (unsigned int)*in++ );
if( isalnum(*in) )
*out++ = (char) *in++;
else
out += snprintf( out, 4, "%%%02X", (unsigned int)*in++ );
*out = '\0';
}
@ -539,10 +536,10 @@ addCommonHeaders( const Tracker * t,
tr_tracker_info_t * address = getCurrentAddress( t );
snprintf( buf, sizeof(buf), "%s:%d", address->address, address->port );
evhttp_add_header( req->output_headers, "Host", buf );
evhttp_add_header( req->output_headers, "Connection", "close" );
evhttp_add_header( req->output_headers, "Content-Length", "0" );
evhttp_add_header( req->output_headers, "User-Agent",
TR_NAME "/" LONG_VERSION_STRING );
evhttp_add_header( req->output_headers, "Connection", "close" );
evhttp_add_header( req->output_headers, "Content-length", "0" );
}
/***