mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
(trunk libT) #117 "UDP tracker protocol support (BEP #15)" -- refactor announcer.c so that alternate tracker protocols can be supported.
This commit adds a set of package-visible structs and functions to allow delegating announces and scrapes to different protocol handlers. (Examples: struct tr_announce_request, struct tr_announce_response, struct tr_scrape_request, struct tr_scrape_response.) HTTP is the only protocol handler currently implemented; however, this provides a clean API for other protocol handlers, and having this in trunk will help shake out any bugs in this refactoring. In addition, logging via the TR_DEBUG_FD environment variable is vastly improved in the announcer module now.
This commit is contained in:
@@ -197,14 +197,17 @@ doScrape( const tr_info * inf )
|
||||
struct evbuffer * buf;
|
||||
const char * scrape = inf->trackers[i].scrape;
|
||||
char * url;
|
||||
char escaped[SHA_DIGEST_LENGTH*3 + 1];
|
||||
|
||||
if( scrape == NULL )
|
||||
continue;
|
||||
|
||||
tr_http_escape_sha1( escaped, inf->hash );
|
||||
|
||||
url = tr_strdup_printf( "%s%cinfo_hash=%s",
|
||||
scrape,
|
||||
strchr( scrape, '?' ) ? '&' : '?',
|
||||
inf->hashEscaped );
|
||||
escaped );
|
||||
|
||||
printf( "%s ... ", url );
|
||||
fflush( stdout );
|
||||
|
||||
Reference in New Issue
Block a user