mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-28 20:58:31 +00:00
Fix #2612 - struct mg_str::ptr -> buf
This commit is contained in:
1 parent
e93d18d200
commit
e0e599ffa1
61 files changed
+684
-686
No files matched your search
@@ -37,8 +37,8 @@ static void simple_http_listener(struct mg_connection *c, int ev, void *ev_data)
|
||||
// Content-Length header automatically. In the response, we show
|
||||
// the requested URI and HTTP body:
|
||||
mg_http_reply(c, 200, "", "{%m:%m,%m:%m}\n", // See mg_snprintf doc
|
||||
MG_ESC("uri"), mg_print_esc, hm->uri.len, hm->uri.ptr,
|
||||
MG_ESC("body"), mg_print_esc, hm->body.len, hm->body.ptr);
|
||||
MG_ESC("uri"), mg_print_esc, hm->uri.len, hm->uri.buf,
|
||||
MG_ESC("body"), mg_print_esc, hm->body.len, hm->body.buf);
|
||||
} else {
|
||||
// For all other URIs, serve some static content
|
||||
mg_http_reply(c, 200, "", "<html>millis: %lu</html>", millis());
|
||||
|
||||
@@ -26,8 +26,8 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) {
|
||||
// Received MQTT message
|
||||
struct mg_mqtt_message *mm = (struct mg_mqtt_message *) ev_data;
|
||||
MG_INFO(("%lu RECEIVED %.*s <- %.*s", c->id, (int) mm->data.len,
|
||||
mm->data.ptr, (int) mm->topic.len, mm->topic.ptr));
|
||||
exec_command(mm->data.ptr, mm->data.len);
|
||||
mm->data.buf, (int) mm->topic.len, mm->topic.buf));
|
||||
exec_command(mm->data.buf, mm->data.len);
|
||||
} else if (ev == MG_EV_CLOSE) {
|
||||
MG_INFO(("%lu CLOSED", c->id));
|
||||
mqtt_connection = NULL;
|
||||
|
||||
Reference in new issue
Block a user