mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-10 16:31:44 +00:00
Add check
This commit is contained in:
1 parent
18464b1c89
commit
31568de0fb
2 files changed
+10
-2
No files matched your search
+5
-1
@@ -3351,7 +3351,11 @@ static inline void mg_dash_ev_handler(struct mg_connection *c, int ev,
|
|||||||
// Add this to automatically handle "get" and "set" JSON-RPC calls
|
// Add this to automatically handle "get" and "set" JSON-RPC calls
|
||||||
struct mg_dash *dash = (struct mg_dash *) c->fn_data;
|
struct mg_dash *dash = (struct mg_dash *) c->fn_data;
|
||||||
struct mg_ws_message *wm = (struct mg_ws_message *) ev_data;
|
struct mg_ws_message *wm = (struct mg_ws_message *) ev_data;
|
||||||
mg_dash_process_msg(c, wm, dash->fields, dash->get, dash->set);
|
if (dash == NULL || dash->fields == NULL) {
|
||||||
|
mg_dash_error(c, wm->data, "%s", "no fields defined");
|
||||||
|
} else {
|
||||||
|
mg_dash_process_msg(c, wm, dash->fields, dash->get, dash->set);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Copyright (c) 2023 Cesanta Software Limited
|
// Copyright (c) 2023 Cesanta Software Limited
|
||||||
|
|||||||
+5
-1
@@ -213,6 +213,10 @@ static inline void mg_dash_ev_handler(struct mg_connection *c, int ev,
|
|||||||
// Add this to automatically handle "get" and "set" JSON-RPC calls
|
// Add this to automatically handle "get" and "set" JSON-RPC calls
|
||||||
struct mg_dash *dash = (struct mg_dash *) c->fn_data;
|
struct mg_dash *dash = (struct mg_dash *) c->fn_data;
|
||||||
struct mg_ws_message *wm = (struct mg_ws_message *) ev_data;
|
struct mg_ws_message *wm = (struct mg_ws_message *) ev_data;
|
||||||
mg_dash_process_msg(c, wm, dash->fields, dash->get, dash->set);
|
if (dash == NULL || dash->fields == NULL) {
|
||||||
|
mg_dash_error(c, wm->data, "%s", "no fields defined");
|
||||||
|
} else {
|
||||||
|
mg_dash_process_msg(c, wm, dash->fields, dash->get, dash->set);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user