Commit Graph

539 Commits

Author SHA1 Message Date
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
Sergey Lyubka
cd9c7dcbec Correct negative AAAA answer with NSEC RR
PUBLISHED_FROM=c7e3132d55e603f159019e3f0290e01b189e75e0
2017-04-19 12:57:45 +00:00
Deomid Ryabkov
f868fc861b Enable hosts and resolv.conf lookups on UNIX only
Not relevant for other platforms

PUBLISHED_FROM=65b8959ee677555e2fb330c84d443e0a93d9fd1c
2017-04-18 22:39:24 +00:00
Deomid Ryabkov
7f259f2a79 Add optional digest auth to mOS HTTP server
If http.auth_{domain,file} are configured, all HTTP requests require valid digest authorization header.
This applies to files served by mg_http_serve as well as synamic endpoints such as /update and /rpc.

mongoose-os#229

PUBLISHED_FROM=824d594147cfeb2428b463d24478b207839aa5e2
2017-04-11 10:39:45 +00:00
Alexander Alashkin
57a4ec31d1 Fix MinGW compilation
PUBLISHED_FROM=66b2dee87dc50de5f2891dee789beec89c3f6fb4
2017-03-30 12:18:56 +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
Alexander Alashkin
e9a7a2af18 Fix WinCE compilation
PUBLISHED_FROM=51d68829414739b04fafc9198d86b817c38d71d2
2017-03-17 15:19:29 +00:00
Deomid Ryabkov
a83e7d8c42 Properly shut down the SSL connection
By sending close_notify

PUBLISHED_FROM=028a001cb9470a16cc7a6544805bfb042a435779
2017-03-15 23:12:57 +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
874b5bfdbf Fix comment in mongoose.h
PUBLISHED_FROM=35e8f18aa611b45c271d0178d9197291bfa9726d
2017-02-28 10:50:21 +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
66a96410d4 ESP8266: Add RTOS SDK port (MGOS_ESP8266_RTOS=1)
PUBLISHED_FROM=ca5332e63700274ed9aeea9d9d1802e89fa788fa
2017-02-16 11:05:34 +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
6b923bdff1 Add stm32/cube to hwtests
PUBLISHED_FROM=478792d0479ba2154f0a65eea066f6ae6f235f84
2017-02-06 17:25:16 +00:00
Alexander Alashkin
707b9ed2d6 Remove mg_enable_multithreading. Close cesanta/dev#6511
PUBLISHED_FROM=7864ffa26cb553f5d4a93248f67c288327ec23b0
2017-01-30 13:55:49 +00:00
Alexander Alashkin
b8c3740446 Map STM32 pins to MOS pins
PUBLISHED_FROM=6724de19c28f972a785b0d5e7dd4b41889e04850
2017-01-25 09:08:43 +00:00
Deomid Ryabkov
7bdbd80552 Fix ESP32 encr. OTA; clean up {open,read,close}dir
Fixed a bunch of things to make OTA work on ESP32 with flash encryption:
writes to app aprtitions must be 32-byte aligned and mod 32 in size.
When merging filesystems during update, use spiffs_vfs_* functions so
that old fs is properly decrypted.

Refactored cs_dirent stuff: SPIFFS support moved to spiffs_vfs.c,
added dirent.h on ESP8266 and CC3200 which includes cs_dirent.h
Define DIR and dirent only if asked (ESP8266, CC3200, WIN32).

PUBLISHED_FROM=58b0d05cdc41b1a9e02d341e2a1cdcb012829232
2017-01-24 12:53:35 +00:00
Alexander Alashkin
577ad2599c Enable additional services for stm32/cube
PUBLISHED_FROM=b22a136bc630b7cf4a62fd9d91b85e0e939a7f82
2017-01-18 15:10:28 +00:00
Alexander Alashkin
4d9f8168b8 Change Mongoose version to 6.7
PUBLISHED_FROM=e18f33e14f4c0e1cb004aa264dd64ca5a0056190
2017-01-17 09:08:53 +00:00
Deomid Ryabkov
f1d0b451b1 ESP32: Update esp-idf
cesanta/esp-idf is rebased onto espressif/esp-idf#aece3d6fc62fd91d3c5a87e0ab2ddb5ac51d8ff0

