summaryrefslogtreecommitdiff
path: root/ot_http.c
diff options
context:
space:
mode:
authorerdgeist <>2009-06-17 15:06:31 +0000
committererdgeist <>2009-06-17 15:06:31 +0000
commit65d7d9b89cc44b85d5ef8522276f04c53846acf2 (patch)
treed45907fdefb44d0525ffe7512fe63ea93eb41d51 /ot_http.c
parent2a17f847aeb948d1f788b3454fa66b905ba2f28a (diff)
Allow /stats to be located anywhere in your trackers path
Diffstat (limited to 'ot_http.c')
-rw-r--r--ot_http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ot_http.c b/ot_http.c
index 7d78fec..7640676 100644
--- a/ot_http.c
+++ b/ot_http.c
@@ -30,6 +30,9 @@
30#define OT_MAXMULTISCRAPE_COUNT 64 30#define OT_MAXMULTISCRAPE_COUNT 64
31extern char *g_redirecturl; 31extern char *g_redirecturl;
32 32
33char *g_stats_path;
34ssize_t g_stats_path_len;
35
33enum { 36enum {
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;