Changeset 12858


Ignore:
Timestamp:
Sep 12, 2011, 8:40:09 PM (7 years ago)
Author:
jordan
Message:

remove two redundant variables from tr_webseed_task

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/webseed.c

    r12855 r12858  
    3030struct tr_webseed_task
    3131{
    32     tr_session         * session;
    3332    struct evbuffer    * content;
    3433    struct tr_webseed  * webseed;
     
    4140    struct tr_web_task * web_task;
    4241    long                 response_code;
    43     int                  torrent_id;
    4442};
    4543
     
    278276            /* run this in the webseed thread to avoid tampering with mutexes and to
    279277            not cost the web thread too much time */
    280             tr_runInEventThread( task->session, connection_succeeded, inf );
     278            tr_runInEventThread( w->session, connection_succeeded, inf );
    281279        }
    282280    }
     
    301299                                block_size * completed );
    302300
    303         tr_runInEventThread( task->session, write_block_func, b );
     301        tr_runInEventThread( w->session, write_block_func, b );
    304302        task->blocks_done += completed;
    305303    }
     
    362360            struct tr_webseed_task * task = tr_new( struct tr_webseed_task, 1 );
    363361            task->webseed = w;
    364             task->session = w->session;
    365             task->torrent_id = w->torrent_id;
    366362            task->block = b;
    367363            task->piece_index = tr_torBlockPiece( tor, b );
     
    394390    struct tr_webseed_task * t = vtask;
    395391    tr_webseed * w = t->webseed;
    396     tr_torrent * tor = tr_torrentFindFromId( session, t->torrent_id );
     392    tr_torrent * tor = tr_torrentFindFromId( session, w->torrent_id );
    397393    const int success = ( response_code == 206 );
    398394
     
    475471task_request_next_chunk( struct tr_webseed_task * t )
    476472{
    477     tr_torrent * tor = tr_torrentFindFromId( t->session, t->torrent_id );
     473    tr_webseed * w = t->webseed;
     474    tr_torrent * tor = tr_torrentFindFromId( w->session, w->torrent_id );
    478475    if( tor != NULL )
    479476    {
     
    506503        tr_snprintf( range, sizeof range, "%"PRIu64"-%"PRIu64,
    507504                     file_offset, file_offset + this_pass - 1 );
    508         t->web_task = tr_webRunWithBuffer( t->session, urls[file_index],
     505        t->web_task = tr_webRunWithBuffer( w->session, urls[file_index],
    509506                                           range, NULL, web_response_func, t, t->content );
    510507    }
Note: See TracChangeset for help on using the changeset viewer.