mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk libT) improve the debugging message that logs an http announce response
This commit is contained in:
parent
cdb95995e8
commit
0bffa36377
1 changed files with 11 additions and 3 deletions
|
@ -211,9 +211,17 @@ on_announce_done( tr_session * session,
|
||||||
|
|
||||||
if( getenv( "TR_CURL_VERBOSE" ) != NULL )
|
if( getenv( "TR_CURL_VERBOSE" ) != NULL )
|
||||||
{
|
{
|
||||||
struct evbuffer * buf = tr_bencToBuf( &benc, TR_FMT_JSON );
|
if( !benc_loaded )
|
||||||
fprintf( stderr, "Announce response:\n< %s\n", evbuffer_pullup( buf, -1 ) );
|
fprintf( stderr, "%s", "Announce response was not in benc format\n" );
|
||||||
tr_free( buf );
|
else {
|
||||||
|
int i, len;
|
||||||
|
char * str = tr_bencToStr( &benc, TR_FMT_JSON, &len );
|
||||||
|
fprintf( stderr, "%s", "Announce response:\n< " );
|
||||||
|
for( i=0; i<len; ++i )
|
||||||
|
fputc( str[i], stderr );
|
||||||
|
fputc( '\n', stderr );
|
||||||
|
tr_free( str );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( benc_loaded && tr_bencIsDict( &benc ) )
|
if( benc_loaded && tr_bencIsDict( &benc ) )
|
||||||
|
|
Loading…
Reference in a new issue