OLD | NEW |
1 diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c | 1 diff --git a/third_party/mongoose/mongoose.c b/third_party/mongoose/mongoose.c |
2 --- a/third_party/mongoose/mongoose.c | 2 --- a/third_party/mongoose/mongoose.c |
3 +++ b/third_party/mongoose/mongoose.c | 3 +++ b/third_party/mongoose/mongoose.c |
4 @@ -23,7 +23,9 @@ | 4 @@ -23,7 +23,9 @@ |
5 #else | 5 #else |
6 #define _XOPEN_SOURCE 600 // For flockfile() on Linux | 6 #define _XOPEN_SOURCE 600 // For flockfile() on Linux |
7 #define _LARGEFILE_SOURCE // Enable 64-bit file offsets | 7 #define _LARGEFILE_SOURCE // Enable 64-bit file offsets |
8 +#ifndef __STDC_FORMAT_MACROS | 8 +#ifndef __STDC_FORMAT_MACROS |
9 #define __STDC_FORMAT_MACROS // <inttypes.h> wants this for C++ | 9 #define __STDC_FORMAT_MACROS // <inttypes.h> wants this for C++ |
10 +#endif // __STDC_FORMAT_MACROS | 10 +#endif // __STDC_FORMAT_MACROS |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 @@ -3867,7 +3865,7 @@ static void handle_proxy_request(struct mg_connection *con
n) { | 102 @@ -3867,7 +3865,7 @@ static void handle_proxy_request(struct mg_connection *con
n) { |
103 } | 103 } |
104 conn->peer->client.is_ssl = is_ssl; | 104 conn->peer->client.is_ssl = is_ssl; |
105 } | 105 } |
106 - | 106 - |
107 + | 107 + |
108 // Forward client's request to the target | 108 // Forward client's request to the target |
109 mg_printf(conn->peer, "%s %s HTTP/%s\r\n", ri->request_method, ri->uri + len, | 109 mg_printf(conn->peer, "%s %s HTTP/%s\r\n", ri->request_method, ri->uri + len, |
110 ri->http_version); | 110 ri->http_version); |
| 111 @@ -2820,6 +2820,8 @@ static void prepare_cgi_environment(struct mg_connection *
conn, |
| 112 blk->len = blk->nvars = 0; |
| 113 blk->conn = conn; |
| 114 |
| 115 + memset(&root, 0, sizeof(root)); |
| 116 + |
| 117 get_document_root(conn, &root); |
| 118 |
| 119 addenv(blk, "SERVER_NAME=%s", conn->ctx->config[AUTHENTICATION_DOMAIN]); |
| 120 @@ -2916,6 +2918,8 @@ static void handle_cgi_request(struct mg_connection *conn,
const char *prog) { |
| 121 FILE *in, *out; |
| 122 pid_t pid; |
| 123 |
| 124 + memset(&ri, 0, sizeof(ri)); |
| 125 + |
| 126 prepare_cgi_environment(conn, prog, &blk); |
| 127 |
| 128 // CGI must be executed in its own directory. 'dir' must point to the |
| 129 |
OLD | NEW |