Commit Graph

2481 Commits

Author SHA1 Message Date
Alexander Alashkin
81f738af3f Fix mg_http_common_url_parse
PUBLISHED_FROM=51c44c445309aa0850b227949a0a0a6be433d08c
2016-11-17 11:05:57 +00:00
Alexander Alashkin
f6165d23e4 Fix stack overflow in mg_hexdump
PUBLISHED_FROM=5025692f3f4593b3ea38af51f8f49e1ac4df6b88
2016-11-16 17:36:14 +00:00
Alexander Alashkin
e4a4b6f260 Fix coredump in mg_tun_destroy_client
PUBLISHED_FROM=56ff5afe805e4680e02183a8c3887ea60ee5ebfe
2016-11-16 12:21:31 +00:00
Dmitry Frank
0ceee1dc05 Rename mg_ -> miot_ under fw
`MG_ENABLE_...` macros are not yet renamed because it involves some
logic change: e.g.  instead of defining `MG_ENABLE_MQTT`, one should
define `MIOT_ENABLE_MQTT`, which should imply `MG_ENABLE_MQTT` as well.

Macro refactoring is going to be done in another PR.

PUBLISHED_FROM=f8b66d5772846126b94223a729a6bd87897f8de6
2016-11-15 14:36:10 +00:00
Alexander Alashkin
8a6cf95fad Fix mg_match_prefix
PUBLISHED_FROM=4fdfa61e7b3b62083b0ac8fe74dd2dd3793f50fe
2016-11-15 13:36:31 +00:00
Dmitry Frank
37a7031f4e Minor formatting fix
PUBLISHED_FROM=c56b4ae00c454e6931ab29b095641bf0222f860c
2016-11-15 09:51:14 +00:00
Dmitry Frank
8874f3de9d Fix simplelink SSL context
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
2016-11-15 09:06:03 +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
Marko Mikulicic
74b75899d3 Make cc3200 sprintf workaround smaller
in light of the root cause discovered by rojer
and addressed in cesanta/dev#5882 for the http connection code path.

