Changeset 9389


Ignore:
Timestamp:
Oct 23, 2009, 5:48:56 AM (9 years ago)
Author:
charles
Message:

(trunk) fix r9380 #2412 timing issue

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r9388 r9389  
    689689    tr_statsInit( session );
    690690
    691     session->web = tr_webInit( session, &session->public_ipv4->addr );
     691    session->web = tr_webInit( session );
    692692    --session->waiting;
    693693
     
    795795    b.socket = -1;
    796796    session->public_ipv4 = tr_memdup( &b, sizeof( struct tr_bindinfo ) );
     797    tr_webSetInterface( session->web, &session->public_ipv4->addr );
    797798
    798799    str = TR_PREFS_KEY_BIND_ADDRESS_IPV6;
  • trunk/libtransmission/web.c

    r9380 r9389  
    8787    CURLM * multi;
    8888    tr_session * session;
    89     const tr_address * addr;
     89    tr_bool haveAddr;
     90    tr_address addr;
    9091    struct event timer_event;
    9192    tr_list * fds;
     
    238239        curl_easy_setopt( easy, CURLOPT_VERBOSE,
    239240                                       getenv( "TR_CURL_VERBOSE" ) != NULL );
    240         curl_easy_setopt( easy, CURLOPT_INTERFACE, tr_ntop_non_ts( web->addr ) );
     241        if( web->haveAddr )
     242            curl_easy_setopt( easy, CURLOPT_INTERFACE, tr_ntop_non_ts( &web->addr ) );
    241243        curl_easy_setopt( easy, CURLOPT_WRITEDATA, task );
    242244        curl_easy_setopt( easy, CURLOPT_WRITEFUNCTION, writeFunc );
     
    524526}
    525527
     528void
     529tr_webSetInterface( tr_web * web, const tr_address * addr )
     530{
     531    if(( web->haveAddr = ( addr != NULL )))
     532        web->addr = *addr;
     533}
     534
    526535tr_web*
    527 tr_webInit( tr_session * session, const struct tr_address * addr )
     536tr_webInit( tr_session * session )
    528537{
    529538    CURLMcode mcode;
     
    543552    web->multi = curl_multi_init( );
    544553    web->session = session;
    545     web->addr = addr;
    546554    web->timer_ms = DEFAULT_TIMER_MSEC; /* overwritten by multi_timer_cb() */
    547555
  • trunk/libtransmission/web.h

    r9387 r9389  
    1717typedef struct tr_web tr_web;
    1818
    19 tr_web*      tr_webInit( tr_session                * session,
    20                          const struct tr_address   * addr );
     19tr_web*      tr_webInit( tr_session * session );
    2120
    2221void         tr_webClose( tr_web ** );
     22
     23void         tr_webSetInterface( tr_web * web, const struct tr_address * addr );
    2324
    2425typedef void ( tr_web_done_func )( tr_session       * session,
Note: See TracChangeset for help on using the changeset viewer.