Changeset 12909


Ignore:
Timestamp:
Sep 24, 2011, 5:54:47 AM (10 years ago)
Author:
jordan
Message:

(trunk libT) #4502 "allow verbose scrape" -- patch by reardon.

File:
1 edited

Legend:

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

    r12604 r12909  
    360360        const char * str;
    361361        const int benc_loaded = !tr_bencLoad( msg, msglen, &top, NULL );
     362       
     363        if( getenv( "TR_CURL_VERBOSE" ) != NULL )
     364        {
     365            if( !benc_loaded )
     366                fprintf( stderr, "%s", "Scrape response was not in benc format\n" );
     367            else {
     368                int i, len;
     369                char * str = tr_bencToStr( &top, TR_FMT_JSON, &len );
     370                fprintf( stderr, "%s", "Scrape response:\n< " );
     371                for( i=0; i<len; ++i )
     372                    fputc( str[i], stderr );
     373                fputc( '\n', stderr );
     374                tr_free( str );
     375            }
     376        }
     377       
    362378        if( benc_loaded )
    363379        {
Note: See TracChangeset for help on using the changeset viewer.