Commit Graph

2546 Commits

Author SHA1 Message Date
Dmitry Frank
ac921d4657 Improve includes in the amalgamation script
Now it also tries to find the included file relatively to the "parent"
file. This is required for amalgamation of the frozen into mjs, since
`frozen.c` includes `frozen.h` instead of `frozen/frozen.h`.

PUBLISHED_FROM=8f670a1509a30cfdfb22e454b7851f4cf28fb98d
2017-01-13 00:24:43 +00:00
Alexander Alashkin
f046434f3b c_hello/stm32-cube, part 2
PUBLISHED_FROM=1f767c1383c1dcd366e667681aebd41c30a102f3
2017-01-11 23:07:59 +00:00
Alexander Alashkin
58b9ee41fa Use LWIP in stm32/cube
PUBLISHED_FROM=da389ddabf96918fd1bc022e0696dbb4542c71c1
2017-01-11 12:37:44 +00:00
Alexander Alashkin
d28d7a67f2 c_hello/stm32-cube, part 2
PUBLISHED_FROM=fe7230811b7f12286c5ac6de1ef8fb068cd61145
2017-01-10 18:38:24 +00:00
Deomid Ryabkov
20370e65d6 Fix parsing of SSL cipher suite specs for mbedtls
The list of cipher suites must be retained while the context is alive.

PUBLISHED_FROM=a3a82e42c1214c54ae1a40fbc49bc26bca32c053
2017-01-10 13:38:08 +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
Deomid Ryabkov
cd9e179fcb Format for previous commit
PUBLISHED_FROM=609ef3587e4293b0cdbf865cfc466bbb85233361
2017-01-09 17:04:03 +00:00
Deomid Ryabkov
0ba28e6153 Raise verbosity of some log messages
These are not spammy and help debug issues with serving files

PUBLISHED_FROM=84b0ee174314373d472678a14ca87f575fda6e14
2017-01-09 17:04:02 +00:00
Alexander Alashkin
de791765b2 c_hello for STM32/cube, part 1
PUBLISHED_FROM=13fe18cb6c92e5dd6d9e319c35e256e2b206a110
2017-01-09 17:03:57 +00:00
Alexander Alashkin
e79121acb7 Fix link in documentation
PUBLISHED_FROM=d4337a442a8f5728826eb109bdca41ca03a18d2a
2017-01-09 17:03:46 +00:00
Dmitry Frank
4bdec5c1c1 Rename mongoose-iot to mongoose-os
URLs like mongoose-iot.com are left intact

PUBLISHED_FROM=b8502b163c26a2cb54598db57ba094333fe7cf54
2017-01-09 17:03:38 +00:00
Deomid Ryabkov
fa39d2f2fa Remove a dead submodule entry
PUBLISHED_FROM=0b6e19e41c12675a487cb61c4f6e0aaba0be0758
2016-12-23 15:37:41 +00:00
Deomid Ryabkov
c55d06ed57 Add directory listing support ot ESP32
PUBLISHED_FROM=336d6b28d6165ece75d25911058ffdd075a3c191
2016-12-23 12:37:07 +00:00
Deomid Ryabkov
3829873552 Support MIOT app builds for ESP32
PUBLISHED_FROM=44bcbb87c326a4e05e96dc0b094fd9dd1a9d4276
2016-12-21 21:47:06 +00:00
Deomid Ryabkov
54ebcc5bd8 Minor fixes to socket support when used with LWIP
- LWIP UDP sockets are always writable and they are not reported as
   such by select() (bug? featuyre?). TCP sockets are ok.
 - Always deliver MG_EV_POLL, whether we have other fd_events or not.
   Otherwise MG_EV_POLL would not be delivered at all to perma-writable
   UDP sockets (as they are on LWIP).
 - Ignore EAGAIN/EWOULDBLOCK errors while connecting, this happens
   during SSL handshake.

PUBLISHED_FROM=3b1ee0d2b0c672512da5c9d6141aba1112983426
2016-12-21 13:06:21 +00:00
Deomid Ryabkov
7782500dbb Commonize bitbang I2C master and use it in ESP32
Until issues with hardware I2C are resolved

