mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-26 12:14:56 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a3cfc9858 | ||
|
|
b9b20c6494 | ||
|
|
a8a7d2cf7e | ||
|
|
50ecc30b4d | ||
|
|
cd89db5c2f | ||
|
|
1ed99999bd | ||
|
|
4afebdcb2b | ||
|
|
c3d9d17e34 | ||
|
|
7bf5144e62 | ||
|
|
3eb4eb8074 | ||
|
|
ab000c684a | ||
|
|
aba60dadec | ||
|
|
f29457e967 | ||
|
|
8742fac5d8 | ||
|
|
0ab1c7ef76 | ||
|
|
47abc641f1 | ||
|
|
7519b2ef3a | ||
|
|
ce8657f12f | ||
|
|
8e366916d5 | ||
|
|
33f53ab000 | ||
|
|
bd15ad4301 | ||
|
|
e5b3b8ad32 | ||
|
|
e116c48bef | ||
|
|
7d7bb3b388 | ||
|
|
0b4bf13335 | ||
|
|
228984a3fc | ||
|
|
f084ad8008 | ||
|
|
255da78bed | ||
|
|
5d5badfcee | ||
|
|
4cf9f99ae9 | ||
|
|
673f25f75a | ||
|
|
961fb96bb7 | ||
|
|
d6475fcd19 | ||
|
|
ac538f755f | ||
|
|
5b2eb4f0e1 | ||
|
|
10c274c774 | ||
|
|
eb3b81297d | ||
|
|
80f4133bbf | ||
|
|
d10fb9451c | ||
|
|
88ae2ecadb | ||
|
|
85d19dad47 | ||
|
|
c5cc414181 | ||
|
|
17703fe3e8 | ||
|
|
04aeeba2fa | ||
|
|
4e11d5cdbf | ||
|
|
be63c0dc89 | ||
|
|
987bc1d580 | ||
|
|
ddd35c0cba | ||
|
|
c97b615785 | ||
|
|
9ab6d084df | ||
|
|
cf8d0a25aa | ||
|
|
0a0852b576 | ||
|
|
90716417c9 | ||
|
|
101afbc9b8 | ||
|
|
a197646867 | ||
|
|
00d1d2c0e7 | ||
|
|
6e50fe4475 | ||
|
|
7942803a75 | ||
|
|
a8b74a9021 | ||
|
|
27a9a62843 | ||
|
|
9b268b6c77 | ||
|
|
3b3ac48edd | ||
|
|
598e96a0cc | ||
|
|
b5dd0e8093 | ||
|
|
9b24fdfd1d | ||
|
|
8313896a85 | ||
|
|
8193302162 | ||
|
|
6e3e5560d0 | ||
|
|
f0c6630a16 | ||
|
|
1db747da29 | ||
|
|
8065439f96 |
No files matched your search
@@ -16,7 +16,7 @@ Check out [Mongoose OS](https://mongoose-os.com) - open source embedded operatin
|
|||||||
|
|
||||||
# Support
|
# Support
|
||||||
- [Study mongoose example code](https://github.com/cesanta/mongoose/tree/master/examples)
|
- [Study mongoose example code](https://github.com/cesanta/mongoose/tree/master/examples)
|
||||||
- [Read User Guide and API reference](https://docs.cesanta.com/mongoose)
|
- [Read User Guide and API reference](https://cesanta.com/docs/overview/intro.html)
|
||||||
- [Support Forum - ask your technical questions here](https://forum.mongoose-os.com/categories/mongoose)
|
- [Support Forum - ask your technical questions here](https://forum.mongoose-os.com/categories/mongoose)
|
||||||
- [Commercial licensing and support available](https://www.cesanta.com/licensing.html)
|
- [Commercial licensing and support available](https://www.cesanta.com/licensing.html)
|
||||||
- [Check our latest releases](https://github.com/cesanta/mongoose/releases)
|
- [Check our latest releases](https://github.com/cesanta/mongoose/releases)
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
title: "mg_http_parse_header()"
|
|
||||||
decl_name: "mg_http_parse_header"
|
|
||||||
symbol_kind: "func"
|
|
||||||
signature: |
|
|
||||||
int mg_http_parse_header(struct mg_str *hdr, const char *var_name, char *buf,
|
|
||||||
size_t buf_size);
|
|
||||||
---
|
|
||||||
|
|
||||||
Parses the HTTP header `hdr`. Finds variable `var_name` and stores its value
|
|
||||||
in the buffer `buf`, `buf_size`. Returns 0 if variable not found, non-zero
|
|
||||||
otherwise.
|
|
||||||
|
|
||||||
This function is supposed to parse cookies, authentication headers, etc.
|
|
||||||
Example (error handling omitted):
|
|
||||||
|
|
||||||
char user[20];
|
|
||||||
struct mg_str *hdr = mg_get_http_header(hm, "Authorization");
|
|
||||||
mg_http_parse_header(hdr, "username", user, sizeof(user));
|
|
||||||
|
|
||||||
Returns the length of the variable's value. If buffer is not large enough,
|
|
||||||
or variable not found, 0 is returned.
|
|
||||||
|
|
||||||
+12
-12
@@ -1,16 +1,16 @@
|
|||||||
---
|
---
|
||||||
items:
|
items:
|
||||||
- { name: mbuf.h }
|
- { name: mbuf.h }
|
||||||
- { name: net.h }
|
- { name: mg_net.h }
|
||||||
- { name: http.h }
|
- { name: mg_http.h }
|
||||||
- { name: http_server.h }
|
- { name: mg_http_server.h }
|
||||||
- { name: http_client.h }
|
- { name: mg_http_client.h }
|
||||||
- { name: dns.h }
|
- { name: mg_dns.h }
|
||||||
- { name: dns_server.h }
|
- { name: mg_dns_server.h }
|
||||||
- { name: resolv.h }
|
- { name: mg_resolv.h }
|
||||||
- { name: mqtt.h }
|
- { name: mg_mqtt.h }
|
||||||
- { name: mqtt_server.h }
|
- { name: mg_mqtt_server.h }
|
||||||
- { name: coap.h }
|
- { name: mg_coap.h }
|
||||||
- { name: util.h }
|
- { name: mg_util.h }
|
||||||
- { name: uri.h }
|
- { name: mg_uri.h }
|
||||||
---
|
---
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "CoAP API reference"
|
title: "CoAP API reference"
|
||||||
symbol_kind: "intro"
|
symbol_kind: "intro"
|
||||||
decl_name: "coap.h"
|
decl_name: "mg_coap.h"
|
||||||
items:
|
items:
|
||||||
- { name: mg_coap_add_option.md }
|
- { name: mg_coap_add_option.md }
|
||||||
- { name: mg_coap_compose.md }
|
- { name: mg_coap_compose.md }
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "DNS API reference"
|
title: "DNS API reference"
|
||||||
symbol_kind: "intro"
|
symbol_kind: "intro"
|
||||||
decl_name: "dns.h"
|
decl_name: "mg_dns.h"
|
||||||
items:
|
items:
|
||||||
- { name: mg_dns_copy_questions.md }
|
- { name: mg_dns_copy_questions.md }
|
||||||
- { name: mg_dns_encode_name.md }
|
- { name: mg_dns_encode_name.md }
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "DNS server API reference"
|
title: "DNS server API reference"
|
||||||
symbol_kind: "intro"
|
symbol_kind: "intro"
|
||||||
decl_name: "dns_server.h"
|
decl_name: "mg_dns_server.h"
|
||||||
items:
|
items:
|
||||||
- { name: mg_dns_create_reply.md }
|
- { name: mg_dns_create_reply.md }
|
||||||
- { name: mg_dns_reply_record.md }
|
- { name: mg_dns_reply_record.md }
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: "Common API reference"
|
title: "Common API reference"
|
||||||
symbol_kind: "intro"
|
symbol_kind: "intro"
|
||||||
decl_name: "http.h"
|
decl_name: "mg_http.h"
|
||||||
items:
|
items:
|
||||||
- { name: mg_connect_ws.md }
|
- { name: mg_connect_ws.md }
|
||||||
- { name: mg_connect_ws_opt.md }
|
- { name: mg_connect_ws_opt.md }
|
||||||
|
- { name: mg_http_is_authorized.md }
|
||||||
|
- { name: mg_http_send_digest_auth_request.md }
|
||||||
- { name: mg_printf_websocket_frame.md }
|
- { name: mg_printf_websocket_frame.md }
|
||||||
- { name: mg_send_websocket_frame.md }
|
- { name: mg_send_websocket_frame.md }
|
||||||
- { name: mg_send_websocket_framev.md }
|
- { name: mg_send_websocket_framev.md }
|
||||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
title: "mg_http_is_authorized()"
|
||||||
|
decl_name: "mg_http_is_authorized"
|
||||||
|
symbol_kind: "func"
|
||||||
|
signature: |
|
||||||
|
int mg_http_is_authorized(struct http_message *hm, struct mg_str path,
|
||||||
|
const char *domain, const char *passwords_file,
|
||||||
|
int flags);
|
||||||
|
---
|
||||||
|
|
||||||
|
Checks whether an http request is authorized. `domain` is the authentication
|
||||||
|
realm, `passwords_file` is a htdigest file (can be created e.g. with
|
||||||
|
`htdigest` utility). If either `domain` or `passwords_file` is NULL, this
|
||||||
|
function always returns 1; otherwise checks the authentication in the
|
||||||
|
http request and returns 1 only if there is a match; 0 otherwise.
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
title: "mg_http_send_digest_auth_request()"
|
||||||
|
decl_name: "mg_http_send_digest_auth_request"
|
||||||
|
symbol_kind: "func"
|
||||||
|
signature: |
|
||||||
|
void mg_http_send_digest_auth_request(struct mg_connection *c,
|
||||||
|
const char *domain);
|
||||||
|
---
|
||||||
|
|
||||||
|
Sends 401 Unauthorized response.
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
+2
-4
@@ -7,8 +7,6 @@ signature: |
|
|||||||
const struct mg_str *strings, int num_strings);
|
const struct mg_str *strings, int num_strings);
|
||||||
---
|
---
|
||||||
|
|
||||||
Sends multiple websocket frames.
|
Like `mg_send_websocket_frame()`, but composes a single frame from multiple
|
||||||
|
buffers.
|
||||||
Like `mg_send_websocket_frame()`, but composes a frame from multiple
|
|
||||||
*buffers.
|
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "Client API reference"
|
title: "Client API reference"
|
||||||
symbol_kind: "intro"
|
symbol_kind: "intro"
|
||||||
decl_name: "http_client.h"
|
decl_name: "mg_http_client.h"
|
||||||
items:
|
items:
|
||||||
- { name: mg_connect_http.md }
|
- { name: mg_connect_http.md }
|
||||||
- { name: mg_connect_http_opt.md }
|
- { name: mg_connect_http_opt.md }
|
||||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -6,7 +6,7 @@ signature: |
|
|||||||
int mg_http_create_digest_auth_header(char *buf, size_t buf_len,
|
int mg_http_create_digest_auth_header(char *buf, size_t buf_len,
|
||||||
const char *method, const char *uri,
|
const char *method, const char *uri,
|
||||||
const char *auth_domain, const char *user,
|
const char *auth_domain, const char *user,
|
||||||
const char *passwd);
|
const char *passwd, const char *nonce);
|
||||||
---
|
---
|
||||||
|
|
||||||
Creates digest authentication header for a client request.
|
Creates digest authentication header for a client request.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "Server API reference"
|
title: "Server API reference"
|
||||||
symbol_kind: "intro"
|
symbol_kind: "intro"
|
||||||
decl_name: "http_server.h"
|
decl_name: "mg_http_server.h"
|
||||||
items:
|
items:
|
||||||
- { name: mg_check_digest_auth.md }
|
- { name: mg_check_digest_auth.md }
|
||||||
- { name: mg_file_upload_handler.md }
|
- { name: mg_file_upload_handler.md }
|
||||||
@@ -10,6 +10,7 @@ items:
|
|||||||
- { name: mg_get_http_var.md }
|
- { name: mg_get_http_var.md }
|
||||||
- { name: mg_http_check_digest_auth.md }
|
- { name: mg_http_check_digest_auth.md }
|
||||||
- { name: mg_http_parse_header.md }
|
- { name: mg_http_parse_header.md }
|
||||||
|
- { name: mg_http_parse_header2.md }
|
||||||
- { name: mg_http_reverse_proxy.md }
|
- { name: mg_http_reverse_proxy.md }
|
||||||
- { name: mg_http_send_error.md }
|
- { name: mg_http_send_error.md }
|
||||||
- { name: mg_http_send_redirect.md }
|
- { name: mg_http_send_redirect.md }
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: "mg_http_parse_header()"
|
||||||
|
decl_name: "mg_http_parse_header"
|
||||||
|
symbol_kind: "func"
|
||||||
|
signature: |
|
||||||
|
int mg_http_parse_header(struct mg_str *hdr, const char *var_name, char *buf,
|
||||||
|
size_t buf_size);
|
||||||
|
---
|
||||||
|
|
||||||
|
DEPRECATED: use mg_http_parse_header2() instead.
|
||||||
|
|
||||||
|
Same as mg_http_parse_header2(), but takes buffer as a `char *` (instead of
|
||||||
|
`char **`), and thus it cannot allocate a new buffer if the provided one
|
||||||
|
is not enough, and just returns 0 in that case.
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
title: "mg_http_parse_header2()"
|
||||||
|
decl_name: "mg_http_parse_header2"
|
||||||
|
symbol_kind: "func"
|
||||||
|
signature: |
|
||||||
|
int mg_http_parse_header2(struct mg_str *hdr, const char *var_name, char **buf,
|
||||||
|
size_t buf_size);
|
||||||
|
---
|
||||||
|
|
||||||
|
Parses the HTTP header `hdr`. Finds variable `var_name` and stores its value
|
||||||
|
in the buffer `*buf`, `buf_size`. If the buffer size is not enough,
|
||||||
|
allocates a buffer of required size and writes it to `*buf`, similar to
|
||||||
|
asprintf(). The caller should always check whether the buffer was updated,
|
||||||
|
and free it if so.
|
||||||
|
|
||||||
|
This function is supposed to parse cookies, authentication headers, etc.
|
||||||
|
Example (error handling omitted):
|
||||||
|
|
||||||
|
char user_buf[20];
|
||||||
|
char *user = user_buf;
|
||||||
|
struct mg_str *hdr = mg_get_http_header(hm, "Authorization");
|
||||||
|
mg_http_parse_header2(hdr, "username", &user, sizeof(user_buf));
|
||||||
|
// ... do something useful with user
|
||||||
|
if (user != user_buf) {
|
||||||
|
free(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
Returns the length of the variable's value. If variable is not found, 0 is
|
||||||
|
returned.
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "MQTT API reference"
|
title: "MQTT API reference"
|
||||||
symbol_kind: "intro"
|
symbol_kind: "intro"
|
||||||
decl_name: "mqtt.h"
|
decl_name: "mg_mqtt.h"
|
||||||
items:
|
items:
|
||||||
- { name: mg_mqtt_connack.md }
|
- { name: mg_mqtt_connack.md }
|
||||||
- { name: mg_mqtt_disconnect.md }
|
- { name: mg_mqtt_disconnect.md }
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "MQTT Server API reference"
|
title: "MQTT Server API reference"
|
||||||
symbol_kind: "intro"
|
symbol_kind: "intro"
|
||||||
decl_name: "mqtt_server.h"
|
decl_name: "mg_mqtt_server.h"
|
||||||
items:
|
items:
|
||||||
- { name: LIST_ENTRY.md }
|
- { name: LIST_ENTRY.md }
|
||||||
- { name: struct_mg_mqtt_broker.md }
|
- { name: struct_mg_mqtt_broker.md }
|
||||||
File renamed without changes.
Loaded 100 of 438 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user