diff --git a/examples/CC3200/Makefile.build b/examples/CC3200/Makefile.build index 43317c26293af24da4c3d419c40990e9b021a118..e2a057e1bb1f6e2286a78aab03510d22520943de 100644 --- a/examples/CC3200/Makefile.build +++ b/examples/CC3200/Makefile.build @@ -28,8 +28,6 @@ MONGOOSE_FEATURES = \ -DMG_DISABLE_JSON_RPC \ -DMG_DISABLE_COAP \ -DMG_DISABLE_DAV \ - -DMG_DISABLE_CGI \ - -DMG_DISABLE_SSI \ -DMG_ENABLE_HTTP_STREAMING_MULTIPART \ -DMG_MAX_HTTP_HEADERS=20 \ -DMG_MAX_HTTP_REQUEST_SIZE=1024 \ diff --git a/mongoose.c b/mongoose.c index b6edb8def7a71c8c96fcfdb015e0436c0dd21be6..52af87e9d0f0d119791a14ca867c20b165385179 100644 --- a/mongoose.c +++ b/mongoose.c @@ -5710,14 +5710,14 @@ static void mg_send_ssi_file(struct mg_connection *nc, const char *path, static const struct mg_str d_exec = MG_MK_STR("exec"); #endif char buf[BUFSIZ], *p = buf + btag.len; /* p points to SSI directive */ - int ch, offset, len, in_ssi_tag; + int ch, len, in_ssi_tag; if (include_level > 10) { mg_printf(nc, "SSI #include level is too deep (%s)", path); return; } - in_ssi_tag = len = offset = 0; + in_ssi_tag = len = 0; while ((ch = fgetc(fp)) != EOF) { if (in_ssi_tag && ch == '>' && buf[len - 1] == '-' && buf[len - 2] == '-') { size_t i = len - 2; @@ -7838,8 +7838,10 @@ void *mg_start_thread(void *(*f)(void *), void *p) { void mg_set_close_on_exec(sock_t sock) { #ifdef _WIN32 (void) SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0); -#else +#elif defined(__unix__) fcntl(sock, F_SETFD, FD_CLOEXEC); +#else + (void) sock; #endif } diff --git a/mongoose.h b/mongoose.h index 99517f4ab3ee5bd9db120a51111e7cbeb9a9c929..2a827edf2b68c8ca46f5fc0f7377750912eab373 100644 --- a/mongoose.h +++ b/mongoose.h @@ -397,6 +397,8 @@ unsigned long os_random(void); #define MG_SOCKET_SIMPLELINK 1 #define MG_DISABLE_SOCKETPAIR 1 #define MG_DISABLE_SYNC_RESOLVER 1 +#define MG_DISABLE_POPEN 1 +#define MG_DISABLE_CGI 1 #include <simplelink.h> @@ -543,6 +545,8 @@ typedef struct stat cs_stat_t; #define closesocket(x) sl_Close(x) +#define fileno(x) -1 + /* Some functions we implement for Mongoose. */ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);