Changeset 12604


Ignore:
Timestamp:
Jul 30, 2011, 10:40:15 PM (10 years ago)
Author:
jordan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer-http.c

    r12391 r12604  
    212212        if( getenv( "TR_CURL_VERBOSE" ) != NULL )
    213213        {
    214             struct evbuffer * buf = tr_bencToBuf( &benc, TR_FMT_JSON );
    215             fprintf( stderr, "Announce response:\n< %s\n", evbuffer_pullup( buf, -1 ) );
    216             tr_free( buf );
     214            if( !benc_loaded )
     215                fprintf( stderr, "%s", "Announce response was not in benc format\n" );
     216            else {
     217                int i, len;
     218                char * str = tr_bencToStr( &benc, TR_FMT_JSON, &len );
     219                fprintf( stderr, "%s", "Announce response:\n< " );
     220                for( i=0; i<len; ++i )
     221                    fputc( str[i], stderr );
     222                fputc( '\n', stderr );
     223                tr_free( str );
     224            }
    217225        }
    218226
Note: See TracChangeset for help on using the changeset viewer.