Commit Graph

1341 Commits

Author SHA1 Message Date
Dmitry Frank
f78ee9d42e Don't ignore non-merge commits when publishing
Merge commits are not explicitly ignored either: they're just naturally
ignored as empty commits.

PUBLISHED_FROM=2c814104eedd76ee90813488277ecaaf2baf6315
2017-05-28 13:22:48 +00:00
Deomid Ryabkov
c8416cc17d NULL out name server field properly
Fixes https://github.com/cesanta/mongoose-os/issues/260

PUBLISHED_FROM=e95076915d52edb2298e3ea386281c277e42c89a
2017-05-26 14:44:11 +00:00
Deomid Ryabkov
cf0a969a65 ESP8266 and ESP32 build image updates
ESP32: 2.0-r6
ESP8266: 2.0.0-1.5.0-r5

This brings updated mbedTLS with support for on-disk CA chains:
https://github.com/cesanta/mbedtls/compare/esp32_2.0-r5...esp32_2.0-r6
ESP8266 gets bigger rollup (ESP32 got those changes earlier, seems ok):
https://github.com/cesanta/mbedtls/compare/esp8266...esp8266_2.0.0-1.5.0-r5

Saves ~1.5K RAM for now, but will allow adding more roots to ca.pem without wasting RAM.

Refactored docker build for ESP8266 in the same way as was done earlier for ESP32.

PUBLISHED_FROM=db8eb0f91875d02266a8baaf1141c0d65eb59674
2017-05-25 17:20:18 +00:00
Deomid Ryabkov
06670d3401 Fix double-removal of send_mbuf data with SSL on
Other minor fixes.
Also decrease idle poll interval to 100 ms, as a workaround for some cases of incorrect next poll delay computation.

Added HW tests for SSL fetches.

Fixes cesanta/mongoose-os#262

PUBLISHED_FROM=4d19f845768b4b3b990d25959d4211972368d7fc
2017-05-19 16:20:00 +00:00
Deomid Ryabkov
acfc66cd60 Correctly report bytes sent via SSL
This prevented hexdump from showing data sent over SSL when using LWIP net_if

PUBLISHED_FROM=aa520a27bdd21294484c52bf33c8580f3b4bad65
2017-05-11 10:07:09 +00:00
Deomid Ryabkov
6f140202ad Fix LWIP net_if when RTOS is used; use for ESP32
All calls to core LWIP APIs should go through the tcpip thread.

PUBLISHED_FROM=ebe8c7f043394a75a46810f2b6626582c63b9e68
2017-05-09 16:27:53 +00:00
Deomid Ryabkov
d7a633bfa3 Fix timers when polling loop gets delayed
Past due timers should be brought forward to restore interval.

PUBLISHED_FROM=dbe1b8b98804cf8de81e1dbe814222422363278f
2017-05-03 12:51:15 +00:00
Deomid Ryabkov
0ea3cdd228 Implement sending stdout and stderr to MQTT topics
Configured via `debug.std{out,err}_topic`

PUBLISHED_FROM=66c581c38c5039aa9ecc406f8aac0b7e3c6541fc
2017-05-02 21:23:58 +00:00
Deomid Ryabkov
ddef065493 Enable SNTP on CC3200
PUBLISHED_FROM=cea0fc4db21f5b68fd3e779334989fef84a1637a
2017-05-02 21:05:40 +00:00
Deomid Ryabkov
663e928d65 Fix mg_strdup_nul
PUBLISHED_FROM=25bc4d20016bcb71c4e2e4b7be8d2d0566fdfa2e
2017-04-27 14:39:46 +00:00
Deomid Ryabkov
189cd8c5f6 Add mg_assemble_uri
PUBLISHED_FROM=533e134a48e0fca55509c3eb16b0a6b64c1188e8
2017-04-27 13:50:33 +00:00
Deomid Ryabkov
692f436b3d Make mg_connect_ws accept http:// URLs
As well as URLs without prefix

