Commit Graph

599 Commits

Author SHA1 Message Date
Sergey Lyubka
ad3655fb92 Docs spelling 2021-09-22 11:51:16 +01:00
Sergey Lyubka
90a131bd29 Include ipv6 wrapping brackets [] in the result of mg_url_host() 2021-09-21 08:10:27 +01:00
Sergey Lyubka
2139fbc4b7 Support multiple web roots 2021-09-20 12:24:44 +01:00
Sergey Lyubka
9d1e61de93 Update docs 2021-09-17 15:59:15 +01:00
Alex Alashkin
eb94704d8d Add params and retvals 2021-09-15 22:18:44 +03:00
Sergey Lyubka
f3eb466af3 Update docs 2021-09-15 07:43:24 +01:00
Sergey Lyubka
5bf5516b29 struct iobuf doc 2021-08-30 13:06:45 +01:00
Sergey Lyubka
167af7f160 docs update 2021-08-28 20:27:55 +01:00
Sergey Lyubka
7d91885413 Update docs 2021-08-28 11:16:45 +01:00
Sergey Lyubka
0de83157dc Update docs 2021-08-28 08:52:41 +01:00
Sergey Lyubka
cc9639b3cb Update docs 2021-08-28 08:48:47 +01:00
Sergey Lyubka
cb0ac1868f Update docs 2021-08-28 08:46:01 +01:00
Sergey Lyubka
f3d15a0440 Update docs 2021-08-28 08:25:31 +01:00
Sergey Lyubka
0bc736d384 Update docs 2021-08-28 08:23:33 +01:00
Sergey Lyubka
3bf7b817f6 Update docs 2021-08-28 08:21:29 +01:00
Sergey Lyubka
477e48bf54 mg_iobuf_append -> mg_iobuf_add 2021-08-28 08:08:54 +01:00
Sergey Lyubka
913e730ec2 mg_iobuf_delete -> mg_iobuf_del 2021-08-28 07:16:38 +01:00
Sergey Lyubka
bd64043377 mg_comma -> mg_commalist 2021-08-28 06:54:56 +01:00
Sergey Lyubka
7ba6fda236 Add stm32-nucleo-h743z and stm32-nucleo-f429z 2021-08-26 11:40:47 +01:00
Sergey Lyubka
fc9c454518 Add mg_check_ip_acl() 2021-08-25 07:59:31 +01:00
Sergey Lyubka
1c456fc2df mg_next_comma_entry -> mg_comma 2021-08-23 16:54:58 +01:00
Sergey Lyubka
07568a8f06 Docs nits 2021-08-22 10:51:40 +01:00
Sergey Lyubka
71e9019211 Docs nitpicks 2021-08-20 20:31:32 +01:00
Sergey Lyubka
6c42350fcf docs 2021-08-12 12:24:28 +01:00
Sergey Lyubka
104c4fab19 More docs 2021-08-11 19:24:33 +01:00
Sergey Lyubka
fd5eb2d3f9 Refactor mg_mkpipe() 2021-08-11 19:17:04 +01:00
Sergey Lyubka
b739aa89f1 Update readme 2021-08-09 09:43:21 +01:00
Sergey Lyubka
b7ce8213d7 Better multithreading support: remove mg_socketpair, add mg_mkpipe() and mg_rmpipe() 2021-08-07 17:22:47 +01:00
Sergey Lyubka
86f43cd8d6 Refactor mg_socketpair and document MG_ENABLE_NATIVE_SOCKETPAIR 2021-08-06 10:23:08 +01:00
Sergey Lyubka
3a46055e52 Better packed test 2021-07-30 13:19:20 +01:00
Sergey Lyubka
c2176f969b Implement FS virtualization 2021-07-29 14:21:20 +01:00
Sergey Lyubka
2a2c17a232 Remove MG_ENABLE_STDIO and cleanup 2021-07-24 03:44:00 +01:00
Sergey Lyubka
328a87b02a Remove mg_file_size() 2021-07-23 20:18:34 +01:00
Sergey Lyubka
529faa1172 MG_ENABLE_FS -> MG_ENABLE_STDIO 2021-07-23 19:47:26 +01:00
Sergey Lyubka
497b8027f5 Fix #1314 - expose local port for listeners 2021-07-19 08:47:38 +01:00
cpq
3deafaea7f Extend mg_mqtt_{pub,sub} by adding qos and retain 2021-06-10 19:27:19 +01:00
cpq
a15d518571 Add mg_mqtt_pubex 2021-06-10 19:15:50 +01:00
cpq
c0a8546330 Add MG_ARCH_FREERTOS_LWIP 2021-05-28 23:49:26 +01:00
cpq
736b8ad7b7 Fix #1285 - __builtin___snprintf_chk warning. Tighten test flags and refactor the code to squash all warnings 2021-05-28 18:30:42 +01:00
cpq
1a5e3d3151 Fix #1286 2021-05-19 00:19:21 +01:00
cpq
47e5e984df stm32f7 example starts on real h/w, with plus-TCP driver 2021-05-17 17:36:57 +01:00
cpq
7b39973065 docs 2021-05-12 11:44:15 +01:00
cpq
30b64483fd docs 2021-05-12 11:39:46 +01:00
Sergey Lyubka
946e07644c
Merge pull request #1275 from panosto/master
Corrected small typo in docs
2021-04-29 19:26:46 +01:00
Panagiotis
497b26a249 Corrected small typo in docs 2021-04-29 18:16:33 +02:00
cpq
31c9e3fb7e Make mg_random() weak, see #1269 2021-04-29 09:09:21 +01:00
cpq
4dbb2da78f Add form-upload example 2021-03-17 13:28:36 +00:00
cpq
5bd22cb5e4 Add mg_http_next_multipart() 2021-03-17 07:43:29 +00:00
cpq
5326e8d212 Update docs 2021-03-15 09:18:02 +00:00
novlean
91ed6de166
Fixed typos 2021-03-11 13:01:45 +00:00
cpq
6366c832b0 Add struct mg_http_serve_opts::extra_headers 2021-03-10 07:56:14 +00:00
cpq
f326cbedbe Fix doc example 2021-03-09 17:44:15 +00:00
cpq
452bcc68a4 Add mg_mqtt_next_unsub() signature 2021-03-09 11:29:53 +00:00
cpq
1b5cc341a5 Add streaming client support, MG_EV_HTTP_CHUNK 2021-03-08 15:41:16 +00:00
Christopher Simons
421bc126b5 README.md: fix typo: is_drainig -> is_draining 2021-02-02 22:17:15 -05:00
cpq
d327ee9834 Improve SNI 2021-01-30 13:03:11 +00:00
cpq
86b1053678 Add error check for iobuf allocation 2021-01-29 12:32:34 +00:00
cpq
3c851bcfc3 mg_file_write -> mg_file_printf 2021-01-26 16:30:44 +00:00
wangtun
960d3c7880 Fix README.md mg_mgr_free 2021-01-23 15:49:55 +08:00
cpq
be62ac9c14 Add more docs 2021-01-20 11:28:47 +00:00
Sergey Lyubka
30d86928d5
Merge pull request #1191 from RiccardoDalFiume/master
FIX README mg_http_serve*
2021-01-17 11:18:32 +00:00
cpq
12c32d09fb Pass mg_http_message to MG_EV_WS_OPEN 2021-01-17 11:16:19 +00:00
cpq
ae6fd6aa35 Add extra headers param to mg_ws_upgrade() 2021-01-16 22:48:43 +00:00
Riccardo Dal Fiume
7beff0201d FIX README mg_http_serve* 2021-01-12 11:28:41 +01:00
cpq
a4c9d1ecb7 Update mg_http_serve_file() doc 2021-01-07 16:21:01 +00:00
cpq
b7a79a556a Add extra headers param to mg_http_serve_file 2021-01-07 12:48:20 +00:00
cpq
c7e09bd7b4 Add SSI include file=, include virtual= 2021-01-02 17:57:51 +00:00
cpq
29534218d7 IPv6 related refactoring 2020-12-20 16:55:33 +00:00
cpq
82a378e519 Add extra param to http_reply() 2020-12-17 22:47:55 +00:00
cpq
2252a74cd7 Note on UDP 2020-12-17 11:19:13 +00:00
cpq
1252a61479 More docs 2020-12-14 09:36:46 +00:00
cpq
5f631c0b96 More docs 2020-12-14 09:35:03 +00:00
cpq
7ce9cdf0b9 More docs 2020-12-14 09:31:03 +00:00
cpq
6c4b5efd98 Add restful and client example 2020-12-10 13:26:05 +00:00
cpq
05a43c563c Update READMEs 2020-12-08 16:53:35 +00:00
cpq
94d2e86b60 More docs 2020-12-08 16:26:17 +00:00
cpq
47b6060910 Add docs 2020-12-06 21:12:05 +00:00
cpq
f2fba1d200 7.0 refactor 2020-12-05 11:26:32 +00:00
Sergey Lyubka
f778d22eac Make it possible to override default FS update algorithm
PUBLISHED_FROM=774a111548da97bd9d195e177b5fb66b0fd66135
2020-06-11 18:27:48 +01:00
Sergey Lyubka
3aa76dcaec Subst CREDPARAMS
PUBLISHED_FROM=545e8dff4ea0bef061c893252c613e3429f56184
2020-06-11 18:27:46 +01:00
Deomid "rojer" Ryabkov
95fcb261eb Fix processing of keep-alive requests when chunks are consumed
PUBLISHED_FROM=136ce2ed4f143d7ee246e5fd1078c431e205bb3a
2020-05-22 23:07:38 +00:00
Deomid "rojer" Ryabkov
1bf3ad2426 MQTT ping fixes
* Actually drop the connection when no response to ping arrives within the next interval.
 * Avoid sending immediate ping when wall time is adjusted, it's usually spurious.

