Changeset 7752


Ignore:
Timestamp:
Jan 19, 2009, 9:37:34 PM (12 years ago)
Author:
charles
Message:

(trunk libT) fix two bugs introduced yesterday's add-torrent changes and uncovered/reported by anf6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpcimpl.c

    r7751 r7752  
    928928              void                   * callback_user_data )
    929929{
    930     int64_t      i;
     930    int i;
    931931    const char * str;
    932     tr_benc *    args_in = tr_bencDictFind( request, "arguments" );
     932    tr_benc * args_in = tr_bencDictFind( request, "arguments" );
    933933    const char * result = NULL;
    934934
     
    948948    if( result != NULL )
    949949    {
     950        int64_t tag;
    950951        tr_benc response;
    951952        struct evbuffer * buf = tr_getBuffer( );
     
    954955        tr_bencDictAddDict( &response, "arguments", 0 );
    955956        tr_bencDictAddStr( &response, "result", result );
    956         if( tr_bencDictFindInt( request, "tag", &i ) )
    957             tr_bencDictAddInt( &response, "tag", i );
     957        if( tr_bencDictFindInt( request, "tag", &tag ) )
     958            tr_bencDictAddInt( &response, "tag", tag );
    958959        tr_bencSaveAsJSON( &response, buf );
    959960        (*callback)( session, (const char*)EVBUFFER_DATA(buf),
     
    966967    if( methods[i].immediate )
    967968    {
     969        int64_t tag;
    968970        tr_benc response;
    969971        tr_benc * args_out;
     
    976978            result = "success";
    977979        tr_bencDictAddStr( &response, "result", result );
    978         if( tr_bencDictFindInt( request, "tag", &i ) )
    979             tr_bencDictAddInt( &response, "tag", i );
     980        if( tr_bencDictFindInt( request, "tag", &tag ) )
     981            tr_bencDictAddInt( &response, "tag", tag );
    980982        tr_bencSaveAsJSON( &response, buf );
    981983        (*callback)( session, (const char*)EVBUFFER_DATA(buf),
     
    987989    else
    988990    {
     991        int64_t tag;
    989992        struct tr_rpc_idle_data * data = tr_new0( struct tr_rpc_idle_data, 1 );
    990993        data->session = session;
    991994        data->response = tr_new0( tr_benc, 1 );
    992         if( tr_bencDictFindInt( request, "tag", &i ) )
    993             tr_bencDictAddInt( data->response, "tag", i );
    994995        tr_bencInitDict( data->response, 3 );
     996        if( tr_bencDictFindInt( request, "tag", &tag ) )
     997            tr_bencDictAddInt( data->response, "tag", tag );
    995998        data->args_out = tr_bencDictAddDict( data->response, "arguments", 0 );
    996999        data->callback = callback;
Note: See TracChangeset for help on using the changeset viewer.