A few wifi changes and VFS support for directory-related functions.

PUBLISHED_FROM=7823db802945122aa1b5453da8abd8e380cbf2fa
2017-01-13 00:44:47 +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
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
de791765b2 c_hello for STM32/cube, part 1
PUBLISHED_FROM=13fe18cb6c92e5dd6d9e319c35e256e2b206a110
2017-01-09 17:03:57 +00:00
Alexander Alashkin
02499d672b Build c_mqtt/stm32 - part 1, with stubs
PUBLISHED_FROM=de4b9f3e9eeafa75bb8919abacd86fb23fdefc1b
2016-12-15 14:06:50 +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
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
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
Sergey Lyubka
2fdb1f78a2 Fix amalgamation conflicts: POC
PUBLISHED_FROM=5b63325ade34b9032476fc88ac407816990f1cfc
2016-12-01 22:21:14 +00:00
Alexander Alashkin
7267fc757d Fix mg_stat
PUBLISHED_FROM=e6fb19c5256b6d43359f21b325e16b415152f26f
2016-11-29 13:36:55 +00:00
Alexander Alashkin
6e5e2eb694 Restore HTTP errors descriptions
PUBLISHED_FROM=26becdaf7dd61481b88b166ea87d44a7bc796660
2016-11-29 11:22:06 +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
55963d0c9a Fix typo in platforms_esp
PUBLISHED_FROM=b17ef5bc8ec801fca91c89af5f97767a55911952
2016-11-24 13:21:09 +00:00
Alexander Alashkin
9e517fde00 Implement SNTP client
PUBLISHED_FROM=ac54bcbc81a9ee688e8b90e261172be76a9fbacd
2016-11-24 09:51:58 +00:00
Marko Mikulicic
39b0b8e2fd Fix clang formatting
PUBLISHED_FROM=ea64670e42ae58bbe26abee5d928f2afcd83bd46
2016-11-23 08:06:09 +00:00
Ilia Penev
a8f54d1851 Integrate PR170
PUBLISHED_FROM=f1a804466bea6d6d77103525d76ef7b819b63477
2016-11-22 08:05:55 +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
65e01dbabc Initial support for mbedTLS
PUBLISHED_FROM=edb1063d3fd64e3c732f16b8bf101c065cdacddd
2016-11-14 16:20:02 +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
Deomid Ryabkov
97fe505bb4 clang-format more stuff in common
PUBLISHED_FROM=8b5c6f70d5582402f327c4da7baee7cc15ee13aa
2016-11-10 23:50:42 +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
5934846852 Make mg_tun_bind take separate user+pass
PUBLISHED_FROM=3ee9478275c4b9253b1dd4f98a69cecc89290bce
2016-11-09 15:51:08 +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
Deomid Ryabkov
8bf3bd48a6 Include sys/param.h on UNIX (to get PATH_MAX)
PUBLISHED_FROM=774764f9d316e111912dae1fcaf2933141c59a60
2016-11-07 16:36:05 +00:00
Dmitry Frank
e69a7a1b25 Enable warnings on nRF5x examples
Now all warnings are disabled on SDK files, and enabled on our
application's files.

Fixed a couple of things in nRF52 which were unnoticed because all
warnings were disabled there from the beginning.

PUBLISHED_FROM=a33ab22d0ce85efea364b80478986b88f4b0a3a2
2016-11-04 19:05:54 +00:00
Dmitry Frank
7f2bdc217a Fix nRF51 compiler flag for GCC
PUBLISHED_FROM=f8b4e8650d72c2ec5525e0510fbc8a80f8645a14
2016-11-04 18:05:42 +00:00
Dmitry Frank
6ff49dc196 Fix nRF51 example and add RTT support to it
Now it works in hardware.

