mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-19 11:09:42 +00:00
Update to use MG_ESC()
This commit is contained in:
1 parent
f4cf40d38f
commit
1908d3200e
8 files changed
+46
-56
No files matched your search
@@ -45,14 +45,13 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
if (version > 0 && version == s_version) {
|
||||
// Version match: no changes
|
||||
mg_http_reply(c, 200, "Content-Type: application/json\r\n",
|
||||
"{%m:%m,%m:%ld}\n", mg_print_esc, 0, "status",
|
||||
mg_print_esc, 0, "no change", mg_print_esc, 0, "version",
|
||||
version);
|
||||
"{%m:%m,%m:%ld}\n", MG_ESC("status"), MG_ESC("no change"),
|
||||
MG_ESC("version"), version);
|
||||
} else {
|
||||
// Version mismatch, return data
|
||||
mg_http_reply(c, 200, "Content-Type: application/json\r\n",
|
||||
"{%m:%ld,%m:[%M]}\n", mg_print_esc, 0, "version",
|
||||
s_version, mg_print_esc, 0, "data", printdata);
|
||||
"{%m:%ld,%m:[%M]}\n", MG_ESC("version"), s_version,
|
||||
MG_ESC("data"), printdata);
|
||||
}
|
||||
} else {
|
||||
struct mg_http_serve_opts opts = {.root_dir = s_root_dir};
|
||||
|
||||
Reference in new issue
Block a user