mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(trunk libT) #4502 "allow verbose scrape" -- patch by reardon.
This commit is contained in:
parent
d981f944f3
commit
246d6a72a3
1 changed files with 16 additions and 0 deletions
|
@ -359,6 +359,22 @@ on_scrape_done( tr_session * session,
|
|||
tr_benc * files;
|
||||
const char * str;
|
||||
const int benc_loaded = !tr_bencLoad( msg, msglen, &top, NULL );
|
||||
|
||||
if( getenv( "TR_CURL_VERBOSE" ) != NULL )
|
||||
{
|
||||
if( !benc_loaded )
|
||||
fprintf( stderr, "%s", "Scrape response was not in benc format\n" );
|
||||
else {
|
||||
int i, len;
|
||||
char * str = tr_bencToStr( &top, TR_FMT_JSON, &len );
|
||||
fprintf( stderr, "%s", "Scrape response:\n< " );
|
||||
for( i=0; i<len; ++i )
|
||||
fputc( str[i], stderr );
|
||||
fputc( '\n', stderr );
|
||||
tr_free( str );
|
||||
}
|
||||
}
|
||||
|
||||
if( benc_loaded )
|
||||
{
|
||||
if( tr_bencDictFindStr( &top, "failure reason", &str ) )
|
||||
|
|
Loading…
Reference in a new issue