PUBLISHED_FROM=78bced9f18b5bfbf547de06f813bf98c82eea6ea
2016-12-20 16:05:58 +00:00
novlean
86ec6bb2f8 updated for mOS 2016-12-20 14:59:08 +00:00
Alexander Alashkin
02499d672b Build c_mqtt/stm32 - part 1, with stubs
PUBLISHED_FROM=de4b9f3e9eeafa75bb8919abacd86fb23fdefc1b
2016-12-15 14:06:50 +00:00
Alexander Alashkin
8c2e641ed7 Simplest c_hello/stm32
PUBLISHED_FROM=3a22eb96ff011ef8327cd1b78b56a3af86ba2c84
2016-12-14 16:22:16 +00:00
Dmitry Frank
29c53082eb In cs_simplelink, check if MG_NET_IF is defined
PUBLISHED_FROM=20c87885c8f778139d3df20507d6870070bcc787
2016-12-14 13:21:54 +00:00
Deomid Ryabkov
2fa988fc7b Bring up main task, start MG loop and load config
PUBLISHED_FROM=7c81ec28457cda3a503e4ab01fc8593e474df4b8
2016-12-13 17:51:33 +00:00
Alexander Alashkin
72f1d444d3 Fix miot compilation in C++ mode
PUBLISHED_FROM=42997efb3ddc462c33d2cf7e8ef0e922797d9901
2016-12-13 15:21:26 +00:00
Deomid Ryabkov
7dcc94202d SPIFFS libc integration refactoring; ESP32 support
Factor out common part of SPIFFS libc interface support from the CC3200
port and reuse it for ESP32. Minor cleanups.

PUBLISHED_FROM=19ad4049372f83046abd8eba29cfc7c2cc405671
2016-12-13 10:37:09 +00:00
Sergey Lyubka
a447ae5eab MQTT parsing fix
PUBLISHED_FROM=41f43cb0e707259740de3346308f746c2a3778fd
2016-12-13 10:37:06 +00:00
Dmitry Frank
54ad1e4e47 Prepare pic32 docker image and xc32 makefile
This PR does not include `fw/platforms/pic32` since it's too dirty.

PUBLISHED_FROM=db50ba389202da80355aafe5f2c1ceeca7bffe41
2016-12-12 21:35:49 +00:00
Deomid Ryabkov
39ea91cfc2 Test building with MG_ENABLE_FILESYSTEM=0
Fix errors so it builds.

PUBLISHED_FROM=db9fc9ef997d6b1847117e8db9aefdc7e540f4cc
2016-12-09 23:35:54 +00:00
Dmitry Frank
5ebff5d15e Rename pic32_harmony -> pic32
PUBLISHED_FROM=00ca7b2adabde94a683ac4d33be1f2bdbb17772f
2016-12-09 22:06:14 +00:00
Dmitry Frank
731512a947 Define mg_file_upload_handler() only if needed
Namely, define it if only `MG_ENABLE_HTTP_STREAMING_MULTIPART` and
`MG_ENABLE_FILESYSTEM` are on

PUBLISHED_FROM=3094738a4b76ceb09a3c2374e8d9d914b71c3441
2016-12-09 16:06:17 +00:00
Alexander Alashkin
304dbca63d Fix miot-mbed errors and warning, part 3
PUBLISHED_FROM=2f6fb7ea5abdcd4ca9b06956172938ee3bc28459
2016-12-09 12:36:00 +00:00
Dmitry Frank
18ff0fafe0 Implement stringify macro
And use it for `FW_ARCHITECTURE`. This is needed because with
Microchip's xc32, `-DFOO=\"bar\"` results in `FOO` being `bar`, not
`"bar"`, so we have to stringify differently.

