Commit 60408dea authored by Sergey Lyubka's avatar Sergey Lyubka

Fix -DNO_CGI build

parent bc900844
...@@ -756,7 +756,6 @@ static const char *next_option(const char *list, struct vec *val, ...@@ -756,7 +756,6 @@ static const char *next_option(const char *list, struct vec *val,
return list; return list;
} }
#if !defined(NO_CGI)
static int match_extension(const char *path, const char *ext_list) { static int match_extension(const char *path, const char *ext_list) {
struct vec ext_vec; struct vec ext_vec;
size_t path_len; size_t path_len;
...@@ -771,7 +770,6 @@ static int match_extension(const char *path, const char *ext_list) { ...@@ -771,7 +770,6 @@ static int match_extension(const char *path, const char *ext_list) {
return 0; return 0;
} }
#endif // !NO_CGI
// HTTP 1.1 assumes keep alive if "Connection:" header is not set // HTTP 1.1 assumes keep alive if "Connection:" header is not set
// This function must tolerate situations when connection info is not // This function must tolerate situations when connection info is not
...@@ -3399,6 +3397,7 @@ static void handle_request(struct mg_connection *conn) { ...@@ -3399,6 +3397,7 @@ static void handle_request(struct mg_connection *conn) {
send_http_error(conn, 403, "Directory Listing Denied", send_http_error(conn, 403, "Directory Listing Denied",
"Directory listing denied"); "Directory listing denied");
} }
#if !defined(NO_CGI)
} else if (match_extension(path, conn->ctx->config[CGI_EXTENSIONS])) { } else if (match_extension(path, conn->ctx->config[CGI_EXTENSIONS])) {
if (strcmp(ri->request_method, "POST") && if (strcmp(ri->request_method, "POST") &&
strcmp(ri->request_method, "GET")) { strcmp(ri->request_method, "GET")) {
...@@ -3407,6 +3406,7 @@ static void handle_request(struct mg_connection *conn) { ...@@ -3407,6 +3406,7 @@ static void handle_request(struct mg_connection *conn) {
} else { } else {
handle_cgi_request(conn, path); handle_cgi_request(conn, path);
} }
#endif // !NO_CGI
} else if (match_extension(path, conn->ctx->config[SSI_EXTENSIONS])) { } else if (match_extension(path, conn->ctx->config[SSI_EXTENSIONS])) {
handle_ssi_file_request(conn, path); handle_ssi_file_request(conn, path);
} else if (is_not_modified(conn, &st)) { } else if (is_not_modified(conn, &st)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment