#include "peer-mgr.h" /* tr_peerMgrCompactToPex() */
#include "ptrarray.h"
#include "session.h"
-#include "tr-lpd.h"
#include "torrent.h"
#include "utils.h"
UPKEEP_INTERVAL_SECS = 1,
- /* this is an upper limit for the frequency of LDS announces */
- LPD_HOUSEKEEPING_INTERVAL_SECS = 5,
-
/* this is how often to call the UDP tracker upkeep */
TAU_UPKEEP_INTERVAL_SECS = 5
};
/* maybe send out some announcements to trackers */
announceMore( announcer );
- /* LPD upkeep */
- if( announcer->lpdUpkeepAt <= now ) {
- const int seconds = LPD_HOUSEKEEPING_INTERVAL_SECS;
- announcer->lpdUpkeepAt = now + jitterize( seconds );
- tr_lpdAnnounceMore( now, seconds );
- }
-
/* TAU upkeep */
if( announcer->tauUpkeepAt <= now ) {
announcer->tauUpkeepAt = now + TAU_UPKEEP_INTERVAL_SECS;
struct timeval tv;
tr_torrent * tor = NULL;
tr_session * session = vsession;
+ const time_t now = time( NULL );
assert( tr_isSession( session ) );
assert( session->nowTimer != NULL );
*** tr_session things to do once per second
**/
- tr_timeUpdate( time( NULL ) );
+ tr_timeUpdate( now );
tr_dhtUpkeep( session );
+ /* lpd upkeep */
+ if( session->lpdUpkeepAt <= now ) {
+ const int LPD_UPKEEP_INTERVAL_SECS = 5;
+ session->lpdUpkeepAt = now + LPD_UPKEEP_INTERVAL_SECS;
+ tr_lpdAnnounceMore( now, LPD_UPKEEP_INTERVAL_SECS );
+ }
+
if( session->turtle.isClockEnabled )
turtleCheckClock( session, &session->turtle );