diff options
| -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; |
