diff options
author | erdgeist <> | 2007-10-19 23:15:13 +0000 |
---|---|---|
committer | erdgeist <> | 2007-10-19 23:15:13 +0000 |
commit | 8098adb48eb9d3409e6b569d30dfb4391e3224c2 (patch) | |
tree | f24013614979c4194a907caf5cb94566835f0fab /opentracker.c | |
parent | 84f8738b822b5e99f0757321c56bea948ac7e511 (diff) |
Be even more stupidistas-tolerant
Diffstat (limited to 'opentracker.c')
-rw-r--r-- | opentracker.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/opentracker.c b/opentracker.c index e375f72..7e06044 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -429,14 +429,17 @@ SCRAPE_WORKAROUND: | |||
429 | /****************************** | 429 | /****************************** |
430 | * A N N O U N C E * | 430 | * A N N O U N C E * |
431 | ******************************/ | 431 | ******************************/ |
432 | case 7: | ||
433 | if( byte_diff( data, 7, "announc" ) ) HTTPERROR_404; | ||
434 | goto ANNOUNCE_WORKAROUND; | ||
432 | case 8: | 435 | case 8: |
433 | if( byte_diff( data, 8, "announce" ) ) HTTPERROR_404; | 436 | if( byte_diff( data, 8, "announce" ) ) HTTPERROR_404; |
434 | 437 | ||
435 | /* This is to hack around stupid clients that send "announce ?info_hash" */ | ||
436 | if( !byte_diff( c, 2, " ?" ) ) c+=2; | ||
437 | |||
438 | ANNOUNCE_WORKAROUND: | 438 | ANNOUNCE_WORKAROUND: |
439 | 439 | ||
440 | /* This is to hack around stupid clients that send "announce ?info_hash" */ | ||
441 | if( !byte_diff( c+1, 5, "?info" ) ) c+=2; | ||
442 | |||
440 | OT_SETIP( &peer, ((struct http_data*)io_getcookie( s ) )->ip ); | 443 | OT_SETIP( &peer, ((struct http_data*)io_getcookie( s ) )->ip ); |
441 | OT_SETPORT( &peer, &port ); | 444 | OT_SETPORT( &peer, &port ); |
442 | OT_FLAG( &peer ) = 0; | 445 | OT_FLAG( &peer ) = 0; |