]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Be even more stupidistas-tolerant
authorerdgeist <>
Fri, 19 Oct 2007 23:15:13 +0000 (23:15 +0000)
committererdgeist <>
Fri, 19 Oct 2007 23:15:13 +0000 (23:15 +0000)
opentracker.c

index e375f7299a90fa9b659087dc9002a5127d6a8adc..7e060449460398efc1019e86ca115006049ac33e 100644 (file)
@@ -429,14 +429,17 @@ SCRAPE_WORKAROUND:
 /******************************
  *      A N N O U N C E       *
  ******************************/
+  case 7:
+    if( byte_diff( data, 7, "announc" ) ) HTTPERROR_404;
+    goto ANNOUNCE_WORKAROUND;
   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+=2;
-
 ANNOUNCE_WORKAROUND:
 
+    /* This is to hack around stupid clients that send "announce ?info_hash" */
+    if( !byte_diff( c+1, 5, "?info" ) ) c+=2;
+
     OT_SETIP( &peer, ((struct http_data*)io_getcookie( s ) )->ip );
     OT_SETPORT( &peer, &port );
     OT_FLAG( &peer ) = 0;