PUBLISHED_FROM=aea563150a0411cbe3fdc6f7911529f3136cc76f
2016-11-14 17:06:31 +00:00
Deomid Ryabkov
240eca0b68 Avoid passing NULL to %.*s
CC3200 (TI's C library) doesn't like it

https://e2e.ti.com/support/development_tools/compiler/f/343/t/554883

PUBLISHED_FROM=d0e9fb7ebb7d189d1a76451d609f1f1861c7a837
2016-11-14 16:20:08 +00:00
Marko Mikulicic
cd54b18de3 After establishing tun, remove http proto handler
PUBLISHED_FROM=8449d4df2a4caf7afc0f9b50f85bb01d79b8c4eb
2016-11-14 16:20:04 +00:00
Deomid Ryabkov
65e01dbabc Initial support for mbedTLS
PUBLISHED_FROM=edb1063d3fd64e3c732f16b8bf101c065cdacddd
2016-11-14 16:20:02 +00:00
Deomid Ryabkov
62276ce63e Add digital signature to test key usage; 2048 bit
Digital signature key usage is required for the key to be used for (EC)DHE.

PUBLISHED_FROM=b33366d484aff2c478b2f44b85dba33d04d3a808
2016-11-14 16:20:01 +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
4805797752 Fix hexdump memory overflow
PUBLISHED_FROM=a6f3f33432ce43b6d4462de623ba61a53e7f18df
2016-11-11 16:05:53 +00:00
Marko Mikulicic
4c038508f2 Extract tun proto name constant
PUBLISHED_FROM=574362ea7d90a17cd49963a430559824cfcff802
2016-11-11 10:06:02 +00:00
Marko Mikulicic
15db11c0e6 Fix tunnel teardown
PUBLISHED_FROM=2c23e4a4dfc7129da657c5935f06335fc022394a
2016-11-11 08:21:37 +00:00
Deomid Ryabkov
97fe505bb4 clang-format more stuff in common
PUBLISHED_FROM=8b5c6f70d5582402f327c4da7baee7cc15ee13aa
2016-11-10 23:50:42 +00:00
Deomid Ryabkov
fd45a6d31b CS_LOG_TS_DIFF -> CS_LOG_ENABLE_TS_DIFF; ifdef->if
PUBLISHED_FROM=48c8d4326ea8a24edd8d1ca011be9e7643219084
2016-11-10 16:21:28 +00:00
Marko Mikulicic
e1a9ad7f82 Overload mg_bind to bind to tunnel
PUBLISHED_FROM=f554cc63dfea12455fe5e428c6ce5f3152774f8e
2016-11-10 13:07:17 +00:00
Deomid Ryabkov
296affc6e4 Make Krypton define KR_VERSION; use it to detect
PUBLISHED_FROM=ea039cdc30aec44db074871ff6b2d2582f98b5c9
2016-11-10 11:50:56 +00:00
Marko Mikulicic
1889e12b54 Support username:pass authority in HTTP/WS urls
PUBLISHED_FROM=39a1c2a271c5cd961670e11c830105c17ba0b2e4
2016-11-10 11:21:43 +00:00
Sergey Lyubka
5e91d919e0 Make mg_register_http_endpoint work for websocket
PUBLISHED_FROM=5bf5a007929b3b6275121f3cf949526e881fb482
2016-11-09 17:21:38 +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
499a7d6a37 Fix mg_is_error
PUBLISHED_FROM=80481f8dbcb93d04eee51ecc6366949420a61f2f
2016-11-09 13:50:52 +00:00
Alexander Alashkin
f72c3fa9a7 Unbreak PIC32 compilation. Close cesanta/dev#5807
PUBLISHED_FROM=cfd7de45e4357a17719501b8ab004c2edbd3e87e
2016-11-09 11:21:02 +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
Deomid Ryabkov
dbe976ad3e Disable parallel builds of the Tiva example
Causes issues on Windows - looks like "parallel" makefiles
do not handle spaces in directory names properly.

PUBLISHED_FROM=5d83e737e9f81041db21fd82c32146471eac1764
2016-11-07 14:05:46 +00:00
Deomid Ryabkov
9a8a6b53ae Minor fix to the LPC example
PUBLISHED_FROM=3a99921093957c2ba9c1a0938fa00b3a29784d81
2016-11-06 02:20:43 +00:00
Dmitry Frank
84132b7b2a Add readme for nRF51 example
And pre-create directories for SDK for both nRF51 and nRF52.

PUBLISHED_FROM=00caf156f48da92804c6af8efe323535fbc5497d
2016-11-04 19:35:50 +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
76bb35d5db Adjust udp_recv callback type for nRF5x
PUBLISHED_FROM=66db56192ae710e3f865fef47593b49e0ed4f133
2016-11-04 17:35:37 +00:00
Dmitry Frank
0187f297d1 Make nRF51 example work with GCC
Unfortunately it turns out Nordic's examples were able to build with GCC
just because they suppressed all warnings; I had to do the same here
because there are some macro redefinitions of arm-none-eabi-gcc and
lwip.

TODO: resolve that and do not suppress warnings.

PUBLISHED_FROM=e65c7b0f2451f85765d958d7f67eb9262f7bc929
2016-11-04 12:20:35 +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
39a17f8a72 Add text msgs for HTTP status codes 400 and 503
PUBLISHED_FROM=1bd3308933354e147c4e8aa375728a1ede6d8ab4
2016-11-01 18:10:46 +00:00
Deomid Ryabkov
78454da3b3 BREAKING: Set MG_F_SEND_AND_CLOSE on UDP conns
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
2016-11-01 14:26:00 +00:00
Alexander Alashkin
e62dc8f3b2 Handle MG_EV_CLOSE in examples
PUBLISHED_FROM=57c62a4123a54ecb455dbf91f3fe562fb0cf2ec2
2016-11-01 08:58:38 +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
6a12bd7abc Wrap LOG and DBG in do { ... } while(0)
PUBLISHED_FROM=c4f3d44ed16dba60db3198b90478c1b2e6f2a5c1
2016-10-31 20:11:37 +00:00
Deomid Ryabkov
b39e30fb0c Example LPCXpresso project for NXP LPC4088
PUBLISHED_FROM=ec4c4ec1ca7fee10c67fbba5a603d59fe44a046d
2016-10-31 13:02:01 +00:00