PUBLISHED_FROM=ee298f6575603c8b384888633fe16413695ba70d
2017-04-27 10:51:31 +00:00
Deomid Ryabkov
2e65ce8272 Fix mg_parse_uri for URIs with fragment but no qs
PUBLISHED_FROM=8fb53581e8979c28026f9c2bcacb89de740c18cf
2017-04-26 14:50:38 +00:00
Deomid Ryabkov
a35e5bd966 A function to make a NUL-terminated copy of mg_str
PUBLISHED_FROM=c1310b7d62f3ad6e2f24fea9f5229588c56b0bbe
2017-04-25 10:47:30 +00:00
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
Deomid Ryabkov
49bbfaf130 Fix mg_lwip_if_get_conn_addr when there's no pcb
Connection may not (yet) have a TCP or UDP PCB associated with it.
mg_lwip_if_get_conn_addr should not crash in this case.

PUBLISHED_FROM=fd0ed683b18b3f549135c9d79eeadfc7348ab05a
2017-04-21 19:33:17 +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
84907d5bc4 Ignore tcp sent cb when there's no asscociated nc
TCP ACK may arrive after the we've corresponding mg_connection has already been closed.
Fixes cesanta/mongoose-os#235

PUBLISHED_FROM=8164b86131ef08c1b2a6a08630920d600b3f91ac
2017-04-18 14:38:08 +00:00
Deomid Ryabkov
1cee8a16b9 Fix mg_socket_if_get_conn_addr for UDP sockets
Remote address is not associated with an outgoing UDP socket.
Instead, it is stored in mg_connection.sa

PUBLISHED_FROM=16f82ee8a69b995d684ec96b8db6b5591cd400db
2017-04-18 12:41:54 +00:00
Deomid Ryabkov
57e32b87c7 Fix MQTT will_message length calculation
PUBLISHED_FROM=d2400f6ef4837411586fb27db0b1fa03d94283c6
2017-04-17 07:24:54 +00:00
Deomid Ryabkov
f9596cc1db Perform endpoint auth check on multipart requests
https://github.com/cesanta/mongoose-os/issues/229#issuecomment-293613426

PUBLISHED_FROM=1c34db7ab2598eca1db0266cc6cdd31c32a16fff
2017-04-12 16:59:49 +00:00
Deomid Ryabkov
b2e2ad9a45 Fix hexdump on ESP8266, deliver MG_EV_SEND [...]
[...] after handing data off to LWIP, do not wait for ACK.
We don't do it in net_if_socket, don't do it here either.
Also prevents multiple send attempt on the same send_mbuf data.

PUBLISHED_FROM=4e5a677ebda84af1514f34299e53ce856a537883
2017-04-12 15:54:29 +00:00
Deomid Ryabkov
a07fb2be51 Log DNS failures in mOS
To aid disagnosing cases like https://forum.cesanta.com/index.php?p=/discussion/397/retries-connecting-to-aws-broker

PUBLISHED_FROM=98680b594dbed42234fc53050c9df292feb32f35
2017-04-11 15:51:27 +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
Sergey Lyubka
8ce34af9f3 Clean send_mbuf in mg_if_sent_cb, fix hexdump
PUBLISHED_FROM=3d222e548a3323b957376666e6702b408843b5a3
2017-04-11 00:06:03 +00:00
Deomid Ryabkov
08a10a8af5 Handle multiple MQTT messages per RECV event
PUBLISHED_FROM=fc98c51254dd94d3f443fb66e49449da7d9e754c
2017-04-10 15:51:13 +00:00
Dmitry Frank
bd130136bc Commonize arg checking in cfunctions
Add `mjs_check_arg()` which checks whether argument is provided, and
checks its type. It simplifies code and makes it smaller (because
error strings are not ad-hoc, so they are not duplicated)

As part of that, also commonize type stringifying: implement
`mjs_stringify_type` and reimplement `mjs_typeof` on top of that.

Use `mjs_check_arg()` in `mjs_string_slice()` and
`mjs_string_char_code_at()`.

PUBLISHED_FROM=0b72cf479738ff405d991cbd4bf9e75edda0f111
2017-04-10 10:09:07 +00:00
Ruslan Valiullin
fb04203b72 Fix eintr, zombie
PUBLISHED_FROM=f6d7d0f9c6de8ffeeb3bcd8aace6c1434281ddf7
2017-04-09 16:07:59 +00:00
Deomid Ryabkov
4172c190e5 Fix MQTT handshake; change to version 3.1.1
Differences between 3.1 and 3.1.1:
https://github.com/mqtt/mqtt.github.io/wiki/Differences-between-3.1.0-and-3.1.1

None of them are breaking.

