summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opentracker.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/opentracker.c b/opentracker.c
index 191d5d6..1725cd2 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -372,6 +372,11 @@ LOG_TO_STDERR( "stats: %d.%d.%d.%d - mode: s24s old\n", h->ip[0], h->ip[1], h->i
372 case 6: /* scrape ? */ 372 case 6: /* scrape ? */
373 if( byte_diff( data, 6, "scrape") ) HTTPERROR_404; 373 if( byte_diff( data, 6, "scrape") ) HTTPERROR_404;
374 374
375 /* This is to hack around stupid clients that just replace
376 "announce ?info_hash" with "scrape ?info_hash".
377 We do not want to bomb them with full scrapes */
378 if( !byte_diff( c, 2, " ?" ) ) ++c;
379
375SCRAPE_WORKAROUND: 380SCRAPE_WORKAROUND:
376 381
377 scanon = 1; 382 scanon = 1;
@@ -414,6 +419,9 @@ write( 2, "\n", 1 );
414 case 8: 419 case 8:
415 if( byte_diff( data, 8, "announce" ) ) HTTPERROR_404; 420 if( byte_diff( data, 8, "announce" ) ) HTTPERROR_404;
416 421
422 /* This is to hack around stupid clients that send "announce ?info_hash" */
423 if( !byte_diff( c, 2, " ?" ) ) ++c;
424
417ANNOUNCE_WORKAROUND: 425ANNOUNCE_WORKAROUND:
418 426
419 OT_SETIP( &peer, ((struct http_data*)io_getcookie( s ) )->ip ); 427 OT_SETIP( &peer, ((struct http_data*)io_getcookie( s ) )->ip );