PUBLISHED_FROM=8049280b58edfb94dd0fcb6a1e89ffefe69bcea1
2020-02-11 08:04:02 +00:00
Deomid "rojer" Ryabkov
7153690016 Keep the size of the structure the same in non-SSL build
PUBLISHED_FROM=8f93bee72bc18efff64354203ee6268f4f8e8768
2020-01-31 11:01:35 +00:00
Deomid "rojer" Ryabkov
f00b3a2b3a Move ssl_if_data to the end of mg_connection
PUBLISHED_FROM=4fb65477b03bedc3206ac286e8236f0f9536f20e
2020-01-31 09:48:30 +00:00
Deomid Ryabkov
1e9fabe1ca Fix handling of WS handshake error response
Check response code, make sure it's 101.
Pass http_message to the client to keep it appraised.
This represents a slight change in the API -
in case of an error MG_EV_WEBSOCKET_HANDSHAKE_DONE will now be delivered where previosuly connection would just hang.
Clients that do not examine the argument may for a moment think handshake has succeeded but in fact connection will be closed immediately.

CL: mg: Fix handling of WS handshake error response

PUBLISHED_FROM=645a43d9e5bee216e54411f85827c9b974e9a7d1
2019-02-14 21:19:34 +00:00
Deomid Ryabkov
e2dfac946d Ensure that user sees all the data before connection is closed
If user throttles receive by setting recv_mbuf_limit,
after the net interface reports connection as closed we must wait
for data to trickle through before disposing of it.
There can still b data in the buffers (e.g. SSL).

