Lines Matching refs:announcer
10 * $Id: announcer.c 13313 2012-05-22 20:21:00Z jordan $
25 #include "announcer.h"
26 #include "announcer-common.h"
150 tr_announcerHasBacklog( const struct tr_announcer * announcer )
152 return announcer->slotsAvailable < 1;
173 session->announcer = a;
176 static void flushCloseMessages( tr_announcer * announcer );
181 tr_announcer * announcer = session->announcer;
183 flushCloseMessages( announcer );
187 event_free( announcer->upkeepTimer );
188 announcer->upkeepTimer = NULL;
190 tr_ptrArrayDestruct( &announcer->stops, NULL );
192 session->announcer = NULL;
193 tr_free( announcer );
437 getTier( tr_announcer * announcer, const uint8_t * info_hash, int tierId )
441 if( announcer != NULL )
443 tr_session * session = announcer->session;
901 announce_request_new( const tr_announcer * announcer,
907 req->port = tr_sessionGetPublicPeerPort( announcer->session );
920 req->key = announcer->key;
929 tr_announcerRemoveTorrent( tr_announcer * announcer, tr_torrent * tor )
942 tr_announce_request * req = announce_request_new( announcer, tor, tier, e );
944 if( tr_ptrArrayFindSorted( &announcer->stops, req, compareStops ) != NULL )
947 tr_ptrArrayInsertSorted( &announcer->stops, req, compareStops );
1012 tr_announcer * announcer = data->session->announcer;
1013 tr_tier * tier = getTier( announcer, response->info_hash, data->tierId );
1017 if( announcer )
1018 ++announcer->slotsAvailable;
1151 tier->scrapeAt = get_next_scrape_time( announcer->session, tier, tier->scrapeIntervalSec );
1157 tier->scrapeAt = get_next_scrape_time( announcer->session, tier, 0 );
1196 announce_request_delegate( tr_announcer * announcer,
1201 tr_session * session = announcer->session;
1214 tierAnnounce( tr_announcer * announcer, tr_tier * tier )
1226 req = announce_request_new( announcer, tor, tier, announce_event );
1229 data->session = announcer->session;
1237 --announcer->slotsAvailable;
1239 announce_request_delegate( announcer, req, on_announce_done, data );
1294 tr_announcer * announcer = session->announcer;
1370 if( announcer )
1371 ++announcer->slotsAvailable;
1375 scrape_request_delegate( tr_announcer * announcer,
1380 tr_session * session = announcer->session;
1391 multiscrape( tr_announcer * announcer, tr_ptrArray * tiers )
1397 const int max_request_count = MIN( announcer->slotsAvailable, tier_count );
1439 scrape_request_delegate( announcer, &requests[i], on_scrape_done, announcer->session );
1446 flushCloseMessages( tr_announcer * announcer )
1449 const int n = tr_ptrArraySize( &announcer->stops );
1452 announce_request_delegate( announcer, tr_ptrArrayNth( &announcer->stops, i ), NULL, NULL );
1454 tr_ptrArrayClear( &announcer->stops );
1496 announceMore( tr_announcer * announcer )
1505 dbgmsg( NULL, "announceMore: slotsAvailable is %d", announcer->slotsAvailable );
1507 if( announcer->slotsAvailable < 1 )
1512 while(( tor = tr_torrentNext( announcer->session, tor ))) {
1525 if( n > announcer->slotsAvailable )
1529 n = MIN( tr_ptrArraySize( &announceMe ), announcer->slotsAvailable );
1534 tierAnnounce( announcer, tier );
1538 multiscrape( announcer, &scrapeMe );
1548 tr_announcer * announcer = vannouncer;
1549 tr_session * session = announcer->session;
1556 flushCloseMessages( announcer );
1560 announceMore( announcer );
1563 if( announcer->tauUpkeepAt <= now ) {
1564 announcer->tauUpkeepAt = now + TAU_UPKEEP_INTERVAL_SECS;
1569 tr_timerAdd( announcer->upkeepTimer, UPKEEP_INTERVAL_SECS, 0 );
1731 tr_announcerResetTorrent( tr_announcer * announcer UNUSED, tr_torrent * tor )