kiss9815 / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

NO_CGI build break #261

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. build with -DNO_CGI

What is the expected output? What do you see instead?
should build ok, but i got build error

The fix is following diff:

diff --git a/VBoxPrivate/mongoose/mongoose.c b/VBoxPrivate/mongoose/mongoose.c
index d1bd6f5..1a0f7f2 100644
--- a/VBoxPrivate/mongoose/mongoose.c
+++ b/VBoxPrivate/mongoose/mongoose.c
@@ -3069,6 +3069,7 @@ static void put_file(struct mg_connection *conn, const 
char *path) {
   }
 }

+#if !defined(NO_CGI)
 static void send_ssi_file(struct mg_connection *, const char *, FILE *, int);

 static void do_ssi_include(struct mg_connection *conn, const char *ssi,
@@ -3215,6 +3216,7 @@ static void handle_ssi_file_request(struct mg_connection 
*conn,
     (void) fclose(fp);
   }
 }
+#endif // !NO_CGI

 // This is the heart of the Mongoose's logic.
 // This function is called when the request is read, parsed and validated,
@@ -3272,6 +3274,7 @@ static void handle_request(struct mg_connection *conn) {
       send_http_error(conn, 403, "Directory Listing Denied",
           "Directory listing denied");
     }
+#if !defined(NO_CGI)
   } else if (match_extension(path, conn->ctx->config[CGI_EXTENSIONS])) {
     if (strcmp(ri->request_method, "POST") &&
         strcmp(ri->request_method, "GET")) {
@@ -3282,6 +3285,7 @@ static void handle_request(struct mg_connection *conn) {
     }
   } else if (match_extension(path, conn->ctx->config[SSI_EXTENSIONS])) {
     handle_ssi_file_request(conn, path);
+#endif
   } else if (is_not_modified(conn, &st)) {
     send_http_error(conn, 304, "Not Modified", "");
   } else {

Original issue reported on code.google.com by howard...@gmail.com on 27 Jun 2011 at 8:17

GoogleCodeExporter commented 9 years ago

Original comment by valenok on 22 Sep 2012 at 3:02