Ignore:
Timestamp:
Apr 27, 2011, 9:22:08 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) tweak the ABI of tr_bencToBuf() to match the way it's being used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpcimpl.c

    r12248 r12391  
    9595tr_idle_function_done( struct tr_rpc_idle_data * data, const char * result )
    9696{
    97     struct evbuffer * buf = evbuffer_new( );
     97    struct evbuffer * buf;
    9898
    9999    if( result == NULL )
     
    101101    tr_bencDictAddStr( data->response, "result", result );
    102102
    103     tr_bencToBuf( data->response, TR_FMT_JSON_LEAN, buf );
     103    buf = tr_bencToBuf( data->response, TR_FMT_JSON_LEAN );
    104104    (*data->callback)( data->session, buf, data->callback_user_data );
    105 
    106105    evbuffer_free( buf );
     106
    107107    tr_bencFree( data->response );
    108108    tr_free( data->response );
     
    17161716        int64_t tag;
    17171717        tr_benc response;
    1718         struct evbuffer * buf = evbuffer_new( );
     1718        struct evbuffer * buf;
    17191719
    17201720        tr_bencInitDict( &response, 3 );
     
    17231723        if( tr_bencDictFindInt( request, "tag", &tag ) )
    17241724            tr_bencDictAddInt( &response, "tag", tag );
    1725         tr_bencToBuf( &response, TR_FMT_JSON_LEAN, buf );
     1725
     1726        buf = tr_bencToBuf( &response, TR_FMT_JSON_LEAN );
    17261727        (*callback)( session, buf, callback_user_data );
    1727 
    17281728        evbuffer_free( buf );
     1729
    17291730        tr_bencFree( &response );
    17301731    }
     
    17341735        tr_benc response;
    17351736        tr_benc * args_out;
    1736         struct evbuffer * buf = evbuffer_new( );
     1737        struct evbuffer * buf;
    17371738
    17381739        tr_bencInitDict( &response, 3 );
     
    17441745        if( tr_bencDictFindInt( request, "tag", &tag ) )
    17451746            tr_bencDictAddInt( &response, "tag", tag );
    1746         tr_bencToBuf( &response, TR_FMT_JSON_LEAN, buf );
     1747
     1748        buf = tr_bencToBuf( &response, TR_FMT_JSON_LEAN );
    17471749        (*callback)( session, buf, callback_user_data );
    1748 
    17491750        evbuffer_free( buf );
     1751
    17501752        tr_bencFree( &response );
    17511753    }
Note: See TracChangeset for help on using the changeset viewer.