Namely, define it if only `MG_ENABLE_HTTP_STREAMING_MULTIPART` and
`MG_ENABLE_FILESYSTEM` are on
PUBLISHED_FROM=3094738a4b76ceb09a3c2374e8d9d914b71c3441
Assume handshake request was declined if either MG_F_CLOSE_IMMEDIATELY _or_ MG_F_SEND_AND_CLOSE is set.
PUBLISHED_FROM=60af32a3f8890e826205465b9add2f58b1d46e5f
Renegotiation is disabled, so we don't need them.
Reduces per-connection usage when idle by 3K.
PUBLISHED_FROM=24b2ac9557107f7da412dae6a42257c9b7c812d5
- Only allow one TCP segment in flight. Each segment is 1.5K and it
adds up. This may increase latency, but memory is precious on ESP.
At teh same time, optimize use of tcp_output: do not send a new segment
on every write, only call tcp_output at the end of connection
processing during poll.
- Build LWIP with DNS disabled. We have our won resolver, and LWIP's
allocates large static buffers (1K).
- mbedTLS: Deallocate peer's certificate at the end of SSL handshake,
reduces idle SSL connection footprint by ~1.5K.
Some tweaks to the heap log viewer (which made all the above possible).
PUBLISHED_FROM=6e84bba64eacb2d737561e09313918104921ea80
Also performs trnasparent SPIFFS -> SLFS cert copy.
If the file's extension is .pem, convert it to DER format and put on SLFS.
PUBLISHED_FROM=364caab21969ca28a05802c4dde93a11d1e0feda
Also fixed a memory leak on reconnect: previously, each reconnect was
creating a `struct mg_connection` which was never reclaimed
PUBLISHED_FROM=eefdcf557e032ac81d5ed3aba55ac912e400148e
The only client of `mg_http_common_url_parse` (namely,
`mg_connect_http_base`) expects `port_i` to be the index in the address
string at which the port was added.
PUBLISHED_FROM=b095926b5485e4674e3c59ff8481171831fb61ae
If the path starts with /, do not drop it.
There are no directories on SLFS, but use of /pretend/paths/to/files.txt
is common. What we do drop is the ./ prefix (added by mongoose when document_root=.)
PUBLISHED_FROM=5108bc078dfaf8f8afa4db554b4769d9d7b8a103
It wasn't checked for `NULL`, and on CC3200 NULL dereferencing addresses
doesn't cause a crash, so it worked by pure luck: ctx->ssl_key was 0.
After `mg_` to `miot_` refactoring it's not the case anymore (presumably
because linker arranged objects in a different order), so this bug shown
up.
PUBLISHED_FROM=0f1cc73a078c18432c68ae0f9b14dd06b3bb4279
in light of the root cause discovered by rojer
and addressed in cesanta/dev#5882 for the http connection code path.
PUBLISHED_FROM=aea563150a0411cbe3fdc6f7911529f3136cc76f
Long-lived UDP "connections" i.e. interactions that involve more
than one request and response are rare, most are transactional:
response is sent and the "connection" is closed. Or - should be.
But users (including ourselves) tend to forget about that part,
because UDP is connectionless and one does not think about
processing a UDP request as handling a connection that needs to be
closed. Thus, we begin with SEND_AND_CLOSE flag set, which should
be a reasonable default for most use cases, but it is possible to
turn it off the connection should be kept alive after processing.
PUBLISHED_FROM=1677d8024aa9afa7e18d8a04d829b699f7f2f103
* Make kr_{send,recv} report status via return code instaed of errno
* Move mg_if_* recv and connect callback invocation out of LWIP
callbacks: these can be nested and we don't want that to happen
to our callbacks. Instead, we post events for the event manager to
process during next poll.
PUBLISHED_FROM=9b3c1de796fae381dea1641807e51d7a897a398e
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
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
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
"#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
esp_mg_net_if was a rat's nest of mongoose net_if and event manager
implementaions and the event loop task for the ESP8266 miot port.
From that, pieces that are related to LWIP support have been pulled out,
separated into net_if and event manager files, and event loop task
has been moved under the miot esp8266 dirrectory.
This is done to facilitate LWIP code reuse. This may not be the end of
it, but it's a start.
Note: custom retransmit logic has been removed for now. Can be
reintroduced later is necessary.
PUBLISHED_FROM=fd5bbf75714583ce95776d4c76b6c5b5dc535364
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
Make paths embedded in amalgamated files nice and relative.
This facilitates subsequent clean un- and re-amalgamation.
PUBLISHED_FROM=d83e6000617c54ceaeb78b80c25814996043fe66
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
It was observed that sl_Send can return SL_EAGAIN, despite the fact that
we only call write_to_socket if it was reported as writeable.
PUBLISHED_FROM=e4cbacb3f16bb7abb479222d7dcbfbe113a39161
Complete rewrite of the C Clubby implementation: it is now modeled after
the Go implementation, with a slight difference that codec and channel
are the same object (something we should probably do in Go as well, as
we only have a single type of channel so far, which is used with all
types of codecs).
This implementation also comes with a new external API,
which is hopefully cleaner and easier to use (see mg_clubby.h).
In this PR I am not adding any new types of channels, but a UART channel
as well as websocket listener channel will be added after this lands.
PUBLISHED_FROM=d545d4bb6434e2a02ad159f9e4b64e594a4797e7
So that socket/connection/whatever is really closed by the time user code is run.
Speed up test_http_endpoints by using appropriate wait conditions.
PUBLISHED_FROM=5fc8a772cc2a9c3b8c9dbddde9f99b41ce4d334c
Do not use CA bundle on CC3200, it doesn't work.
Make ssl_ca_cert = "*" mean "no verification" and make sure
SSL is enabled on the connection when it's required, even w/o verification.
PUBLISHED_FROM=c8710a5d24ecfe174ef45b7f81c114d41faf5c12
Newlib implements rename as _link and _unlink, not _rename.
There is no _link on either SLFS or SPIFFS, so override rename directly.
PUBLISHED_FROM=ebb54664f8a3c8664ecab1fac021bef286a0e230
SimpleLink restart invalidates all sockets.
Listeners are restarted, outgoing connections are closed.
PUBLISHED_FROM=15567dfb822bffbd44d39ba0e69a7ac64fd7a1c8