case 6: /* scrape ? */
if( byte_diff( data, 6, "scrape") ) HTTPERROR_404;
+ /* This is to hack around stupid clients that just replace
+ "announce ?info_hash" with "scrape ?info_hash".
+ We do not want to bomb them with full scrapes */
+ if( !byte_diff( c, 2, " ?" ) ) ++c;
+
SCRAPE_WORKAROUND:
scanon = 1;
case 8:
if( byte_diff( data, 8, "announce" ) ) HTTPERROR_404;
+ /* This is to hack around stupid clients that send "announce ?info_hash" */
+ if( !byte_diff( c, 2, " ?" ) ) ++c;
+
ANNOUNCE_WORKAROUND:
OT_SETIP( &peer, ((struct http_data*)io_getcookie( s ) )->ip );