Commit 58b8acd6 authored by Alexander Alashkin's avatar Alexander Alashkin Committed by Sergey Lyubka

Check malloc results, Contribute to cesanta/dev#3726

PUBLISHED_FROM=309be4a56754250406dd48f1abd30b68776f5c7e
parent 3ec09cee
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
title: "CoAP" title: "CoAP"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "coap.h" decl_name: "coap.h"
items:
- { type: file, name: mg_set_protocol_coap.md }
- { type: file, name: mg_coap_add_option.md }
- { type: file, name: mg_coap_free_options.md }
- { type: file, name: mg_coap_send_message.md }
- { type: file, name: mg_coap_send_ack.md }
- { type: file, name: mg_coap_parse.md }
- { type: file, name: mg_coap_compose.md }
- { type: file, name: struct_mg_coap_option.md }
- { type: file, name: struct_mg_coap_message.md }
--- ---
CoAP message format: CoAP message format:
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_set_protocol_coap.md"
},
{
"type": "markdown",
"name": "mg_coap_add_option.md"
},
{
"type": "markdown",
"name": "mg_coap_free_options.md"
},
{
"type": "markdown",
"name": "mg_coap_send_message.md"
},
{
"type": "markdown",
"name": "mg_coap_send_ack.md"
},
{
"type": "markdown",
"name": "mg_coap_parse.md"
},
{
"type": "markdown",
"name": "mg_coap_compose.md"
},
{
"type": "markdown",
"name": "struct_mg_coap_option.md"
},
{
"type": "markdown",
"name": "struct_mg_coap_message.md"
}
]
}
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
title: "DNS server" title: "DNS server"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "dns-server.h" decl_name: "dns-server.h"
items:
- { type: file, name: mg_dns_create_reply.md }
- { type: file, name: mg_dns_reply_record.md }
- { type: file, name: mg_dns_send_reply.md }
--- ---
Disabled by default; enable with `-DMG_ENABLE_DNS_SERVER`. Disabled by default; enable with `-DMG_ENABLE_DNS_SERVER`.
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_dns_create_reply.md"
},
{
"type": "markdown",
"name": "mg_dns_reply_record.md"
},
{
"type": "markdown",
"name": "mg_dns_send_reply.md"
}
]
}
...@@ -2,6 +2,17 @@ ...@@ -2,6 +2,17 @@
title: "DNS" title: "DNS"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "dns.h" decl_name: "dns.h"
items:
- { type: file, name: mg_dns_parse_record_data.md }
- { type: file, name: mg_send_dns_query.md }
- { type: file, name: mg_dns_insert_header.md }
- { type: file, name: mg_dns_copy_questions.md }
- { type: file, name: mg_dns_encode_record.md }
- { type: file, name: mg_parse_dns.md }
- { type: file, name: mg_dns_uncompress_name.md }
- { type: file, name: mg_set_protocol_dns.md }
- { type: file, name: struct_mg_dns_resource_record.md }
- { type: file, name: struct_mg_dns_message.md }
--- ---
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_dns_parse_record_data.md"
},
{
"type": "markdown",
"name": "mg_send_dns_query.md"
},
{
"type": "markdown",
"name": "mg_dns_insert_header.md"
},
{
"type": "markdown",
"name": "mg_dns_copy_questions.md"
},
{
"type": "markdown",
"name": "mg_dns_encode_record.md"
},
{
"type": "markdown",
"name": "mg_parse_dns.md"
},
{
"type": "markdown",
"name": "mg_dns_uncompress_name.md"
},
{
"type": "markdown",
"name": "mg_set_protocol_dns.md"
},
{
"type": "markdown",
"name": "struct_mg_dns_resource_record.md"
},
{
"type": "markdown",
"name": "struct_mg_dns_message.md"
}
]
}
...@@ -2,6 +2,38 @@ ...@@ -2,6 +2,38 @@
title: "HTTP + Websocket" title: "HTTP + Websocket"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "http.h" decl_name: "http.h"
items:
- { type: file, name: mg_set_protocol_http_websocket.md }
- { type: file, name: mg_send_websocket_handshake.md }
- { type: file, name: mg_send_websocket_handshake2.md }
- { type: file, name: mg_connect_ws.md }
- { type: file, name: mg_connect_ws_opt.md }
- { type: file, name: mg_send_websocket_frame.md }
- { type: file, name: mg_send_websocket_framev.md }
- { type: file, name: mg_printf_websocket_frame.md }
- { type: file, name: mg_send_http_chunk.md }
- { type: file, name: mg_printf_http_chunk.md }
- { type: file, name: mg_send_response_line.md }
- { type: file, name: mg_send_head.md }
- { type: file, name: mg_printf_html_escape.md }
- { type: file, name: mg_parse_http.md }
- { type: file, name: mg_get_http_header.md }
- { type: file, name: mg_http_parse_header.md }
- { type: file, name: mg_parse_multipart.md }
- { type: file, name: mg_get_http_var.md }
- { type: file, name: mg_url_decode.md }
- { type: file, name: mg_http_create_digest_auth_header.md }
- { type: file, name: mg_connect_http.md }
- { type: file, name: mg_connect_http_opt.md }
- { type: file, name: mg_serve_http.md }
- { type: file, name: mg_register_http_endpoint.md }
- { type: file, name: mg_file_upload_handler.md }
- { type: file, name: mg_http_check_digest_auth.md }
- { type: file, name: mg_fu_fname_fn.md }
- { type: file, name: struct_http_message.md }
- { type: file, name: struct_websocket_message.md }
- { type: file, name: struct_mg_http_multipart_part.md }
- { type: file, name: struct_mg_serve_http_opts.md }
--- ---
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_set_protocol_http_websocket.md"
},
{
"type": "markdown",
"name": "mg_send_websocket_handshake.md"
},
{
"type": "markdown",
"name": "mg_send_websocket_handshake2.md"
},
{
"type": "markdown",
"name": "mg_connect_ws.md"
},
{
"type": "markdown",
"name": "mg_connect_ws_opt.md"
},
{
"type": "markdown",
"name": "mg_send_websocket_frame.md"
},
{
"type": "markdown",
"name": "mg_send_websocket_framev.md"
},
{
"type": "markdown",
"name": "mg_printf_websocket_frame.md"
},
{
"type": "markdown",
"name": "mg_send_http_chunk.md"
},
{
"type": "markdown",
"name": "mg_printf_http_chunk.md"
},
{
"type": "markdown",
"name": "mg_send_response_line.md"
},
{
"type": "markdown",
"name": "mg_send_head.md"
},
{
"type": "markdown",
"name": "mg_printf_html_escape.md"
},
{
"type": "markdown",
"name": "mg_parse_http.md"
},
{
"type": "markdown",
"name": "mg_get_http_header.md"
},
{
"type": "markdown",
"name": "mg_http_parse_header.md"
},
{
"type": "markdown",
"name": "mg_parse_multipart.md"
},
{
"type": "markdown",
"name": "mg_get_http_var.md"
},
{
"type": "markdown",
"name": "mg_url_decode.md"
},
{
"type": "markdown",
"name": "mg_http_create_digest_auth_header.md"
},
{
"type": "markdown",
"name": "mg_connect_http.md"
},
{
"type": "markdown",
"name": "mg_connect_http_opt.md"
},
{
"type": "markdown",
"name": "mg_serve_http.md"
},
{
"type": "markdown",
"name": "mg_register_http_endpoint.md"
},
{
"type": "markdown",
"name": "mg_file_upload_handler.md"
},
{
"type": "markdown",
"name": "mg_http_check_digest_auth.md"
},
{
"type": "markdown",
"name": "mg_fu_fname_fn.md"
},
{
"type": "markdown",
"name": "struct_http_message.md"
},
{
"type": "markdown",
"name": "struct_websocket_message.md"
},
{
"type": "markdown",
"name": "struct_mg_http_multipart_part.md"
},
{
"type": "markdown",
"name": "struct_mg_serve_http_opts.md"
}
]
}
---
items:
- { type: dir, name: mbuf.h }
- { type: dir, name: net.h }
- { type: dir, name: http.h }
- { type: dir, name: json-rpc.h }
- { type: dir, name: dns.h }
- { type: dir, name: dns-server.h }
- { type: dir, name: mqtt.h }
- { type: dir, name: mqtt-broker.h }
- { type: dir, name: coap.h }
- { type: dir, name: util.h }
---
{
"items": [
{
"type": "section",
"name": "mbuf.h"
},
{
"type": "section",
"name": "net.h"
},
{
"type": "section",
"name": "http.h"
},
{
"type": "section",
"name": "json-rpc.h"
},
{
"type": "section",
"name": "dns.h"
},
{
"type": "section",
"name": "dns-server.h"
},
{
"type": "section",
"name": "mqtt.h"
},
{
"type": "section",
"name": "mqtt-broker.h"
},
{
"type": "section",
"name": "coap.h"
},
{
"type": "section",
"name": "util.h"
}
]
}
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
title: "JSON-RPC" title: "JSON-RPC"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "json-rpc.h" decl_name: "json-rpc.h"
items:
- { type: file, name: mg_rpc_parse_reply.md }
- { type: file, name: mg_rpc_create_request.md }
- { type: file, name: mg_rpc_create_reply.md }
- { type: file, name: mg_rpc_create_error.md }
- { type: file, name: mg_rpc_create_std_error.md }
- { type: file, name: mg_rpc_dispatch.md }
- { type: file, name: struct_mg_rpc_request.md }
- { type: file, name: struct_mg_rpc_reply.md }
- { type: file, name: struct_mg_rpc_error.md }
--- ---
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_rpc_parse_reply.md"
},
{
"type": "markdown",
"name": "mg_rpc_create_request.md"
},
{
"type": "markdown",
"name": "mg_rpc_create_reply.md"
},
{
"type": "markdown",
"name": "mg_rpc_create_error.md"
},
{
"type": "markdown",
"name": "mg_rpc_create_std_error.md"
},
{
"type": "markdown",
"name": "mg_rpc_dispatch.md"
},
{
"type": "markdown",
"name": "struct_mg_rpc_request.md"
},
{
"type": "markdown",
"name": "struct_mg_rpc_reply.md"
},
{
"type": "markdown",
"name": "struct_mg_rpc_error.md"
}
]
}
...@@ -2,6 +2,15 @@ ...@@ -2,6 +2,15 @@
title: "Memory Buffers" title: "Memory Buffers"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "mbuf.h" decl_name: "mbuf.h"
items:
- { type: file, name: mbuf_init.md }
- { type: file, name: mbuf_free.md }
- { type: file, name: mbuf_append.md }
- { type: file, name: mbuf_insert.md }
- { type: file, name: mbuf_remove.md }
- { type: file, name: mbuf_resize.md }
- { type: file, name: mbuf_trim.md }
- { type: file, name: struct_mbuf.md }
--- ---
Mbufs are mutable/growing memory buffers, like C++ strings. Mbufs are mutable/growing memory buffers, like C++ strings.
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mbuf_init.md"
},
{
"type": "markdown",
"name": "mbuf_free.md"
},
{
"type": "markdown",
"name": "mbuf_append.md"
},
{
"type": "markdown",
"name": "mbuf_insert.md"
},
{
"type": "markdown",
"name": "mbuf_remove.md"
},
{
"type": "markdown",
"name": "mbuf_resize.md"
},
{
"type": "markdown",
"name": "mbuf_trim.md"
},
{
"type": "markdown",
"name": "struct_mbuf.md"
}
]
}
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
title: "MQTT Broker" title: "MQTT Broker"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "mqtt-broker.h" decl_name: "mqtt-broker.h"
items:
- { type: file, name: mg_mqtt_broker_init.md }
- { type: file, name: mg_mqtt_broker.md }
- { type: file, name: mg_mqtt_next.md }
- { type: file, name: struct_mg_mqtt_session.md }
- { type: file, name: struct_mg_mqtt_broker.md }
--- ---
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_mqtt_broker_init.md"
},
{
"type": "markdown",
"name": "mg_mqtt_broker.md"
},
{
"type": "markdown",
"name": "mg_mqtt_next.md"
},
{
"type": "markdown",
"name": "struct_mg_mqtt_session.md"
},
{
"type": "markdown",
"name": "struct_mg_mqtt_broker.md"
}
]
}
...@@ -2,6 +2,25 @@ ...@@ -2,6 +2,25 @@
title: "MQTT" title: "MQTT"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "mqtt.h" decl_name: "mqtt.h"
items:
- { type: file, name: mg_set_protocol_mqtt.md }
- { type: file, name: mg_send_mqtt_handshake.md }
- { type: file, name: mg_send_mqtt_handshake_opt.md }
- { type: file, name: mg_mqtt_publish.md }
- { type: file, name: mg_mqtt_subscribe.md }
- { type: file, name: mg_mqtt_unsubscribe.md }
- { type: file, name: mg_mqtt_disconnect.md }
- { type: file, name: mg_mqtt_connack.md }
- { type: file, name: mg_mqtt_puback.md }
- { type: file, name: mg_mqtt_pubrec.md }
- { type: file, name: mg_mqtt_pubrel.md }
- { type: file, name: mg_mqtt_pubcomp.md }
- { type: file, name: mg_mqtt_suback.md }
- { type: file, name: mg_mqtt_unsuback.md }
- { type: file, name: mg_mqtt_ping.md }
- { type: file, name: mg_mqtt_pong.md }
- { type: file, name: mg_mqtt_next_subscribe_topic.md }
- { type: file, name: struct_mg_mqtt_topic_expression.md }
--- ---
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_set_protocol_mqtt.md"
},
{
"type": "markdown",
"name": "mg_send_mqtt_handshake.md"
},
{
"type": "markdown",
"name": "mg_send_mqtt_handshake_opt.md"
},
{
"type": "markdown",
"name": "mg_mqtt_publish.md"
},
{
"type": "markdown",
"name": "mg_mqtt_subscribe.md"
},
{
"type": "markdown",
"name": "mg_mqtt_unsubscribe.md"
},
{
"type": "markdown",
"name": "mg_mqtt_disconnect.md"
},
{
"type": "markdown",
"name": "mg_mqtt_connack.md"
},
{
"type": "markdown",
"name": "mg_mqtt_puback.md"
},
{
"type": "markdown",
"name": "mg_mqtt_pubrec.md"
},
{
"type": "markdown",
"name": "mg_mqtt_pubrel.md"
},
{
"type": "markdown",
"name": "mg_mqtt_pubcomp.md"
},
{
"type": "markdown",
"name": "mg_mqtt_suback.md"
},
{
"type": "markdown",
"name": "mg_mqtt_unsuback.md"
},
{
"type": "markdown",
"name": "mg_mqtt_ping.md"
},
{
"type": "markdown",
"name": "mg_mqtt_pong.md"
},
{
"type": "markdown",
"name": "mg_mqtt_next_subscribe_topic.md"
},
{
"type": "markdown",
"name": "struct_mg_mqtt_topic_expression.md"
}
]
}
...@@ -2,6 +2,35 @@ ...@@ -2,6 +2,35 @@
title: "Core: TCP/UDP/SSL" title: "Core: TCP/UDP/SSL"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "net.h" decl_name: "net.h"
items:
- { type: file, name: mg_mgr_init.md }
- { type: file, name: mg_mgr_free.md }
- { type: file, name: mg_mgr_poll.md }
- { type: file, name: mg_broadcast.md }
- { type: file, name: mg_next.md }
- { type: file, name: mg_add_sock.md }
- { type: file, name: mg_add_sock_opt.md }
- { type: file, name: mg_bind.md }
- { type: file, name: mg_bind_opt.md }
- { type: file, name: mg_connect.md }
- { type: file, name: mg_connect_opt.md }
- { type: file, name: mg_set_ssl.md }
- { type: file, name: mg_send.md }
- { type: file, name: mg_printf.md }
- { type: file, name: mg_vprintf.md }
- { type: file, name: mg_socketpair.md }
- { type: file, name: mg_check_ip_acl.md }
- { type: file, name: mg_enable_multithreading.md }
- { type: file, name: mg_enable_javascript.md }
- { type: file, name: mg_set_timer.md }
- { type: file, name: mg_time.md }
- { type: file, name: mg_event_handler_t.md }
- { type: file, name: struct_mg_str.md }
- { type: file, name: struct_mg_mgr.md }
- { type: file, name: struct_mg_connection.md }
- { type: file, name: struct_mg_add_sock_opts.md }
- { type: file, name: struct_mg_bind_opts.md }
- { type: file, name: struct_mg_connect_opts.md }
--- ---
NOTE: Mongoose manager is single threaded. It does not protect NOTE: Mongoose manager is single threaded. It does not protect
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_mgr_init.md"
},
{
"type": "markdown",
"name": "mg_mgr_free.md"
},
{
"type": "markdown",
"name": "mg_mgr_poll.md"
},
{
"type": "markdown",
"name": "mg_broadcast.md"
},
{
"type": "markdown",
"name": "mg_next.md"
},
{
"type": "markdown",
"name": "mg_add_sock.md"
},
{
"type": "markdown",
"name": "mg_add_sock_opt.md"
},
{
"type": "markdown",
"name": "mg_bind.md"
},
{
"type": "markdown",
"name": "mg_bind_opt.md"
},
{
"type": "markdown",
"name": "mg_connect.md"
},
{
"type": "markdown",
"name": "mg_connect_opt.md"
},
{
"type": "markdown",
"name": "mg_set_ssl.md"
},
{
"type": "markdown",
"name": "mg_send.md"
},
{
"type": "markdown",
"name": "mg_printf.md"
},
{
"type": "markdown",
"name": "mg_vprintf.md"
},
{
"type": "markdown",
"name": "mg_socketpair.md"
},
{
"type": "markdown",
"name": "mg_check_ip_acl.md"
},
{
"type": "markdown",
"name": "mg_enable_multithreading.md"
},
{
"type": "markdown",
"name": "mg_enable_javascript.md"
},
{
"type": "markdown",
"name": "mg_set_timer.md"
},
{
"type": "markdown",
"name": "mg_time.md"
},
{
"type": "markdown",
"name": "mg_event_handler_t.md"
},
{
"type": "markdown",
"name": "struct_mg_str.md"
},
{
"type": "markdown",
"name": "struct_mg_mgr.md"
},
{
"type": "markdown",
"name": "struct_mg_connection.md"
},
{
"type": "markdown",
"name": "struct_mg_add_sock_opts.md"
},
{
"type": "markdown",
"name": "struct_mg_bind_opts.md"
},
{
"type": "markdown",
"name": "struct_mg_connect_opts.md"
}
]
}
...@@ -2,6 +2,29 @@ ...@@ -2,6 +2,29 @@
title: "Utilities" title: "Utilities"
symbol_kind: "intro" symbol_kind: "intro"
decl_name: "util.h" decl_name: "util.h"
items:
- { type: file, name: mg_skip.md }
- { type: file, name: mg_ncasecmp.md }
- { type: file, name: mg_casecmp.md }
- { type: file, name: mg_vcmp.md }
- { type: file, name: mg_vcasecmp.md }
- { type: file, name: mg_base64_decode.md }
- { type: file, name: mg_base64_encode.md }
- { type: file, name: mg_stat.md }
- { type: file, name: mg_fopen.md }
- { type: file, name: mg_open.md }
- { type: file, name: mg_start_thread.md }
- { type: file, name: mg_conn_addr_to_str.md }
- { type: file, name: mg_sock_to_str.md }
- { type: file, name: mg_sock_addr_to_str.md }
- { type: file, name: mg_hexdump.md }
- { type: file, name: mg_hexdump_connection.md }
- { type: file, name: mg_avprintf.md }
- { type: file, name: mg_is_big_endian.md }
- { type: file, name: mg_next_comma_list_entry.md }
- { type: file, name: mg_match_prefix.md }
- { type: file, name: mg_mk_str.md }
- { type: file, name: MG_MK_STR.md }
--- ---
......
{
"items": [
{
"type": "markdown",
"name": "intro.md"
},
{
"type": "markdown",
"name": "mg_skip.md"
},
{
"type": "markdown",
"name": "mg_ncasecmp.md"
},
{
"type": "markdown",
"name": "mg_casecmp.md"
},
{
"type": "markdown",
"name": "mg_vcmp.md"
},
{
"type": "markdown",
"name": "mg_vcasecmp.md"
},
{
"type": "markdown",
"name": "mg_base64_decode.md"
},
{
"type": "markdown",
"name": "mg_base64_encode.md"
},
{
"type": "markdown",
"name": "mg_stat.md"
},
{
"type": "markdown",
"name": "mg_fopen.md"
},
{
"type": "markdown",
"name": "mg_open.md"
},
{
"type": "markdown",
"name": "mg_start_thread.md"
},
{
"type": "markdown",
"name": "mg_conn_addr_to_str.md"
},
{
"type": "markdown",
"name": "mg_sock_to_str.md"
},
{
"type": "markdown",
"name": "mg_sock_addr_to_str.md"
},
{
"type": "markdown",
"name": "mg_hexdump.md"
},
{
"type": "markdown",
"name": "mg_hexdump_connection.md"
},
{
"type": "markdown",
"name": "mg_avprintf.md"
},
{
"type": "markdown",
"name": "mg_is_big_endian.md"
},
{
"type": "markdown",
"name": "mg_next_comma_list_entry.md"
},
{
"type": "markdown",
"name": "mg_match_prefix.md"
},
{
"type": "markdown",
"name": "mg_mk_str.md"
},
{
"type": "markdown",
"name": "MG_MK_STR.md"
}
]
}
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