Changeset 8454


Ignore:
Timestamp:
May 20, 2009, 5:35:41 PM (12 years ago)
Author:
charles
Message:

(trunk libT) possible fix for the slow startup reported by livings and Waldorf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/port-forwarding.c

    r8398 r8454  
    126126***/
    127127
    128 static void
    129 start_timer( tr_shared * s )
    130 {
    131     s->timer = tr_new0( struct event, 1 );
    132     evtimer_set( s->timer, onTimer, s );
    133     onTimer( 0, 0, s );
    134 }
    135 
    136128tr_shared *
    137129tr_sharedInit( tr_session  * session, tr_bool isEnabled )
     
    147139
    148140    if( isEnabled )
    149         start_timer( s );
     141    {
     142        struct timeval timeval;
     143        timeval.tv_sec = 0;
     144        timeval.tv_usec = 333000;
     145        s->timer = tr_new0( struct event, 1 );
     146        evtimer_set( s->timer, onTimer, s );
     147        evtimer_add( s->timer, &timeval );
     148    }
    150149
    151150    return s;
     
    184183}
    185184
     185static void
     186start_timer( tr_shared * s )
     187{
     188    s->timer = tr_new0( struct event, 1 );
     189    evtimer_set( s->timer, onTimer, s );
     190    onTimer( 0, 0, s );
     191}
     192
    186193void
    187194tr_sharedTraversalEnable( tr_shared * s, tr_bool isEnabled )
Note: See TracChangeset for help on using the changeset viewer.