From 66650a2b62284534b0341d16ee9b5d778b22d4a6 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 17 Jun 2010 02:49:39 +0000 Subject: [PATCH] (trunk utils) #3302 "Scraping with transmission-show grabs /scrape without any GET parameters" -- fixed in trunk for 2.10. Thanks LolCol --- utils/show.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/utils/show.c b/utils/show.c index 8634154ee..ff4a79593 100644 --- a/utils/show.c +++ b/utils/show.c @@ -179,11 +179,17 @@ doScrape( const tr_info * inf ) CURL * curl; CURLcode res; struct evbuffer * buf; - const char * url = inf->trackers[i].scrape; + const char * scrape = inf->trackers[i].scrape; + char * url; - if( url == NULL ) + if( scrape == NULL ) continue; + url = tr_strdup_printf( "%s%cinfo_hash=%s", + scrape, + strchr( scrape, '?' ) ? '&' : '?', + inf->hashEscaped ); + printf( "%s ... ", url ); fflush( stdout ); @@ -244,8 +250,9 @@ doScrape( const tr_info * inf ) } } - evbuffer_free( buf ); curl_easy_cleanup( curl ); + evbuffer_free( buf ); + tr_free( url ); } }