From 17c21a0bc4394ac6f0649b4b9c535554a0d8ace0 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Sat, 6 Jan 2007 22:24:09 +0000 Subject: Apply some limits --- opentracker.c | 1 + trackerlogic.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/opentracker.c b/opentracker.c index b7c1f6a..124bedc 100644 --- a/opentracker.c +++ b/opentracker.c @@ -233,6 +233,7 @@ e400: if(!byte_diff(data,7,"numwant")) { size_t len = scan_urlencoded_query( &c, data = c, SCAN_SEARCHPATH_VALUE ); if( ( len <= 0 ) || scan_fixed_int( data, len, &numwant ) ) goto e404; + if( numwant > 200 ) numwant = 200; } else if(!byte_diff(data,7,"compact")) { size_t len = scan_urlencoded_query( &c, data = c, SCAN_SEARCHPATH_VALUE ); if( ( len <= 0 ) || scan_fixed_int( data, len, &tmp ) ) goto e404; diff --git a/trackerlogic.c b/trackerlogic.c index 9165fb7..c69da43 100644 --- a/trackerlogic.c +++ b/trackerlogic.c @@ -246,7 +246,7 @@ size_t return_peers_for_torrent( ot_torrent *torrent, unsigned long amount, char } if( peer_count < amount ) amount = peer_count; - r += FORMAT_FORMAT_STRING( r, "d8:completei%lie10:incompletei%lie8:intervali60e5:peers%li:", seed_count, peer_count-seed_count, 6*amount ); + r += FORMAT_FORMAT_STRING( r, "d8:completei%lie10:incompletei%lie8:intervali600e5:peers%li:", seed_count, peer_count-seed_count, 6*amount ); for( index = 0; index < amount; ++index ) { double step = 1.8*((double)( peer_count - wert - 1 ))/((double)( amount - index )); int off = random() % (int)floor( step ); -- cgit v1.2.3