CL: mg: Ensure that user sees all the data before connection is closed

PUBLISHED_FROM=22be0fa368950a9fdb03cfb00febc7c0a1674b01
2018-12-10 21:04:49 +00:00
Бобби
c198d2e5f1 Make MG_CTL_MSG_MESSAGE_SIZE overridable
CL: Make MG_CTL_MSG_MESSAGE_SIZE overridable

Fix https://github.com/cesanta/mongoose/pull/987

PUBLISHED_FROM=b0a7c67297b98f616c9eadcd3c34b8747939c918
2018-12-07 10:04:00 +00:00
Deomid Ryabkov
9a70abef24 Add mbuf_append_and_free() and mbuf_move()
CL: Add mbuf_append_and_free() and mbuf_move()

PUBLISHED_FROM=bdf73906dd93b2ebeace160596508e15480b54b4
2018-12-05 21:49:01 +00:00
Deomid Ryabkov
53e1c469a2 Add ability for multipart data handler to provide pushback
It can specify how much data was actually processed and the rest will be re-delivered on next poll.

CL: mg: Add ability for multipart data handler to provide pushback

PUBLISHED_FROM=e0168c5064c3a32921c9209bc09f4da2079cd616
2018-12-05 16:02:56 +00:00
Deomid Ryabkov
15b361fbac Add mbuf_clear()
PUBLISHED_FROM=754b98b3000b24ad3b3d9cc0b4c480ca005a1c3f
2018-11-23 15:50:55 +00:00
Sergey Lyubka
1adea37c45 Integrate https://github.com/cesanta/mongoose/pull/667, fix documentation
CL: Integrate https://github.com/cesanta/mongoose/pull/667, fix documentation

PUBLISHED_FROM=80a939fc3276b89c29716e7373f674dba86769ee
2018-09-20 15:34:36 +00:00
Sergey Lyubka
291fc024cd Docs nits
CL: Docs nits

PUBLISHED_FROM=1a2fc8080d94673acf300c6f07aba3a1e6272295
2018-09-14 08:03:58 +00:00
Deomid Ryabkov
421e099f2b Refactor mg polling
* Change return type of mg_mgr_poll to return number of events
 * Add mg_mgr_min_timer
 * Refactor main poll loop to remove LwIP-specific stuff

CL: Refactor mg polling

PUBLISHED_FROM=dc94618b32fa3c84a2f053bd04d134297780ec82
2018-09-06 06:34:18 +00:00
Deomid Ryabkov
e89be2e944 Add mg_url_encode_opt()
CL: Add `mg_url_encode_opt()` - a parametrized version of `mg_url_encode()`

PUBLISHED_FROM=17fa57a7a5325b51b6e3aef3855eac4e82c35782
2018-04-10 11:04:31 +00:00
Dmitry Frank
b9b20c6494 Implement mg_http_parse_header2()
Which is a replacement of (deprecated) `mg_http_parse_header`, but,
similarly to `asprintf`, allocates a new buffer if the client-provided
one is not large enough.

Also use it throughout mongoose code, and thus some header-related
limitations are removed; in particular,
https://github.com/cesanta/mongoose/issues/813 is fixed.

CL: Mongoose Web Server: Deprecate `mg_http_parse_header()` and implement `mg_http_parse_header2()` instead, which allocates a new buffer if the client-provided one is not large enough (similarly to `asprintf`).
CL: Mongoose Web Server: Fix limitations of header value lengths, e.g. when parsing authentication headers such as nonce, etc.

PUBLISHED_FROM=c75b1bbbbdb294ea85075ce69b1368f115fdd1ef
2018-02-07 23:04:29 +00:00
Dmitry Frank
3eb4eb8074 Fix mongoose docs generation
PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
2018-02-03 01:20:48 +02:00
Dmitry Frank
aba60dadec Add mg_ prefix to mongoose sources
CL: none

PUBLISHED_FROM=d6ebe5fa88c61ae3b8569897d9b09d54610bec73
2018-02-03 01:20:47 +02:00
Dmitry Frank
f29457e967 Remove tunneling from mongoose
CL: Mongoose Web Server: Remove tunneling functionality which was used by nobody

