mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-27 12:26:24 +00:00
remove http_match_uri()
This commit is contained in:
1 parent
e6bf658271
commit
ef61d6ea48
34 files changed
+83
-93
No files matched your search
@@ -10,10 +10,10 @@
|
||||
static void cb(struct mg_connection *c, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_HTTP_MSG) {
|
||||
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
|
||||
if (mg_http_match_uri(hm, "/api/log/static")) {
|
||||
if (mg_match(hm->uri, mg_str("/api/log/static"), NULL)) {
|
||||
struct mg_http_serve_opts opts = {.root_dir = NULL};
|
||||
mg_http_serve_file(c, hm, "log.txt", &opts);
|
||||
} else if (mg_http_match_uri(hm, "/api/log/live")) {
|
||||
} else if (mg_match(hm->uri, mg_str("/api/log/live"), NULL)) {
|
||||
c->data[0] = 'L'; // Mark that connection as live log listener
|
||||
mg_printf(c, "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user