* 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
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
cs_log_set_filter() is removed in favor of cs_log_set_file_level() which
allows setting log verbosity of individual files and/or lines.
E.g.: `mg_=1,mjs=1,=4` - level for for everything except mjs and mongoose.
We use the fact that we are usually pretty careful with our file names and use prefixes consistently.
In mos, `debug.file_level` sets the option on boot and `Sys.SetDebug` is updated to parse `file_level` option to change it at runtime.
CL: Log file:line instead of function; add cs_log_set_file_level()
PUBLISHED_FROM=49f18d4d0d3dd224865129a4f8fe6cccd1d9bc12
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
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
Can be used for cases where device has no networking but mongoose is still needed for its event loop.
CL: mg: Add net_if_null, a no-op net interface
PUBLISHED_FROM=e79b4a8667508bbde1437dda9dad77ce3a3aa630
* 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
A major cleanup, disentangling net_if and ssl_if.
Pulled a lot of common logic into the core and reduced size of net_if implementations.
CL: Mongoose net_if and ssl_if refactoring
PUBLISHED_FROM=29bd4dcb264a1fd96b3dd164e2d880e1c2c0921e
* Limit total amount of headroom, in absolute terms (`MBUF_SIZE_MAX_HEADROOM`).
* If unable to allocate with headroom, fall back to allocating the required minimum.
* For mOS, set default `MBUF_SIZE_MULTIPLIER` to 2 to avoid floating point operations.
Since max headroom size is now capped to 128 bytes, this will not result in much of a bloat.
PUBLISHED_FROM=11d4fc65a46a805bb7c8960f89a3d0b753c58bb8
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
In certain files it was necessary to make tests work from public
mongoose repo, so this commit makes things consistent.
PUBLISHED_FROM=694454d0ff007229c65d524a2a2beaf126420f15
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