Pass opts structure to mg_http_serve_dir()

This commit is contained in:
cpq committed 2021-01-02 12:30:09 +00:00
1 parent 1b0636c2d2
commit 86824795a0
5 files changed
+26 -11

No files matched your search

+7 -1
View File
@@ -19,6 +19,12 @@ struct mg_http_message {
struct mg_str message; // Request line + headers + body
};
// Parameter for mg_http_serve_dir()
struct mg_http_serve_opts {
const char *root_dir;
const char *ssi_pattern;
};
int mg_http_parse(const char *s, size_t len, struct mg_http_message *);
int mg_http_get_request_len(const unsigned char *buf, size_t buf_len);
void mg_http_printf_chunk(struct mg_connection *cnn, const char *fmt, ...);
@@ -28,7 +34,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 char *path);
const 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,