Ignore:
Timestamp:
Mar 17, 2011, 12:45:29 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) move tr_lpdAnnounceMore() out of the announcer module

We can stop local peer discovery immediately during shutdown, but need to leave the announcer running for the event=stopped messages. So it doesn't make sense to keep them on the same periodic timer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r12181 r12182  
    610610    tr_torrent * tor = NULL;
    611611    tr_session * session = vsession;
     612    const time_t now = time( NULL );
    612613
    613614    assert( tr_isSession( session ) );
     
    618619    **/
    619620
    620     tr_timeUpdate( time( NULL ) );
     621    tr_timeUpdate( now );
    621622
    622623    tr_dhtUpkeep( session );
     624
     625    /* lpd upkeep */
     626    if( session->lpdUpkeepAt <= now ) {
     627        const int LPD_UPKEEP_INTERVAL_SECS = 5;
     628        session->lpdUpkeepAt = now + LPD_UPKEEP_INTERVAL_SECS;
     629        tr_lpdAnnounceMore( now, LPD_UPKEEP_INTERVAL_SECS );
     630    }
    623631
    624632    if( session->turtle.isClockEnabled )
Note: See TracChangeset for help on using the changeset viewer.