Ignore:
Timestamp:
Oct 29, 2009, 5:25:03 PM (13 years ago)
Author:
charles
Message:

(trunk libT) #2538 startup takes too long

File:
1 edited

Legend:

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

    r9387 r9437  
    9090
    9191static void
    92 onTimer( int fd UNUSED, short what UNUSED, void * vshared )
     92set_evtimer_from_status( tr_shared * s )
    9393{
    9494    int sec=0, msec=0;
    95     tr_shared * s = vshared;
    96 
    97     assert( s );
    98     assert( s->timer );
    99 
    100     /* do something */
    101     natPulse( s, s->doPortCheck );
    102     s->doPortCheck = FALSE;
    10395
    10496    /* when to wake up again */
     
    124116
    125117    tr_timerAdd( s->timer, sec, msec );
     118}
     119
     120static void
     121onTimer( int fd UNUSED, short what UNUSED, void * vshared )
     122{
     123    tr_shared * s = vshared;
     124
     125    assert( s );
     126    assert( s->timer );
     127
     128    /* do something */
     129    natPulse( s, s->doPortCheck );
     130    s->doPortCheck = FALSE;
     131
     132    /* set up the timer for the next pulse */
     133    set_evtimer_from_status( s );
    126134}
    127135
     
    191199    s->timer = tr_new0( struct event, 1 );
    192200    evtimer_set( s->timer, onTimer, s );
    193     onTimer( 0, 0, s );
     201    set_evtimer_from_status( s );
    194202}
    195203
Note: See TracChangeset for help on using the changeset viewer.