PUBLISHED_FROM=d0aeebb55ef9e0e92a7f750104cd6600e0d9c636
2016-12-08 22:22:24 +00:00
Alexander Alashkin
25de791424 Fix miot-mbed compilation, part 2
PUBLISHED_FROM=bd87b901b7c1c1a4f9b0f875f0b024b672121d4a
2016-12-08 19:21:53 +00:00
Alexander Alashkin
6e88c9cfd1 Fix WEAK redefinition in mbed
PUBLISHED_FROM=6abc158f198f5bd032e5ab06cc0ba3373434cdbe
2016-12-08 16:21:37 +00:00
Marko Mikulicic
9937e88985 Fix comparisons
PUBLISHED_FROM=4d86de7f73ef9d4c0f236e1fe1201e5de792f19f
2016-12-07 18:05:56 +00:00
Sergey Lyubka
57f964a139 Add mqtt last will
PUBLISHED_FROM=fb856714ead67390dfd7ce9d208ae5ae19ce7c6d
2016-12-07 17:21:56 +00:00
Dmitry Frank
cbd5835112 Include sys/types.h for PIC32 port
On PIC32MZ, this is required to get `ntohl` and friends.

PUBLISHED_FROM=82ab532cd3757df6f79215f3eaca90cd87f6c965
2016-12-02 16:06:42 +00:00
Alexander Alashkin
fba32acb73 Replace memcmp with strncmp in mongoose
PUBLISHED_FROM=3c5859f06ab838bba7c95c4878c4e7e883329810
2016-12-02 13:51:30 +00:00
Sergey Lyubka
2fdb1f78a2 Fix amalgamation conflicts: POC
PUBLISHED_FROM=5b63325ade34b9032476fc88ac407816990f1cfc
2016-12-01 22:21:14 +00:00
Alexander Alashkin
ea2069df51 Fix coredump in mg_reverse_proxy_handler
PUBLISHED_FROM=ca0ae588290f133ef7640ca538847a63c0cb544b
2016-12-01 09:21:11 +00:00
Alexander Alashkin
7267fc757d Fix mg_stat
PUBLISHED_FROM=e6fb19c5256b6d43359f21b325e16b415152f26f
2016-11-29 13:36:55 +00:00
Alexander Alashkin
ea7d69060d Replace fopen with mg_fopen
PUBLISHED_FROM=764ea806a5d31bd545a5d99de80e2ee0234ebcab
2016-11-29 13:36:54 +00:00
Alexander Alashkin
6e5e2eb694 Restore HTTP errors descriptions
PUBLISHED_FROM=26becdaf7dd61481b88b166ea87d44a7bc796660
2016-11-29 11:22:06 +00:00
Deomid Ryabkov
51466df7b9 Check for SEND_AND_CLOSE after HANDSHAKE_REQUEST
Assume handshake request was declined if either MG_F_CLOSE_IMMEDIATELY _or_ MG_F_SEND_AND_CLOSE is set.

PUBLISHED_FROM=60af32a3f8890e826205465b9add2f58b1d46e5f
2016-11-28 15:51:14 +00:00
Deomid Ryabkov
d6259332d4 Fix use-after-free
Free keys and cert before conf, not after

PUBLISHED_FROM=5628f56eb6973a779179d641fb425d0f14db39cf
2016-11-28 15:21:18 +00:00
Deomid Ryabkov
260229a4d1 Free certs and keys on client TLS connections
Renegotiation is disabled, so we don't need them.
Reduces per-connection usage when idle by 3K.

PUBLISHED_FROM=24b2ac9557107f7da412dae6a42257c9b7c812d5
2016-11-28 12:05:41 +00:00
Deomid Ryabkov
7776df241c Enable server name verification on mbedTLS
PUBLISHED_FROM=54774944d5402a5d6a351b4609428940c0ad20ea
2016-11-28 08:50:42 +00:00
Deomid Ryabkov
e17fdcb077 Minor memory shavings on ESP8266; ~2.5K less
- 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
2016-11-27 17:21:29 +00:00
Deomid Ryabkov
d96629cdf4 Add support for PEM certs on SimpleLink
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
2016-11-25 19:30:05 +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
Alexander Alashkin
9125830de6 Fix stkovf in mg_resolve_async_opt
PUBLISHED_FROM=8e37c51c6b0bf7d0782f3a997360827471b95d2e
2016-11-25 08:21:38 +00:00
Alexander Alashkin
55963d0c9a Fix typo in platforms_esp
PUBLISHED_FROM=b17ef5bc8ec801fca91c89af5f97767a55911952
2016-11-24 13:21:09 +00:00