PUBLISHED_FROM=f223bde2d2bebe97513ce073eb887552bc3d93af
2016-11-03 22:50:36 +00:00
Alexander Alashkin
cd778396ff Update mg_coap_add_option doc
PUBLISHED_FROM=cded8f36e2833e7c256ba6cbca0ebf1f6012dee7
2016-11-03 17:20:55 +00:00
Marko Mikulicic
0dcb50d39c Fix doc for MG_EV_WEBSOCKET_HANDSHAKE_REQUEST
PUBLISHED_FROM=79d3bc5ba7887e2126b64d2ea804c62606264ce2
2016-11-02 23:50:36 +00:00
Deomid Ryabkov
fd763846e5 TI Tiva TM4C129 support and example project
PUBLISHED_FROM=c3d59657adff247f565bf0be59192e32d5d0bbf6
2016-11-02 18:55:04 +00:00
Alexander Alashkin
f4f310cf51 Add WinCE example, update Mongoose for WinCE6.0
PUBLISHED_FROM=2a76ccddb62b63caeaca3785a07d7d0b94125eaf
2016-11-02 10:11:20 +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
Deomid Ryabkov
e99088348d Use ICACHE_FLASH to guess CS_P_ESP8266
Also, do not require -DRTOS_SDK and pick socket/low-level event manager
based on LWIP_SOCKET.

