diff options
author | erdgeist <> | 2009-06-17 15:06:31 +0000 |
---|---|---|
committer | erdgeist <> | 2009-06-17 15:06:31 +0000 |
commit | 65d7d9b89cc44b85d5ef8522276f04c53846acf2 (patch) | |
tree | d45907fdefb44d0525ffe7512fe63ea93eb41d51 /ot_http.c | |
parent | 2a17f847aeb948d1f788b3454fa66b905ba2f28a (diff) |
Allow /stats to be located anywhere in your trackers path
Diffstat (limited to 'ot_http.c')
-rw-r--r-- | ot_http.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -30,6 +30,9 @@ | |||
30 | #define OT_MAXMULTISCRAPE_COUNT 64 | 30 | #define OT_MAXMULTISCRAPE_COUNT 64 |
31 | extern char *g_redirecturl; | 31 | extern char *g_redirecturl; |
32 | 32 | ||
33 | char *g_stats_path; | ||
34 | ssize_t g_stats_path_len; | ||
35 | |||
33 | enum { | 36 | enum { |
34 | SUCCESS_HTTP_HEADER_LENGTH = 80, | 37 | SUCCESS_HTTP_HEADER_LENGTH = 80, |
35 | SUCCESS_HTTP_HEADER_LENGTH_CONTENT_ENCODING = 32, | 38 | SUCCESS_HTTP_HEADER_LENGTH_CONTENT_ENCODING = 32, |
@@ -472,7 +475,7 @@ ssize_t http_handle_request( const int64 sock, struct ot_workstruct *ws ) { | |||
472 | else if( !memcmp( write_ptr, "sc", 2 ) ) | 475 | else if( !memcmp( write_ptr, "sc", 2 ) ) |
473 | http_handle_scrape( sock, ws, read_ptr ); | 476 | http_handle_scrape( sock, ws, read_ptr ); |
474 | /* All the rest is matched the standard way */ | 477 | /* All the rest is matched the standard way */ |
475 | else if( !memcmp( write_ptr, "stats", 5) ) | 478 | else if( len == g_stats_path_len && !memcmp( write_ptr, g_stats_path, len ) ) |
476 | http_handle_stats( sock, ws, read_ptr ); | 479 | http_handle_stats( sock, ws, read_ptr ); |
477 | else | 480 | else |
478 | HTTPERROR_404; | 481 | HTTPERROR_404; |