diff options
Diffstat (limited to 'ot_http.c')
| -rw-r--r-- | ot_http.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -37,9 +37,9 @@ | |||
| 37 | 37 | ||
| 38 | #define OT_MAXMULTISCRAPE_COUNT 64 | 38 | #define OT_MAXMULTISCRAPE_COUNT 64 |
| 39 | #define OT_BATCH_LIMIT (1024 * 1024 * 16) | 39 | #define OT_BATCH_LIMIT (1024 * 1024 * 16) |
| 40 | extern char *g_redirecturl; | 40 | extern const char *g_redirecturl; |
| 41 | 41 | ||
| 42 | char *g_stats_path; | 42 | const char *g_stats_path; |
| 43 | ssize_t g_stats_path_len; | 43 | ssize_t g_stats_path_len; |
| 44 | 44 | ||
| 45 | enum { SUCCESS_HTTP_HEADER_LENGTH = 80, SUCCESS_HTTP_SIZE_OFF = 17 }; | 45 | enum { SUCCESS_HTTP_HEADER_LENGTH = 80, SUCCESS_HTTP_SIZE_OFF = 17 }; |
| @@ -125,9 +125,9 @@ static void http_senddata(const int64_t sock, struct ot_workstruct *ws) { | |||
| 125 | #define HTTPERROR_404 return http_issue_error(sock, ws, CODE_HTTPERROR_404) | 125 | #define HTTPERROR_404 return http_issue_error(sock, ws, CODE_HTTPERROR_404) |
| 126 | #define HTTPERROR_500 return http_issue_error(sock, ws, CODE_HTTPERROR_500) | 126 | #define HTTPERROR_500 return http_issue_error(sock, ws, CODE_HTTPERROR_500) |
| 127 | ssize_t http_issue_error(const int64_t sock, struct ot_workstruct *ws, int code) { | 127 | ssize_t http_issue_error(const int64_t sock, struct ot_workstruct *ws, int code) { |
| 128 | char *error_code[] = {"302 Found", "400 Invalid Request", "400 Invalid Request", "400 Invalid Request", "402 Payment Required", | 128 | const char *error_code[] = {"302 Found", "400 Invalid Request", "400 Invalid Request", "400 Invalid Request", "402 Payment Required", |
| 129 | "403 Not Modest", "403 Access Denied", "404 Not Found", "500 Internal Server Error"}; | 129 | "403 Not Modest", "403 Access Denied", "404 Not Found", "500 Internal Server Error"}; |
| 130 | char *title = error_code[code]; | 130 | const char *title = error_code[code]; |
| 131 | 131 | ||
| 132 | ws->reply = ws->outbuf; | 132 | ws->reply = ws->outbuf; |
| 133 | if (code == CODE_HTTPERROR_302) | 133 | if (code == CODE_HTTPERROR_302) |
| @@ -491,7 +491,7 @@ unsigned long long numwants[201]; | |||
| 491 | #endif | 491 | #endif |
| 492 | 492 | ||
| 493 | #if defined(WANT_KEEPALIVE) || defined(WANT_IP_FROM_PROXY) | 493 | #if defined(WANT_KEEPALIVE) || defined(WANT_IP_FROM_PROXY) |
| 494 | static char *http_header(char *data, size_t byte_count, char *header) { | 494 | static char *http_header(char *data, size_t byte_count, const char *header) { |
| 495 | size_t i; | 495 | size_t i; |
| 496 | long sl = strlen(header); | 496 | long sl = strlen(header); |
| 497 | for (i = 0; i + sl + 2 < byte_count; ++i) { | 497 | for (i = 0; i + sl + 2 < byte_count; ++i) { |