PUBLISHED_FROM=38b9e8ae7b0a5a1dbba5cff4074843dc681267d3
2018-02-02 21:50:13 +00:00
Dmitry Frank
47abc641f1 Fix nonce in digest authentication
CL: Mongoose Web Server: Digest authentication: Fix nonce validity check (expired nonce or nonce from the future did not cause the the check to fail)
CL: Mongoose Web Server: Digest authentication: Fix nonce request value; it worked before because nonce validity check was broken as well
CL: Mongoose Web Server: Digest authentication: Add `nonce` argument to `mg_http_create_digest_auth_header()`: clients should use the value received from the server's authentication request.

Resolves https://github.com/cesanta/mongoose/issues/809

PUBLISHED_FROM=5e59f90ed6b2a4311ed6763159da81c2aaf6af4c
2018-02-01 22:05:43 +00:00
Dmitry Frank
7519b2ef3a Improve websocket implementation
CL: Mongoose Web Server: Websocket: Respond to Ping with Pong
CL: Mongoose Web Server: Websocket: Properly close a connection with Close frame (in response to a client's close and when protocol failure is detected)
CL: Mongoose Web Server: Websocket: Fix support of fragmented messages
CL: Mongoose Web Server: Websocket: Add support for control frames interjected in the middle of a fragmented message

PUBLISHED_FROM=e2b3794aaacc64633540c493194cccc62afa2077
2018-02-01 13:20:19 +00:00
Dmitry Frank
ddd35c0cba Fail if authn file is configured but doesn't exist
PUBLISHED_FROM=2c176091ffb6c7c5cfe8ea4f05b6109e00b33383
2017-11-28 19:35:22 +00:00
Dmitry Frank
9ab6d084df Expose digest auth checking functions
PUBLISHED_FROM=1bfc6e332f56b68eb6155bb729a97a0d8d5a316c
2017-11-28 10:05:36 +00:00
Бобби
6e3e5560d0 Move mongoose docs to https://cesanta.com/docs/
PUBLISHED_FROM=ebf5568abe82952ab2751298185a10189098013f
2017-10-16 15:18:24 +00:00
Dmitry Frank
d4b55c4ceb Separate digest auth from HTTP headers parsing
PUBLISHED_FROM=f97569ae2f31ab94ce4875eae4d0a198f719c388
2017-08-22 19:51:53 +00:00
Deomid Ryabkov
0fba87c755 Make mg_url_encode public
Change the API to heap-allocate the string and get rid of a bunch of fat stack buffers.

PUBLISHED_FROM=c793dc64a9a044a9769d92ea16859f5d704a2181
2017-07-21 12:06:52 +00:00
Sergey Lyubka
944a6b761c Fix https://github.com/cesanta/mongoose/pull/824
PUBLISHED_FROM=ed2c39b9e00a7374af7fed5af0c9acd6c330334a
2017-07-17 14:28:35 +00:00
Sergey Lyubka
f1ae183752 Fix https://github.com/cesanta/mongoose/pull/829
PUBLISHED_FROM=6e56c250fe62010e25b6ed489c0d608163ba629c
2017-07-17 14:28:34 +00:00
Dmitry Frank
3e59e1c465 Fix formatting
PUBLISHED_FROM=1803e726eee7bb64496d70389655083eb70257ab
2017-07-02 20:05:53 +00:00
Sergey Lyubka
ae611a6e55 Clean up v7 from mongoose
PUBLISHED_FROM=efa9cc3aaf0c5ae8841e029370f882b615cebf1b
2017-07-01 08:51:09 +00:00
Sergey Lyubka
244e5f67d3 Commonize pattern matching functions
PUBLISHED_FROM=e69e298a51dbe0f9c47184169ecad06eef0676fc
2017-06-28 18:35:37 +00:00
Sergey Lyubka
8d76733fad Make mg_conn_addr_to_str return len
Also amend api_net.js to use returned length.

PUBLISHED_FROM=38e15f9587edf28049c5b9e5f126b4db159910e8
2017-06-26 21:02:02 +00:00
Deomid Ryabkov
023b55f2e5 MQTT client keep alive fixes
- Move keep alive management up to the Mongoose library
 - Only outgoing control messgaes should reset keepalive timer
 - Add unit test

https://forum.mongoose-os.com/discussion/1155/mqtt-keep-alive-compliance-issue

PUBLISHED_FROM=f86e30744ded53a6f7f96afec066b4ff3b4372c0
2017-06-04 21:50:23 +00:00
Sergey Lyubka
cfe77a3d58 Move struct http_message::body
Rationale: this is the optimisation to make JS FFI-ed API
work nicer. We don't have strucuture introspection now,
and do not generate offsets automatially. Thus, using a
stable well-known location of the parsed message body is
better, in case of number of HTTP headers macro changes.

PUBLISHED_FROM=55bf25ac77060a9c81dfecd6601f037562530801
2017-05-06 11:26:53 +00:00
Deomid Ryabkov
189cd8c5f6 Add mg_assemble_uri
PUBLISHED_FROM=533e134a48e0fca55509c3eb16b0a6b64c1188e8
2017-04-27 13:50:33 +00:00
Deomid Ryabkov
83fe5a17f3 Make mg_connect_{http,ws} use mg_parse_uri
Remove the specialized URI parser, clean up code a bit.

Fix parsing of URIs with IPv6 hosts (http://[2001:2:3::4]:567/)

PUBLISHED_FROM=968ad97585d928123106ce3828920ee073113f83
2017-04-24 14:59:52 +00:00
Ruslan Valiullin
6926655513 add to cgi doc note about zombies
PUBLISHED_FROM=fb1796f11a595befd160bd5ab1088b6e39f16757
2017-04-15 06:44:43 +00:00
Alexander Alashkin
8b67274cc0 Fix mg_get_http_var retval
PUBLISHED_FROM=257deff5ea20302627e77a0f29cf2359276a41d4
2017-03-24 13:24:37 +00:00
Alexander Alashkin
2fb145d39d Fix DISABLE_MD5 and DISABLE_SHA1 naming
PUBLISHED_FROM=2babde0d0c6add14aa500f4bf1c833715d979c6c
2017-03-21 10:24:11 +00:00
Yiming Sun
14094aaef7 Fix typo
PUBLISHED_FROM=56fdeaf4965ef26c398267c8656735bb52e45085
2017-03-21 08:50:43 +00:00
Alexander Alashkin
380e87ddfa Honor DNS server from DHCP
PUBLISHED_FROM=10772301ef115c31ada3521ff4235c33a421b782
2017-03-20 09:53:12 +00:00
Dmitry Frank
bf7dd7ac63 Add separate userdata for each http endpoint hdlr
PUBLISHED_FROM=29a204c2c7f35724b6f1e8435edb94869da2362c
2017-03-15 17:43:19 +00:00
Dmitry Frank
0fc3370859 First step towards separate userdata argument
PUBLISHED_FROM=93fe1cc2c5e2513509511a81e5919cbd37056b10
2017-03-15 00:52:59 +00:00
Deomid Ryabkov
d3a8862bd8 Make interface vtables const
Frees up a bit of ram on ESP

PUBLISHED_FROM=0ea046cc63704481bca138b3096937669b94733d
2017-03-11 00:11:56 +00:00
Alexander Alashkin
920e8d9145 Add shims for mongoose file operations
PUBLISHED_FROM=b5b12cdf4273f21dbcdac9bfb6a06063152914c9
2017-03-01 10:06:47 +00:00
Alexander Alashkin
b5dd54a404 Fix doc typos
PUBLISHED_FROM=1bdacf793b35ebe70d0a3a9d64260dd2bd135c73
2017-03-01 06:19:58 +00:00
Yiming Sun
f7c0a2ee15 Fix server_example.md
PUBLISHED_FROM=dfbfeaae983daa0412964ac0402759f632bf7aeb
2017-02-28 11:05:31 +00:00
Yiming Sun
874b5bfdbf Fix comment in mongoose.h
PUBLISHED_FROM=35e8f18aa611b45c271d0178d9197291bfa9726d
2017-02-28 10:50:21 +00:00
Yiming Sun
71d09722be Fix http_client doc
PUBLISHED_FROM=f415ddbac47e3069d3ab29467a23f6b8dab0066f
2017-02-27 20:20:33 +00:00
Dmitry Frank
3942914945 Fix subscription to wildcard topics
`mg_mqtt_match_topic_expression()` and friends are public now.

So far, only `#` is supported.

PUBLISHED_FROM=20c031bcf34be84771c4a9c456318634eb9a517c
2017-02-24 14:21:33 +00:00
Deomid Ryabkov
d4b23f08b6 Implement client support for TLS-PSK
For both OpenSSL and mbedTLS

PUBLISHED_FROM=0bfd5f128b4c4c062cb6f0ca0da9b30790aa8bf8
2017-02-15 08:20:53 +00:00
Deomid Ryabkov
fc113d64f5 Add mg_hexdumpf: mg_hexdump that outputs to a file
PUBLISHED_FROM=f0fe58c9f01ef0c7b491ed0e5f51b983e4119507
2017-02-09 10:33:33 +00:00
Alexander Alashkin
d39969d1e6 Restore links to mongoose/examples
PUBLISHED_FROM=67dc5d1ed30dc2500032be73dcdb214bd62c59d0
2017-02-06 14:09:01 +00:00
Sergey Lyubka
e81f8373a2 Update mongoose docs
PUBLISHED_FROM=cfd0018a5824c5ccac532558be86c17cda64ce50
2017-02-02 14:24:49 +00:00
Alexander Alashkin
707b9ed2d6 Remove mg_enable_multithreading. Close cesanta/dev#6511
PUBLISHED_FROM=7864ffa26cb553f5d4a93248f67c288327ec23b0
2017-01-30 13:55:49 +00:00
Deomid Ryabkov
67626d49c9 Add ssl_cipher_suites to mg_{bind,connect}_opts
Optional specification of SSL/TLS cipher suites.

PUBLISHED_FROM=e8968c6c7a92f10514d3ee575c2fb9be862e6cf8
2017-01-09 23:53:00 +00:00
Alexander Alashkin
e79121acb7 Fix link in documentation
PUBLISHED_FROM=d4337a442a8f5728826eb109bdca41ca03a18d2a
2017-01-09 17:03:46 +00:00
Dmitry Frank
0c79fcfbd0 Add a flag to prevent a tunnel from reconnection
Also fixed a memory leak on reconnect: previously, each reconnect was
creating a `struct mg_connection` which was never reclaimed

PUBLISHED_FROM=eefdcf557e032ac81d5ed3aba55ac912e400148e
2016-11-25 11:36:14 +00:00
Marko Mikulicic
a23daa1547 Move mg_a*printf to common
PUBLISHED_FROM=cccd28ef43ec4e08fa52340ce78bda10db5ac27a
2016-11-18 15:36:00 +00:00
Marko Mikulicic
fc635a9340 Move mg_ncasecmp and sister to common string utils
PUBLISHED_FROM=182c43c3bd82190cb816c8ebaddccc13a94950d0
2016-11-17 11:21:17 +00:00
Marko Mikulicic
3c5d48ea13 Promote tun example to a unit test
PUBLISHED_FROM=0454cdeec5c7120eb4bf905fdd5b7abdcb4003c2
2016-11-14 18:06:04 +00:00
Sergey Lyubka
a0d98b7a39 Fix msvc6 build
PUBLISHED_FROM=196199fd02ec9b20d1e76d1414bfafa624f9ebce
2016-11-14 17:51:07 +00:00
Deomid Ryabkov
f67fe352cf Pull out common SSL interface
Currently only OpenSSL API impl, but the plan is to add more.

PUBLISHED_FROM=c85b26fa2312047768bdcf3eca583e60862aba90
2016-11-11 20:51:01 +00:00
Marko Mikulicic
e1a9ad7f82 Overload mg_bind to bind to tunnel
PUBLISHED_FROM=f554cc63dfea12455fe5e428c6ce5f3152774f8e
2016-11-10 13:07:17 +00:00
Marko Mikulicic
1889e12b54 Support username:pass authority in HTTP/WS urls
PUBLISHED_FROM=39a1c2a271c5cd961670e11c830105c17ba0b2e4
2016-11-10 11:21:43 +00:00
Marko Mikulicic
5045dfab74 Mongoose TCP tunnel
PUBLISHED_FROM=f03b963aaec02574e47c28ee8033551440b94f2d
2016-11-09 15:05:46 +00:00
Alexander Alashkin
d0c50632cd Fixes in MQTT for AWS support
PUBLISHED_FROM=2b82f3793b3c6d0cf1266e4cc0e67930f43002c5
2016-11-09 10:05:40 +00:00
Marko Mikulicic
fffb54e2c6 Implementing MG interfaces
PUBLISHED_FROM=46496c2d5340a0bbe4fe1c6c9ff187bc65d2d35f
2016-11-08 22:36:13 +00:00
Alexander Alashkin
cd778396ff Update mg_coap_add_option doc
PUBLISHED_FROM=cded8f36e2833e7c256ba6cbca0ebf1f6012dee7
2016-11-03 17:20:55 +00:00
Dmitry Frank
0798b72470 Add names to mg_event_handler_t's args
PUBLISHED_FROM=3caea25dec11260561349fa096547bd62ecdb509
2016-11-01 23:25:18 +00:00
Alexander Alashkin
e62dc8f3b2 Handle MG_EV_CLOSE in examples
PUBLISHED_FROM=57c62a4123a54ecb455dbf91f3fe562fb0cf2ec2
2016-11-01 08:58:38 +00:00
Sergey Lyubka
f1b4f0c463 Fix SEGFAULT in MQTT server
PUBLISHED_FROM=6455082726781aab819a7f8645e81adaa7fc7669
2016-10-28 14:12:40 +00:00
Deomid Ryabkov
5c9f463cab Add MG_EV_HTTP_MULTIPART_REQUEST_END
This event is sent at the end of the request

PUBLISHED_FROM=0b841a26320e3edbf73126e2ed8d286d4e5f3fa8
2016-10-27 18:09:57 +00:00
Sergey Lyubka
3a8f47befd Mqtt: parsing auth info in the connect message
PUBLISHED_FROM=017e707ea2bd7b1d1972fbb92e5d98c74e17e9d0
2016-10-27 17:53:17 +00:00
Marko Mikulicic
a4c668e37a Expose reverse proxy API for dynamic mounts
PUBLISHED_FROM=00772400bce7c15368d91741092ebc8ab0842e19
2016-10-27 12:08:05 +00:00
Marko Mikulicic
900bbe724a Mongoose forwarding
PUBLISHED_FROM=51652f0157bb951a43508f0fe948c62c351e96ba
2016-10-26 14:52:10 +00:00
Deomid Ryabkov
c6b5343c9b Target CC3200 example to production device
PUBLISHED_FROM=623dda0737c8426754044880713c1283c4b181b6
2016-10-26 10:39:04 +00:00
Sergey Lyubka
7f4e2a93d0 Sort docs API entries alphabetically
PUBLISHED_FROM=73ef8ae768585d3c204e6e022848f49e8f4a8de2
2016-10-26 08:28:07 +00:00
Deomid Ryabkov
a17eae4142 Enable MQTT client by default
PUBLISHED_FROM=cb5d5afe166f637082d4b1d1bce5d9c263e91fd0
2016-10-18 15:51:31 +00:00
Deomid Ryabkov
7b05d70042 CS_P_ESP_LWIP -> CS_P_ESP8266;add CS_P_NXP_KINETIS
LWIP part has been finally fully split from the ESP part, and ESP
platform defs reduced to bare minimum. It is now possible to use LWIP
in either low-level or socket mode without any ESP dependencies,
and NXP Kinetis platform is the first to make use of it.

PUBLISHED_FROM=4a9055897609c812296bdab5b4943ffde641ced2
2016-10-18 12:38:06 +00:00
Deomid Ryabkov
492dcdca8d MG_DISABLE_(DNS|(_SYNC)?_RESOLVER) -> MG_ENABLE_$1
Disable sync resolver by default.

PUBLISHED_FROM=dbaed194e5fe211c07564fe6880649a1aee7f662
2016-10-17 19:21:46 +00:00
Deomid Ryabkov
4ef3a778c1 Introduce MG_NET_IF var, replaces MG_NET_IF_*
Possible values:
  MG_NET_IF_SOCKET (1) - traditional BSD socket API
  MG_NET_IF_SIMPLELINK (2) - TI's SimpleLink socket interface
  MG_NET_IF_LWIP_LOW_LEVEL - a net_if implementation that uses LWIP's
    low-level API, when LWIP_SOCKET is not available.

PUBLISHED_FROM=a5c0aebb7b6bdb1f1f4cb3210763d16f3ab5e133
2016-10-17 18:21:58 +00:00
Deomid Ryabkov
37e4f51668 MG_DISABLE_SOCKETPAIR -> MG_ENABLE_BROADCAST
PUBLISHED_FROM=81b6289a4b54043df557142f0de8cc66bc5190d4
2016-10-17 04:07:06 +00:00
Deomid Ryabkov
1dae0373c8 MG_DISABLE_POPEN -> MG_ENABLE_HTTP_SSI_EXEC
PUBLISHED_FROM=55b2b70a688234f6ebcfba37eced20ee5d5387a1
2016-10-16 23:21:56 +00:00
Deomid Ryabkov
e928f36456 MG_DISABLE_HTTP(|_SSI|_WEBSOCKET) -> MG_ENABLE$1
Factor out SSI and WS code from http.c

HTTP + WS are enabled by default, but MQTT is built without HTTP
support as a compilation test.

PUBLISHED_FROM=925ed9a55abb193ed7deac1c9675a0e5b35dca50
2016-10-14 17:06:19 +00:00
Deomid Ryabkov
241090a82b CS_DISABLE_(STDIO|HEXDUMP) -> CS_ENABLE_$1
PUBLISHED_FROM=9fd0cebfa8df53b5d9574a8d013305ddda5e7a18
2016-10-14 10:22:30 +00:00
Deomid Ryabkov
3b69f5d500 MG_DISABLE_DAV -> MG_ENABLE_HTTP_WEBDAV
PUBLISHED_FROM=62267ea0a8e10d8ba7bad590d1a56b179bcffce9
2016-10-14 07:06:13 +00:00
Deomid Ryabkov
b298d46a40 MG_DISABLE_MQTT -> MG_ENABLE_MQTT
PUBLISHED_FROM=34e6028b68e286f81be7ba0f8ae73b760f144131
2016-10-13 21:08:22 +00:00
Deomid Ryabkov
bafc30bec6 Change from using #ifdef to #if for features tests
"#if FOO" still works with simple -DFOO, but gives more flexibility.
Specifically, if user expressed no preference (FOO is not defined),
we can apply reasonable defaults (this is the legitimate use of ifdef).

In short, from now on, please use

 #if MG_ENABLE_FOO

instead of

 #ifdef MG_ENABLE_FOO

Since we are all used to #ifdef, this change also adds a precommit check
to police this. Specifically, in *.h and *.c files that are Copyright Cesanta,
"ifdef" and "if defined()" are not allowed to be used with macros that contain
ENABLE or DISABLE, unless the like also contains "ifdef-ok".

Hence, if you are sure you want to use ifdef, use this:

 #ifdef MG_ENABLE_FOO /* ifdef-ok */

PUBLISHED_FROM=9be829448f53cff575d6cae8b9945fb12531c15a
2016-10-13 18:07:25 +00:00
Deomid Ryabkov
f9a6403b11 Add MG_EV_SSI_CALL_CTX
This is the variant of MG_EV_SSI_CALL with context of the SSI call being
processed in addition to the tag argument. Specifically, call handler
now gets access to the HTTP request and the name of the file being processed.

MG_EV_SSI_CALL is preserved for backward compatibility.

PUBLISHED_FROM=eeea7487c062505abdb23b6f64994ff7a6b60ff8
2016-10-04 23:51:29 +00:00
Deomid Ryabkov
8b12263dbc Fix mg_http_send_redirect doc
PUBLISHED_FROM=77cd3df9959b0e3a2550d1581586e69878bbee0d
2016-09-30 13:06:39 +00:00
Deomid Ryabkov
460d95afc5 Add mg_http_send_redirect and make examples use it
PUBLISHED_FROM=f45e06aeba1c00212078d539b6f74cb8bd054326
2016-09-30 11:22:00 +00:00
Alexander Alashkin
fecb11f2fa Add CoAP server example doc. Closes cesanta/dev#4917
PUBLISHED_FROM=ee7728db61721c0628a00ed702a47f7382ad7cd7
2016-09-29 11:50:59 +00:00
Alexander Alashkin
56e50c2dbe Add CoAP client example doc
PUBLISHED_FROM=51fd5cd50ae8c9fce43d95d06fec2e7582018d00
2016-09-29 11:05:59 +00:00
Marko Mikulicic
286fa90ee9 Simple mDNS + DNS-SD impl
Main TODOs:
1. the spec requires the impl to resend the reply once and
   to send gratuitous updates

2. advertise our clubby services as DNS-SD sub-services.

---

Tested with:

1. https://play.google.com/store/apps/details?id=com.grokkt.android.bonjour&hl=en
2. https://play.google.com/store/apps/details?id=com.druk.bonjour.browser&hl=en
3. osx `dns-sd`

Works well enough; it doesn't have some glitches due the fact that we
don't retransmit yet and we don't send gratuitous updates.

PUBLISHED_FROM=38d7a50beb274d4aeeda5b0b58e44dfa0789da84
2016-09-28 08:51:47 +00:00
Sergey Lyubka
d6dda04f4f Update mg_mgr docstring
PUBLISHED_FROM=da57dfe52e315dc1901d761289f0445be6e93cea
2016-09-13 11:37:47 +00:00
Artem Bulavin
1b0825ef4b Docs deployment via docs/make_doc
PUBLISHED_FROM=da5f7f80a9876ac4f1889a1176a3048f47980659
2016-09-13 11:37:46 +00:00
Sergey Lyubka
7249b2bd5f Update mg_mgr docstring
PUBLISHED_FROM=da57dfe52e315dc1901d761289f0445be6e93cea
2016-09-13 11:36:17 +00:00
Alexander Alashkin
4cbf81da59 Use user timeout in multithreading polling
PUBLISHED_FROM=dbf75bfba087f1b0aa0531e5003ba3e69ed1a6ab
2016-09-12 14:21:05 +00:00
Alexander Alashkin
d9b7ec18e7 Add MG_F_ENABLE_BROADCAST option
PUBLISHED_FROM=293a54ab09e6879b6f0c36975a137eeaeff92098
2016-09-12 12:36:56 +00:00
Dmitry Frank
2a541175b5 Use void arguments list consistently in C code
On my way, fixed a couple of cases where we had `()` in the header, and
non-empty argument list in the source file.

PUBLISHED_FROM=5519526cf84e2bbd425a726fcc112fea1a95cbf1
2016-09-05 15:51:19 +00:00
Sergey Lyubka
3640554503 Add DNS server example
PUBLISHED_FROM=0d71533fd475c152c29fe304ca95559512a6059d
2016-09-02 21:06:16 +00:00
Sergey Lyubka
12437fd7fe Refactor Mongoose documentation
PUBLISHED_FROM=e9a4e5c7b4a1d03b93a2a79e29de19e60e919929
2016-09-01 14:35:02 +00:00
Deomid Ryabkov
5fa544fc78 Make mg_http_serve_file public
A way to serve a single, specific file as opposed to the hairy monster
that is mg_serve_http.

PUBLISHED_FROM=6ed1bc487b9d41d212a5907337182f23b040aecf
2016-08-09 10:51:02 +00:00
Dmitry Frank
7b48859f8d Fix mongoose comment a little
PUBLISHED_FROM=542e7c82fa494bef52222495301ab53dce43cd8f
2016-08-04 19:51:10 +00:00
Dmitry Frank
e5da7440d7 Bring back JS precompilation to CC3200
We haven't actually _fixed_ evaluation of precompiled bcode from
non-mmapped memory: we just never free it. For sane use case (do not
evaluate the same file more than once) it should be acceptable.

PUBLISHED_FROM=a9ca2d8fa72e9c40c93415d060ee8db697caa225
2016-07-26 15:36:00 +00:00
Dmitry Frank
849ec1684a Apply Mongoose docs edits by Ev
PUBLISHED_FROM=5cd78790a03580aa23dd3d2d8b825ad449083cc2
2016-07-26 15:06:04 +00:00
Alexander Alashkin
4f210cd8eb Fix error messages and more
PUBLISHED_FROM=11c57fc5ece01686e9cecab5e3bfce54a2825836
2016-07-25 17:21:23 +00:00
Evelyn
285f75764c Update mg_match_prefix.md 2016-07-25 17:37:20 +01:00
Evelyn
3586203753 Update mg_next_comma_list_entry.md 2016-07-25 17:36:46 +01:00
Alexander Alashkin
e406de7e00 Remove extra error message
PUBLISHED_FROM=8b7fcfc1bc32ff9ff38e2904ddb730c83bf9fae4
2016-07-25 16:36:18 +00:00
Evelyn
53ed8502c9 Update mg_is_big_endian.md 2016-07-25 17:35:41 +01:00
Evelyn
ac8c756879 Update mg_avprintf.md 2016-07-25 17:35:27 +01:00
Evelyn
07faacdaf9 Update mg_hexdump_connection.md 2016-07-25 17:34:35 +01:00
Evelyn
8464844518 Update mg_hexdump.md 2016-07-25 17:34:03 +01:00
Evelyn
fe2d1ff027 Update mg_sock_addr_to_str.md 2016-07-25 17:33:17 +01:00
Evelyn
8d129e359e Update mg_conn_addr_to_str.md 2016-07-25 17:33:03 +01:00
Evelyn
39aa56457b Update mg_start_thread.md 2016-07-25 17:32:22 +01:00
Evelyn
8491d5da8b Update mg_open.md 2016-07-25 17:31:57 +01:00
Evelyn
681196e2c8 Update mg_fopen.md 2016-07-25 17:31:43 +01:00
Evelyn
836ad5ebab Update mg_stat.md 2016-07-25 17:31:28 +01:00