PUBLISHED_FROM=cf2abd28deb1dabf787e07bcfdb335ff72462865
2017-04-08 07:21:01 +00:00
Deomid Ryabkov
920abd627b Minor SNTP fixes
PUBLISHED_FROM=03d04996f160f777339eec9528f2f187e1051ff9
2017-04-07 11:10:37 +00:00
Deomid Ryabkov
02b7399f9a Fix a typo
PUBLISHED_FROM=183a1bb571d0e2f5c23181107d30417f73c1eeb1
2017-04-03 14:20:16 +00:00
Alexander Alashkin
b8402ed073 Fix crash in multipart handling
Close cesanta/dev#6974

PUBLISHED_FROM=4d4e4a46eceba10aec8dacb7f8f58bd078c92307
2017-04-03 09:25:12 +00:00
Deomid Ryabkov
06c5c4d2a4 Handle NULL tpcb in mg_lwip_tcp_write
This can happen if the underlying LWIP TCP PCB has been destroyed (we got tcp_error_cb).

PUBLISHED_FROM=7a060aa4ca2a0c5a818fe9bc6b08cd0733c0ef8f
2017-03-30 15:32:33 +00:00
Ilia Penev
8ec47111d5 Fix COAP compilation
PUBLISHED_FROM=0a0ef6f68d743cbba91d9ba911f1c5be69e6aac7
2017-03-29 12:47:33 +00:00
Alexander Alashkin
8b67274cc0 Fix mg_get_http_var retval
PUBLISHED_FROM=257deff5ea20302627e77a0f29cf2359276a41d4
2017-03-24 13:24:37 +00:00
Dmitry Frank
af22fb7a06 Include mg_mem.h into str_util
PUBLISHED_FROM=990564aa54946b2a5b52d3a9c31f80b8e93c6b44
2017-03-23 22:07:22 +00:00
David Hargat
df5fff5e72 Consistent MG_MALLOC, MG_REALLOC and MG_FREE calls
PUBLISHED_FROM=e7f306b5d1a1366d3ec71fa238c5e18c03aadf8d
2017-03-23 18:54:06 +00:00
benrubson
d9243d1c0b Fix MD5 disabling
PUBLISHED_FROM=bb03593fb2abfb79daa3118b786428ee3e693e3d
2017-03-21 10:50:32 +00:00
Alexander Alashkin
2fb145d39d Fix DISABLE_MD5 and DISABLE_SHA1 naming
PUBLISHED_FROM=2babde0d0c6add14aa500f4bf1c833715d979c6c
2017-03-21 10:24:11 +00:00
Alexander Alashkin
380e87ddfa Honor DNS server from DHCP
PUBLISHED_FROM=10772301ef115c31ada3521ff4235c33a421b782
2017-03-20 09:53:12 +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
c416012f97 MGOS SNTP support for ESP8266 and ESP32
PUBLISHED_FROM=8e07541e7a3b951dcfd08381b46f6143773eae45
2017-03-13 17:53:35 +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
Deomid Ryabkov
08353731ef Fix MQTT PUB{ACK,REC,REL,COMP} and UNSUBACK flags
Flags should be 0 for all of these, except PUBREL (flags = 2).

PUBLISHED_FROM=46bf63fe12020d4cb493e52ceb3bae0291484b40
2017-03-08 00:23:14 +00:00
Deomid Ryabkov
16700244b0 Fix parsing of MQTT QoS > 0 PUBLISH messages
Message ID comes after topic, not before.

PUBLISHED_FROM=1ec2a56e290b67061b18c745671dc7f089b9cc0d
2017-03-07 23:52:42 +00:00
Deomid Ryabkov
49ca223e9c Minor memory optimization
Release pbuf sooner: after copying data from, before invoking user code

PUBLISHED_FROM=b877c96ef602bbca26762b18b9dde17eb880d1f9
2017-03-07 17:19:47 +00:00
Sergey Lyubka
38efe632ae Squash warning
PUBLISHED_FROM=72d80f8ed2c10866b44d56d8133c76b22bc105b0
2017-03-06 21:51:43 +00:00
Deomid Ryabkov
39a3bb7e44 Log method and URI in mg_http_handler
PUBLISHED_FROM=34c3e49d523b0f5c7056f91e4b422f21f5694df9
2017-03-02 09:36:08 +00:00