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