Commit 13e80e6b authored by Sergey Lyubka's avatar Sergey Lyubka Committed by Cesanta Bot

Add HTTP examples for MIOT

PUBLISHED_FROM=a7ca2e0b705390b32bf2bac44aaaf60c6fcc8522
parent ffa981d1
...@@ -7479,9 +7479,14 @@ size_t mg_parse_multipart(const char *buf, size_t buf_len, char *var_name, ...@@ -7479,9 +7479,14 @@ size_t mg_parse_multipart(const char *buf, size_t buf_len, char *var_name,
void mg_register_http_endpoint(struct mg_connection *nc, const char *uri_path, void mg_register_http_endpoint(struct mg_connection *nc, const char *uri_path,
mg_event_handler_t handler) { mg_event_handler_t handler) {
struct mg_http_proto_data *pd = mg_http_get_proto_data(nc); struct mg_http_proto_data *pd = NULL;
struct mg_http_endpoint *new_ep = struct mg_http_endpoint *new_ep = NULL;
(struct mg_http_endpoint *) calloc(1, sizeof(*new_ep));
if (nc == NULL) return;
new_ep = (struct mg_http_endpoint *) calloc(1, sizeof(*new_ep));
if (new_ep == NULL) return;
pd = mg_http_get_proto_data(nc);
new_ep->name = strdup(uri_path); new_ep->name = strdup(uri_path);
new_ep->name_len = strlen(new_ep->name); new_ep->name_len = strlen(new_ep->name);
new_ep->handler = handler; new_ep->handler = handler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment