Changeset 10535


Ignore:
Timestamp:
Apr 28, 2010, 12:32:43 AM (11 years ago)
Author:
charles
Message:

(trunk libT) #3117 "Tracker queries do not honor bind-address-ipv4" -- possible fix

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r10511 r10535  
    719719    b.socket = -1;
    720720    session->public_ipv4 = tr_memdup( &b, sizeof( struct tr_bindinfo ) );
    721     tr_webSetInterface( session, &session->public_ipv4->addr );
    722721
    723722    str = TR_PREFS_KEY_BIND_ADDRESS_IPV6;
  • trunk/libtransmission/web.c

    r10484 r10535  
    5656{
    5757    int close_mode;
    58     tr_bool haveAddr;
    5958    tr_list * tasks;
    6059    tr_lock * taskLock;
    61     tr_address addr;
    6260};
    6361
     
    140138
    141139static CURL *
    142 createEasy( tr_session * s, struct tr_web * w, struct tr_web_task * task )
    143 {
     140createEasy( tr_session * s, struct tr_web_task * task )
     141{
     142    const tr_address * addr;
    144143    CURL * e = curl_easy_init( );
    145144    const long verbose = getenv( "TR_CURL_VERBOSE" ) != NULL;
     
    178177    curl_easy_setopt( e, CURLOPT_WRITEDATA, task );
    179178    curl_easy_setopt( e, CURLOPT_WRITEFUNCTION, writeFunc );
    180     if( w->haveAddr )
    181         curl_easy_setopt( e, CURLOPT_INTERFACE, tr_ntop_non_ts( &w->addr ) );
     179
     180    if(( addr = tr_sessionGetPublicAddress( s, TR_AF_INET )))
     181        curl_easy_setopt( e, CURLOPT_INTERFACE, tr_ntop_non_ts( addr ) );
     182
    182183    if( task->range )
    183184        curl_easy_setopt( e, CURLOPT_RANGE, task->range );
     
    236237}
    237238
    238 void
    239 tr_webSetInterface( tr_session * session, const tr_address * addr )
    240 {
    241     struct tr_web * web = session->web;
    242 
    243     if( web != NULL )
    244         if(( web->haveAddr = ( addr != NULL )))
    245             web->addr = *addr;
    246 }
    247 
    248239static void
    249240tr_webThreadFunc( void * vsession )
     
    283274        while(( task = tr_list_pop_front( &web->tasks )))
    284275        {
    285             curl_multi_add_handle( multi, createEasy( session, web, task ));
     276            curl_multi_add_handle( multi, createEasy( session, task ));
    286277            /*fprintf( stderr, "adding a task.. taskCount is now %d\n", taskCount );*/
    287278            ++taskCount;
  • trunk/libtransmission/web.h

    r10303 r10535  
    2727void tr_webClose( tr_session * session, tr_web_close_mode close_mode );
    2828
    29 void tr_webSetInterface( tr_session * session, const struct tr_address * addr );
    30 
    3129typedef void ( tr_web_done_func )( tr_session       * session,
    3230                                   long               response_code,
Note: See TracChangeset for help on using the changeset viewer.