Add SSI include file=, include virtual=

This commit is contained in:
cpq committed 2021-01-02 17:57:51 +00:00
1 parent 86824795a0
commit c7e09bd7b4
24 files changed
+289 -29

No files matched your search

+11 -3
View File
@@ -296,6 +296,10 @@ typedef int socklen_t;
#define MG_ENABLE_FS 1
#endif
#ifndef MG_ENABLE_SSI
#define MG_ENABLE_SSI 0
#endif
#ifndef MG_ENABLE_IPV6
#define MG_ENABLE_IPV6 0
#endif
@@ -667,8 +671,8 @@ struct mg_http_message {
// Parameter for mg_http_serve_dir()
struct mg_http_serve_opts {
const char *root_dir;
const char *ssi_pattern;
const char *root_dir; // Web root directory, must be non-NULL
const char *ssi_pattern; // SSI filename pattern, e.g. #.shtml
};
int mg_http_parse(const char *s, size_t len, struct mg_http_message *);
@@ -680,7 +684,7 @@ struct mg_connection *mg_http_listen(struct mg_mgr *, const char *url,
struct mg_connection *mg_http_connect(struct mg_mgr *, const char *url,
mg_event_handler_t fn, void *fn_data);
void mg_http_serve_dir(struct mg_connection *, struct mg_http_message *hm,
const struct mg_http_serve_opts *);
struct mg_http_serve_opts *);
void mg_http_serve_file(struct mg_connection *, struct mg_http_message *,
const char *, const char *mime);
void mg_http_reply(struct mg_connection *, int status_code, const char *headers,
@@ -696,6 +700,10 @@ int mg_http_upload(struct mg_connection *, struct mg_http_message *hm,
void mg_http_bauth(struct mg_connection *, const char *user, const char *pass);
void mg_http_serve_ssi(struct mg_connection *c, const char *root,
const char *fullpath);
struct mg_tls_opts {
const char *ca; // CA certificate file. For both listeners and clients