From 69c6e2bc9909bdeef41cba66049c1550d6dad8fe Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Tue, 23 Oct 2007 00:01:10 +0000 Subject: This uTorrent/1600 client requires some... measures :/ I dont like the workaround. --- opentracker.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/opentracker.c b/opentracker.c index 65c9c93..68d7a2e 100644 --- a/opentracker.c +++ b/opentracker.c @@ -420,18 +420,23 @@ SCRAPE_WORKAROUND: continue; } /* ignore this, when we have less than 20 bytes */ - if( scan_urlencoded_query( &c, data = c, SCAN_SEARCHPATH_VALUE ) < (ssize_t)sizeof(ot_hash) ) HTTPERROR_400_PARAM; + if( scan_urlencoded_query( &c, data = c, SCAN_SEARCHPATH_VALUE ) != (ssize_t)sizeof(ot_hash) ) { +#ifdef WANT_UTORRENT1600_WORKAROUND + if( data[20] != '?' ) +#endif + HTTPERROR_400_PARAM; + } if( scrape_count < OT_MAXMULTISCRAPE_COUNT ) memmove( multiscrape_buf + scrape_count++, data, sizeof(ot_hash) ); break; } } +UTORRENT1600_WORKAROUND: + /* No info_hash found? Inform user */ if( !scrape_count ) HTTPERROR_400_PARAM; -UTORRENT1600_WORKAROUND: - /* Enough for http header + whole scrape string */ if( !( reply_size = return_tcp_scrape_for_torrent( multiscrape_buf, scrape_count, SUCCESS_HTTP_HEADER_LENGTH + static_outbuf ) ) ) HTTPERROR_500; -- cgit v1.2.3