]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
This uTorrent/1600 client requires some... measures :/ I dont like the workaround.
authorerdgeist <>
Tue, 23 Oct 2007 00:01:10 +0000 (00:01 +0000)
committererdgeist <>
Tue, 23 Oct 2007 00:01:10 +0000 (00:01 +0000)
opentracker.c

index 65c9c933242f79cbfde7d588514bae569d427af0..68d7a2e9e481a46f9269ec697bf2beaab5f35e80 100644 (file)
@@ -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;