Browse Source

Exclude empty torrents from full scrape, also try to shrink full scrape buffer after it is full

dynamic-accesslists
erdgeist 17 years ago
parent
commit
28d88e3380
  1. 1
      opentracker.c
  2. 8
      trackerlogic.c

1
opentracker.c

@ -374,6 +374,7 @@ SCRAPE_WORKAROUND: @@ -374,6 +374,7 @@ SCRAPE_WORKAROUND:
LOG_TO_STDERR( "scrp: %d.%d.%d.%d - FULL SCRAPE\n", h->ip[0], h->ip[1], h->ip[2], h->ip[3] );
if( !( reply_size = return_fullscrape_for_tracker( &reply ) ) ) HTTPERROR_500;
if( (c = realloc( reply, reply_size ) ) ) reply = c;
ot_overall_tcp_successfulannounces++;
return sendmallocdata( s, reply, reply_size );
}

8
trackerlogic.c

@ -325,9 +325,11 @@ size_t return_fullscrape_for_tracker( char **reply ) { @@ -325,9 +325,11 @@ size_t return_fullscrape_for_tracker( char **reply ) {
peers += peer_list->peers[k].size;
seeds += peer_list->seed_count[k];
}
*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 );
if( peers ) {
*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