Commit 1dae0373 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

MG_DISABLE_POPEN -> MG_ENABLE_HTTP_SSI_EXEC

PUBLISHED_FROM=55b2b70a688234f6ebcfba37eced20ee5d5387a1
parent e928f364
...@@ -10,7 +10,8 @@ title: Enabling flags ...@@ -10,7 +10,8 @@ title: Enabling flags
- `MG_ENABLE_COAP` enable CoAP protocol - `MG_ENABLE_COAP` enable CoAP protocol
- `MG_ENABLE_HTTP` Enable HTTP protocol support (on by default, set to 0 to disable) - `MG_ENABLE_HTTP` Enable HTTP protocol support (on by default, set to 0 to disable)
- `MG_ENABLE_HTTP_CGI` Enable [CGI](https://docs.cesanta.com/mongoose/master/#/http/cgi.md/) support - `MG_ENABLE_HTTP_CGI` Enable [CGI](https://docs.cesanta.com/mongoose/master/#/http/cgi.md/) support
- `MG_ENABLE_HTTP_SSI` Enable [Server SIde Includes](https://docs.cesanta.com/mongoose/master/#/http/ssi.md/) support - `MG_ENABLE_HTTP_SSI` Enable [Server Side Includes](https://docs.cesanta.com/mongoose/master/#/http/ssi.md/) support
- `MG_ENABLE_HTTP_SSI_EXEC` Enable SSI `exec` operator
- `MG_ENABLE_HTTP_WEBDAV` enable WebDAV extensions to HTTP - `MG_ENABLE_HTTP_WEBDAV` enable WebDAV extensions to HTTP
- `MG_ENABLE_HTTP_WEBSOCKET` enable WebSocket extension to HTTP (on by default, =0 to disable) - `MG_ENABLE_HTTP_WEBSOCKET` enable WebSocket extension to HTTP (on by default, =0 to disable)
- `MG_ENABLE_GETADDRINFO` enable `getaddrinfo()` in `mg_resolve2()` - `MG_ENABLE_GETADDRINFO` enable `getaddrinfo()` in `mg_resolve2()`
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#ifdef PICOTCP #ifdef PICOTCP
#define NO_LIBC #define NO_LIBC
#define MG_DISABLE_POPEN
#define MG_DISABLE_SOCKETPAIR #define MG_DISABLE_SOCKETPAIR
#define MG_DISABLE_PFS #define MG_DISABLE_PFS
#endif #endif
...@@ -6877,7 +6876,7 @@ static void mg_do_ssi_include(struct mg_connection *nc, struct http_message *hm, ...@@ -6877,7 +6876,7 @@ static void mg_do_ssi_include(struct mg_connection *nc, struct http_message *hm,
} }
} }
#if !MG_DISABLE_POPEN #if MG_ENABLE_HTTP_SSI_EXEC
static void do_ssi_exec(struct mg_connection *nc, char *tag) { static void do_ssi_exec(struct mg_connection *nc, char *tag) {
char cmd[BUFSIZ]; char cmd[BUFSIZ];
FILE *fp; FILE *fp;
...@@ -6891,7 +6890,7 @@ static void do_ssi_exec(struct mg_connection *nc, char *tag) { ...@@ -6891,7 +6890,7 @@ static void do_ssi_exec(struct mg_connection *nc, char *tag) {
pclose(fp); pclose(fp);
} }
} }
#endif /* !MG_DISABLE_POPEN */ #endif /* MG_ENABLE_HTTP_SSI_EXEC */
/* /*
* SSI directive has the following format: * SSI directive has the following format:
...@@ -6903,7 +6902,7 @@ static void mg_send_ssi_file(struct mg_connection *nc, struct http_message *hm, ...@@ -6903,7 +6902,7 @@ static void mg_send_ssi_file(struct mg_connection *nc, struct http_message *hm,
static const struct mg_str btag = MG_MK_STR("<!--#"); static const struct mg_str btag = MG_MK_STR("<!--#");
static const struct mg_str d_include = MG_MK_STR("include"); static const struct mg_str d_include = MG_MK_STR("include");
static const struct mg_str d_call = MG_MK_STR("call"); static const struct mg_str d_call = MG_MK_STR("call");
#if !MG_DISABLE_POPEN #if MG_ENABLE_HTTP_SSI_EXEC
static const struct mg_str d_exec = MG_MK_STR("exec"); static const struct mg_str d_exec = MG_MK_STR("exec");
#endif #endif
char buf[BUFSIZ], *p = buf + btag.len; /* p points to SSI directive */ char buf[BUFSIZ], *p = buf + btag.len; /* p points to SSI directive */
...@@ -6939,7 +6938,7 @@ static void mg_send_ssi_file(struct mg_connection *nc, struct http_message *hm, ...@@ -6939,7 +6938,7 @@ static void mg_send_ssi_file(struct mg_connection *nc, struct http_message *hm,
mg_call(nc, NULL, MG_EV_SSI_CALL, mg_call(nc, NULL, MG_EV_SSI_CALL,
(void *) cctx.arg.p); /* NUL added above */ (void *) cctx.arg.p); /* NUL added above */
mg_call(nc, NULL, MG_EV_SSI_CALL_CTX, &cctx); mg_call(nc, NULL, MG_EV_SSI_CALL_CTX, &cctx);
#if !MG_DISABLE_POPEN #if MG_ENABLE_HTTP_SSI_EXEC
} else if (memcmp(p, d_exec.p, d_exec.len) == 0) { } else if (memcmp(p, d_exec.p, d_exec.len) == 0) {
do_ssi_exec(nc, p + d_exec.len + 1); do_ssi_exec(nc, p + d_exec.len + 1);
#endif #endif
......
...@@ -464,7 +464,6 @@ void mg_lwip_set_keepalive_params(struct mg_connection *nc, int idle, ...@@ -464,7 +464,6 @@ void mg_lwip_set_keepalive_params(struct mg_connection *nc, int idle,
#define MG_SOCKET_SIMPLELINK 1 #define MG_SOCKET_SIMPLELINK 1
#define MG_DISABLE_SOCKETPAIR 1 #define MG_DISABLE_SOCKETPAIR 1
#define MG_DISABLE_SYNC_RESOLVER 1 #define MG_DISABLE_SYNC_RESOLVER 1
#define MG_DISABLE_POPEN 1
/* /*
* CC3100 SDK and STM32 SDK include headers w/out path, just like * CC3100 SDK and STM32 SDK include headers w/out path, just like
...@@ -520,7 +519,6 @@ int inet_pton(int af, const char *src, void *dst); ...@@ -520,7 +519,6 @@ int inet_pton(int af, const char *src, void *dst);
#define MG_SOCKET_SIMPLELINK 1 #define MG_SOCKET_SIMPLELINK 1
#define MG_DISABLE_SOCKETPAIR 1 #define MG_DISABLE_SOCKETPAIR 1
#define MG_DISABLE_SYNC_RESOLVER 1 #define MG_DISABLE_SYNC_RESOLVER 1
#define MG_DISABLE_POPEN 1
/* Only SPIFFS supports directories, SLFS does not. */ /* Only SPIFFS supports directories, SLFS does not. */
#if defined(CC3200_FS_SPIFFS) && !defined(MG_ENABLE_DIRECTORY_LISTING) #if defined(CC3200_FS_SPIFFS) && !defined(MG_ENABLE_DIRECTORY_LISTING)
...@@ -657,8 +655,6 @@ struct dirent *readdir(DIR *dir); ...@@ -657,8 +655,6 @@ struct dirent *readdir(DIR *dir);
#define MG_SOCKET_SIMPLELINK 1 #define MG_SOCKET_SIMPLELINK 1
#define MG_DISABLE_SOCKETPAIR 1 #define MG_DISABLE_SOCKETPAIR 1
#define MG_DISABLE_SYNC_RESOLVER 1 #define MG_DISABLE_SYNC_RESOLVER 1
#define MG_DISABLE_POPEN 1
#define MG_DISABLE_DAV 1
/* Amalgamated: #include "common/platforms/simplelink/cs_simplelink.h" */ /* Amalgamated: #include "common/platforms/simplelink/cs_simplelink.h" */
...@@ -1389,10 +1385,6 @@ const char *c_strnstr(const char *s, const char *find, size_t slen); ...@@ -1389,10 +1385,6 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
#define MG_DISABLE_PFS 0 #define MG_DISABLE_PFS 0
#endif #endif
#ifndef MG_DISABLE_POPEN
#define MG_DISABLE_POPEN 0
#endif
#ifndef MG_DISABLE_RESOLVER #ifndef MG_DISABLE_RESOLVER
#define MG_DISABLE_RESOLVER 0 #define MG_DISABLE_RESOLVER 0
#endif #endif
...@@ -1458,6 +1450,10 @@ const char *c_strnstr(const char *s, const char *find, size_t slen); ...@@ -1458,6 +1450,10 @@ const char *c_strnstr(const char *s, const char *find, size_t slen);
#define MG_ENABLE_HTTP_SSI MG_ENABLE_FILESYSTEM #define MG_ENABLE_HTTP_SSI MG_ENABLE_FILESYSTEM
#endif #endif
#ifndef MG_ENABLE_HTTP_SSI_EXEC
#define MG_ENABLE_HTTP_SSI_EXEC 0
#endif
#ifndef MG_ENABLE_HTTP_STREAMING_MULTIPART #ifndef MG_ENABLE_HTTP_STREAMING_MULTIPART
#define MG_ENABLE_HTTP_STREAMING_MULTIPART 0 #define MG_ENABLE_HTTP_STREAMING_MULTIPART 0
#endif #endif
......
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