1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

(trunk libT) improve the debugging message that logs an http announce response

This commit is contained in:
Jordan Lee 2011-07-30 22:40:15 +00:00
parent cdb95995e8
commit 0bffa36377

View file

@ -211,9 +211,17 @@ on_announce_done( tr_session * session,
if( getenv( "TR_CURL_VERBOSE" ) != NULL )
{
struct evbuffer * buf = tr_bencToBuf( &benc, TR_FMT_JSON );
fprintf( stderr, "Announce response:\n< %s\n", evbuffer_pullup( buf, -1 ) );
tr_free( buf );
if( !benc_loaded )
fprintf( stderr, "%s", "Announce response was not in benc format\n" );
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 ) )