From: Jordan Lee Date: Sat, 30 Jul 2011 22:40:15 +0000 (+0000) Subject: (trunk libT) improve the debugging message that logs an http announce response X-Git-Tag: 2.40b1~301 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bffa36377cac082d33181b065bc6490c888825e;p=transmission (trunk libT) improve the debugging message that logs an http announce response --- diff --git a/libtransmission/announcer-http.c b/libtransmission/announcer-http.c index 241b881d4..33b82565c 100644 --- a/libtransmission/announcer-http.c +++ b/libtransmission/announcer-http.c @@ -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