Ignore:
Timestamp:
Apr 27, 2011, 8:50:43 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) heap pruning: using the same mechanism as in r12388, avoid an unnecessary malloc+memcpy+free when TR_CURL_VERBOSE is logging HTTP messages

File:
1 edited

Legend:

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

    r12388 r12389  
    212212        if( getenv( "TR_CURL_VERBOSE" ) != NULL )
    213213        {
    214             char * str = tr_bencToStr( &benc, TR_FMT_JSON, NULL );
    215             fprintf( stderr, "Announce response:\n< %s\n", str );
    216             tr_free( str );
     214            struct evbuffer * buf = evbuffer_new( );
     215            tr_bencToBuf( &benc, TR_FMT_JSON, buf );
     216            fprintf( stderr, "Announce response:\n< %s\n", evbuffer_pullup( buf, -1 ) );
     217            tr_free( buf );
    217218        }
    218219
Note: See TracChangeset for help on using the changeset viewer.