Fix -DNO_CGI build

This commit is contained in:
Sergey Lyubka committed 2011-08-24 13:11:41 +01:00
1 parent bc900844f1
commit 60408deaa8
1 file changed
+2 -2
+2 -2
View File
@@ -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) {
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) {
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) {
} 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)) {