make full scrapes a bit faster, increase checkback time for udp

master
Dirk Engling 16 years ago
parent b82e06fc9b
commit eea5c628de
  1. 3
      opentracker.c
  2. 4
      trackerlogic.c

@ -608,7 +608,8 @@ static void handle_udp4( int64 serversocket ) {
/* Create fake packet to satisfy parser on the other end */
outpacket[0] = htonl( 1 );
outpacket[1] = inpacket[12/4];
outpacket[2] = outpacket[3] = outpacket[4] = 0;
outpacket[2] = OT_CLIENT_REQUEST_INTERVAL_RANDOM;
outpacket[3] = outpacket[4] = 0;
socket_send4( serversocket, static_outbuf, 20, remoteip, port );
} else {
torrent = add_peer_to_torrent( hash, &peer );

@ -347,7 +347,6 @@ size_t return_fullscrape_for_tracker( char **reply ) {
size_t torrent_count = 0, j;
int i, k;
char *r;
time_t time_now = NOW;
for( i=0; i<256; ++i ) {
ot_vector *torrents_list = &all_torrents[i];
@ -363,12 +362,11 @@ size_t return_fullscrape_for_tracker( char **reply ) {
ot_peerlist *peer_list = ( ((ot_torrent*)(torrents_list->data))[j] ).peer_list;
ot_hash *hash =&( ((ot_torrent*)(torrents_list->data))[j] ).hash;
size_t peers = 0, seeds = 0;
clean_peerlist( time_now, peer_list );
for( k=0; k<OT_POOLS_COUNT; ++k ) {
peers += peer_list->peers[k].size;
seeds += peer_list->seed_count[k];
}
memmove( r, "20:", 3 ); r+=3;
*r++='2'; *r++='0'; *r++=':';
memmove( r, hash, 20 ); r+=20;
r += sprintf( r, "d8:completei%zde10:downloadedi%zde10:incompletei%zdee", seeds, peer_list->downloaded, peers-seeds );
}

Loading…
Cancel
Save