PUBLISHED_FROM=d4afbdf8dab62a1c6ac4ca075c4a58887223dba4
2016-10-31 22:57:59 +00:00
Deomid Ryabkov
92b15395a4 Add CS_P_NXP_LPC - platform def for NXP LPC MCUs
PUBLISHED_FROM=d6ed793313a98545d5a89faafc8526b658ffff66
2016-10-28 18:12:08 +00:00
Sergey Lyubka
f1b4f0c463 Fix SEGFAULT in MQTT server
PUBLISHED_FROM=6455082726781aab819a7f8645e81adaa7fc7669
2016-10-28 14:12:40 +00:00
Dmitry Frank
c04e3f80b9 Make mongoose compile for nRF51
PUBLISHED_FROM=6af3ed56802d2619f673c36059370440a0c06397
2016-10-28 11:08:09 +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
Alexander Alashkin
06b430e57f PIC32 Harmony TCP/IP support basics
PUBLISHED_FROM=31f8f61de954fa3a36ebad162bdb730c0db95b58
2016-10-26 12:00:13 +00:00
Sergey Lyubka
99377bdd30 Fix user registration flow
PUBLISHED_FROM=bac8c10063215f7f7163f607213d15a3c5f81552
2016-10-26 11:02:09 +00:00
Dmitry Frank
e3bac87016 Make mongoose compile with ARMCC
(It compiles, but doesn't really work yet)

PUBLISHED_FROM=0382d355a343bdab9c9eeed87229efe90c30c40b
2016-10-25 09:56:40 +00:00
Marko Mikulicic
1f09505248 Fix byte order defines under OSX
PUBLISHED_FROM=327a8d729519aa0ad953594a32d63fddac4d1ec9
2016-10-25 08:34:47 +00:00
Dmitry Frank
8d72c2a7b2 Add HTTP example for nRF
PUBLISHED_FROM=d9d979057d5269ac32d16545dd2489485bda642a
2016-10-24 11:13:26 +00:00
Alexander Alashkin
c722cfec18 Fix c++11 mg compilation
PUBLISHED_FROM=a121a15698884203a573741e73fefaa5923dce4d
2016-10-22 14:32:00 +00:00
Marko Mikulicic
e08b234326 ARM mbed STM32+cc3100 demo
PUBLISHED_FROM=edf899f7493b70660006fd605f0301a44cd16356
2016-10-21 10:16:47 +00:00
Marko Mikulicic
5bd3df7a0f Fix mg_time on mbed and make DNS work around epoch
PUBLISHED_FROM=c1aeef9dc25baba794b3269b44441c5bafbca5a8
2016-10-20 22:36:39 +00:00
Dmitry Frank
85d6292b8f Add nRF port for Mongoose
Example is not yet added

PUBLISHED_FROM=2732386091a0d4cd8d4c6e64dc16467780ec72a5
2016-10-19 19:22:15 +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
Alexander Alashkin
4216cf2ac1 Enable FS for WinCE
PUBLISHED_FROM=ec3ed105e29251bdd9b8ad08e8e56c0873ced8ae
2016-10-17 09:22:32 +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
Alexander Alashkin
fcb94a1742 Port Mongoose to WinCE, part I
PUBLISHED_FROM=292d73fa3e90377b1f929ae47ae1073dab5a4089
2016-10-14 13:37:07 +00:00
Deomid Ryabkov
8ff010ca0f MG_DISABLE_FILESYSTEM -> MG_ENABLE_FILESYSTEM
PUBLISHED_FROM=026810475d98df117ab1dadf40276759190aad19
2016-10-14 12:37:13 +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
75059d1bdc Rename MG_DISABLE_CGI -> MG_ENABLE_CGI
Also factor out CGI-related code from http.c, it's getting too big.

Build tests with -Wundef

PUBLISHED_FROM=a1e82fafba73812c249db0b49c59d1b48417b60d
2016-10-13 19:22:50 +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
Alexander Alashkin
0a8f839281 Mongoose 6.6
PUBLISHED_FROM=23d031720d8d6e170eab6bd615797f33e36a6701
2016-10-12 10:06:27 +00:00
Deomid Ryabkov
ab48174bac esp_mg_net_if refactoring: split LWIP & ESP parts
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
2016-10-11 18:38:10 +00:00
Marko Mikulicic
4439251f17 Add MBED as platform
Currently this allows V7 to be built on MBED; more
work is likely required to port mongoose.

PUBLISHED_FROM=32cd0a38349c8e9019af46d4ce7e1429e660db25
2016-10-11 10:29:41 +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
Alexander Alashkin
376d2666a5 Add PIC32MX/CC3100 mqtt_client example
PUBLISHED_FROM=cda885a9dc5d1203b7b59b13ea7fd7934b31260a
2016-09-30 12:39:35 +00:00
Deomid Ryabkov
d90622630f Link MIOT for Linux statically
PUBLISHED_FROM=4f0adab828ebf06dbc3e0c4333bf0053f374b62f
2016-09-30 12:39:32 +00:00
Alexander Alashkin
da447b1067 Add PIC32MX/CC3100 mqtt_client example
PUBLISHED_FROM=cda885a9dc5d1203b7b59b13ea7fd7934b31260a
2016-09-30 12:37:08 +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
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
Deomid Ryabkov
4d76a3be4c Amalgamation changes - clean up paths
Make paths embedded in amalgamated files nice and relative.
This facilitates subsequent clean un- and re-amalgamation.

PUBLISHED_FROM=d83e6000617c54ceaeb78b80c25814996043fe66
2016-09-27 05:06:32 +00:00
Deomid Ryabkov
7414a4fb06 Stop pretending that sl_* API is BSD-compatible
PUBLISHED_FROM=355fea9a5a75ac926d4c64d41828ebcd96c04080
2016-09-22 19:51:06 +00:00
Alexander Alashkin
6746933a3d Fix Windows compilation
PUBLISHED_FROM=04bcd98025263f32d337730cf179bdfc35b683f1
2016-09-15 12:21:53 +00:00
Dmitry Frank
8cb2833fa7 Implement miot dev call
PUBLISHED_FROM=40d62ce03a4f739b458076395941e4ad7c932fb3
2016-09-15 12:21:52 +00:00
Alexander Alashkin
1730f3c0c9 Fix Windows compilation
PUBLISHED_FROM=04bcd98025263f32d337730cf179bdfc35b683f1
2016-09-15 12:21:21 +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
238bf1a29e Fix MSVC2015 warnings in mongoose
PUBLISHED_FROM=9e2d5c45d112b9e9493d995b12fe989e93d66d5b
2016-09-13 08:51:20 +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
Alexander Alashkin
5f93f7162f Add STM32F4/CC3100 example & Co
PUBLISHED_FROM=7f805d89dcb795c9b3ee637ef1dbdcfcf3323469
2016-09-05 15:06:21 +00:00
Sergey Lyubka
12437fd7fe Refactor Mongoose documentation
PUBLISHED_FROM=e9a4e5c7b4a1d03b93a2a79e29de19e60e919929
2016-09-01 14:35:02 +00:00
Deomid Ryabkov
0fe9ec1499 C Clubby refactoring
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
2016-08-29 11:20:54 +00:00
Artem Bulavin
fd839f1827 Pointer to int casting warning
PUBLISHED_FROM=6bf2a710edaae6133d68eaf900ede14bba75ad5a
2016-08-19 09:05:55 +00:00
Alexander Alashkin
f149f4aab1 Remove cs_dbg.h from amalgamated headers
PUBLISHED_FROM=993c4b1bec363e3f7975b83710e694792bedf5b3
2016-08-18 14:06:18 +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
849ec1684a Apply Mongoose docs edits by Ev
PUBLISHED_FROM=5cd78790a03580aa23dd3d2d8b825ad449083cc2
2016-07-26 15:06:04 +00:00
Deomid Ryabkov
15643f8e67 Use rand() instead of random(), it's more standard
Remove the random() stubs from the codebase

PUBLISHED_FROM=0f56ec7dffa0af1f5061a17d8801239d6f0e32a5
2016-07-22 11:06:16 +00:00
Deomid Ryabkov
b987df1974 Refactor sys_config and ro_vars
Use the same config mechanism for ro_vars as for sys_config, get rid of a bunch of custom code.

PUBLISHED_FROM=d2be76cb97090669dd6a21e95d0ba821eaa1a313
2016-07-21 16:35:59 +00:00
Marko Mikulicic
e91a7c9599 Reamalgam after .h edits
PUBLISHED_FROM=da1faa9b46cd0ff22dcba6d324b5847c4a0d42d8
2016-07-21 15:06:41 +00:00
Sergey Lyubka
810eab9a58 Add SSI doc string
PUBLISHED_FROM=73540bf103672916eae35959d5e992a3616a6604
2016-07-20 11:07:37 +00:00
Deomid Ryabkov
9f78a2902b Fix SSL stuff
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
2016-07-14 13:19:55 +00:00
Alexander Alashkin
68dd8d277d Get rid of ubjson
PUBLISHED_FROM=e6f1dca95ec7ed3795adf493cca9cdcdc07381f5
2016-07-12 20:49:59 +00:00
Deomid Ryabkov
36a1927915 Mongoose 6.5
PUBLISHED_FROM=d151a5a0bf34b135a7a2c879f5a6bd5676af275a
2016-07-12 13:20:04 +00:00
Deomid Ryabkov
c907e6c5fb Commonize mg_str
PUBLISHED_FROM=0e6a1c1a2356c1e12580e498c64ba7be367f601c
2016-07-06 23:49:57 +00:00
Deomid Ryabkov
29b3950ee7 Handle SimpleLink restarts in Mongoose
SimpleLink restart invalidates all sockets.
Listeners are restarted, outgoing connections are closed.

PUBLISHED_FROM=15567dfb822bffbd44d39ba0e69a7ac64fd7a1c8
2016-07-06 13:56:50 +00:00
Sergey Lyubka
b7a0748312 Ditch JSON-RPC from mongoose
PUBLISHED_FROM=89b978c02be2f10eb930ff13673d45249fd67763
2016-07-01 11:35:18 +00:00
rojer
1d4f97bb4c SimpleLink net_if impl w/ async support; MG_F_SSL
SimpleLink sockets are suffciently different from BSD that all the
ifdefs have become too messy to warrant a separate net_if
implementation. As part of this we also implement proper async connect
support.

Added MG_F_SSL to identify SSL-enabled connections in a generic way,
since SSL state can be different depending on the implementation.

PUBLISHED_FROM=9cdb8c880b90683e4a26b972cf439d47d6f60917
2016-06-09 17:49:53 +00:00