Commit Graph

1420 Commits

Author SHA1 Message Date
Deomid Ryabkov
d6475fcd19 Fix TCP RX path regression in SSL mode
CL: Fix TCP RX path regression in SSL mode

PUBLISHED_FROM=2cfdb33e5f711bbc4b98e2d24ba3377de0f1d3c5
2018-01-18 11:04:45 +00:00
Dmitry Frank
ac538f755f Close undrained and stuck http connections
CL: - Mongoose Web Server: close undrained and stuck http connections

PUBLISHED_FROM=a11656b195dbe2ef8473455a171a583e37cedb2c
2018-01-16 15:20:47 +00:00
Deomid Ryabkov
5b2eb4f0e1 Enable building with CS_ENABLE_STDIO=0
h/t @kzyapkov

PUBLISHED_FROM=d15a5a0057f69f2f755af6436e676b1b179d069d
2018-01-15 20:20:36 +00:00
Dmitry Frank
80f4133bbf Get rid of magic numbers in parse_mqtt
PUBLISHED_FROM=63cc7ed8c3378bebf209d3620efb09d73675370c
2018-01-02 10:50:38 +00:00
Dmitry Frank
d10fb9451c Move the recv limit check to mqtt
PUBLISHED_FROM=028d6f56ec1cc15484c995335f00d087b590faef
2017-12-29 17:35:29 +00:00
Dmitry Frank
88ae2ecadb Drain rx_chain before closing the connection
PUBLISHED_FROM=08eee4052dd9bbc364875a577409cb78665dee30
2017-12-29 07:50:43 +00:00
Dmitry Frank
85d19dad47 Respect recv_mbuf_limit in lwip
PUBLISHED_FROM=470ff0f484bff3e4478651f0b64cc160bba8ebfc
2017-12-28 12:49:54 +00:00
Dmitry Frank
17703fe3e8 Improve docs for logging
PUBLISHED_FROM=72f0892ecfba5b1c3c2a70f0ecd5715578d7ffce
2017-12-16 17:55:53 +00:00
Бобби
4e11d5cdbf Move shadow to event API
PUBLISHED_FROM=cd059adee921dd10fd89100b0e2500ff8d7743eb
2017-12-14 13:32:11 +00:00
Sergey Lyubka
987bc1d580 Use 8k iobuf limit for aws
PUBLISHED_FROM=971951e1eeb82078b986cd6e25e52cfc1ccef286
2017-12-02 21:26:35 +00:00
Dmitry Frank
ddd35c0cba Fail if authn file is configured but doesn't exist
PUBLISHED_FROM=2c176091ffb6c7c5cfe8ea4f05b6109e00b33383
2017-11-28 19:35:22 +00:00
Sergey Lyubka
c97b615785 Fix mg_parse_uri()
PUBLISHED_FROM=e5b829d93ecf946e5bdbbf33132be7068ffe0dd2
2017-11-28 16:45:52 +00:00
Dmitry Frank
9ab6d084df Expose digest auth checking functions
PUBLISHED_FROM=1bfc6e332f56b68eb6155bb729a97a0d8d5a316c
2017-11-28 10:05:36 +00:00
Deomid Ryabkov
cf8d0a25aa Rename base64.{c,h} to cs_base64.{c,h}
To avoid name clashes.

PUBLISHED_FROM=e6ae32ec48f9b599eace7a9214a1863cdc185fd9
2017-11-24 11:36:12 +00:00
Deomid Ryabkov
90716417c9 Compatibility with LwIP 2.0
2.0 redefined LWIP_VERSION in a way that is no longer compatible with use by preprocessor (boo).
also, tcp_pcb.acked is gone, but we only use it for debug, so it doesn't matter.

PUBLISHED_FROM=776f90a08bd5024fa8a61dae257af6c60ec6710d
2017-11-23 10:05:43 +00:00
Deomid Ryabkov
101afbc9b8 Use weaker but faster cipher suites
ECDHE is way too slow on ESP8266 w/o cryptochip, this sometimes results in WiFi STA deauths.
Disable DHE completely because it's just hopelessly slow.

PUBLISHED_FROM=d9c8e95b7d5c992f9e127726c569f187b1e0b453
2017-11-21 15:33:00 +00:00
Бобби
a197646867 Integrate cesanta/mongoose-os/pull/370
PUBLISHED_FROM=5bee629477514370f9b670771e786c4f4ddae934
2017-11-09 09:49:28 +00:00
Бобби
00d1d2c0e7 Make mjs & frozen vc98 & vc2017 friendly
PUBLISHED_FROM=7cde8b374d5e318b5cdd69fc5b4de86b2a9552f5
2017-11-08 16:04:08 +00:00
Deomid Ryabkov
7942803a75 Fix MQTT SUBSCRIBE parsing
Make sure topic is properly NUL-terminated.
Ignore SUBSCRIBE requests with no topic expressions.

PUBLISHED_FROM=a00f39dda44fe63299e971a91a98f8ee57dd2a64
2017-10-30 15:34:22 +00:00
Deomid Ryabkov
a8b74a9021 Fix bug when network conn is closed before CGI
NULL out cgi_nc->user_data so it doesn't touch nc anymore.

PUBLISHED_FROM=de2f76981c377d8951fb8e18e8b3d41dbfcf38b1
2017-10-30 14:20:27 +00:00
Deomid Ryabkov
27a9a62843 Fix SimpleLink listener for SSL
Must set SSL parameters before invoking sl_Listen

PUBLISHED_FROM=9147e7aa945f75e73d5c7cd7987cb5749025a86b
2017-10-24 07:19:45 +00:00
Deomid Ryabkov
9b268b6c77 Fix timer handling
ev_timer_time may remain the same for legit reason, so to prevent looping, instead, reset it before invoking the handler.
To let user know what the initial setting was, pass it as the argument instead of current time (which is kind of pointless).

PUBLISHED_FROM=fa328009f097f9b49b5b0dd13a38ee6d6e6518de
2017-10-21 09:19:42 +00:00
Sergey Lyubka
3b3ac48edd Fix potential leak in socks client
PUBLISHED_FROM=2cb4449d2f36d59db2b0dc37c46b35de6a461810
2017-10-19 13:49:43 +00:00
Бобби
b5dd0e8093 Use verbose flags in both socks client and server
PUBLISHED_FROM=d17e96a97e1621e9788844bcd627c3143d37315c
2017-10-19 13:24:30 +00:00
Deomid Ryabkov
9b24fdfd1d Reformat mongoose
PUBLISHED_FROM=5202fa46a6a834bde35168ba566d3dce7c48f453
2017-10-19 13:24:26 +00:00
Бобби
8193302162 Initial socks5 client & server implementation
PUBLISHED_FROM=05d3cca6223c963e7ae89dde3628fa8fad46e6bd
2017-10-18 14:05:13 +00:00
Dmitry Frank
f0c6630a16 BREAKING: Sys config API change
Now apps should use getters and setters instead of accessing struct
fields directly, e.g. instead of `get_cfg()->update.timeout` it should
be `mgos_sys_config_get_update_timeout()` to get the current value, and
`mgos_sys_config_set_update_timeout(123)` to update the value.

For now, the config structs are public, but they will be made private
soon, so use accessors to keep your code working.

PUBLISHED_FROM=f7d582421a8d7e4d1ed50a280f2670d8b62f8d45
2017-10-11 11:15:48 +00:00
Deomid Ryabkov
1db747da29 Do not double-count recved bytes
Mongoose would report consumed bytes twice if mg_call is invoked recursively (e.g. proto_handler uses mg_call to invoke user's handler).
Reporting twice as much recved as was delivered effectively disables LwIP's TCP throttling and causes buffers to grow too big.

PUBLISHED_FROM=4ad5cd5db4dd54623bd6de2d50d32ddcc9e2b08a
2017-09-14 13:51:03 +00:00
Deomid Ryabkov
8065439f96 Acquire lock when manipulating rx in SSL recv path
PUBLISHED_FROM=a34cfa3ebc12daf75d7f24c8d3f3707dcc33d9a2
2017-09-14 11:06:24 +00:00
Dmitry Frank
0aaba7a461 Add cs_timegm
Which is a slightly modified version from
https://stackoverflow.com/questions/283166/easy-way-to-convert-a-struct-tm-expressed-in-utc-to-time-t-type

PUBLISHED_FROM=b73f920ca42c45473c23337782e815306bdf69f1
2017-09-12 16:20:16 +00:00
Deomid Ryabkov
3d6b568c6e Prefer ECDHE with CBC over DHE ciphersuites
PUBLISHED_FROM=4ddfc25af77247fac7e7d04cc0e56d6f3800f87b
2017-09-07 11:04:38 +00:00
Deomid Ryabkov
2b2816cfe4 Store reassembled WS frame length in proto_data
PUBLISHED_FROM=7bbe7dd20dca8435c786dca30200a4973ae0827d
2017-09-06 19:05:00 +00:00
Deomid Ryabkov
2fa18b47db Fix DNS name uncompression
PUBLISHED_FROM=07e820f539fa5feca2ad1cf81faca8404b773a65
2017-09-06 18:05:29 +00:00
Deomid Ryabkov
c8af7cdd27 Check for int overflow when parsing WS frames
PUBLISHED_FROM=b7325b38e881455df703b0b628c41931565ccb33
2017-09-06 17:34:37 +00:00
Deomid Ryabkov
f857f6394f Access QoS field after validating topic length
PUBLISHED_FROM=6f2d9849d75ca1ec2b6dade11ccad8d0c5d4b3bd
2017-09-06 15:35:15 +00:00
Deomid Ryabkov
97d733e129 Fix MQTT broker SUBSCRIBE request parsing
Add checks on the number of subscribe requests per packet and overall per-session subscription limit.

PUBLISHED_FROM=faaf5c50af31a0694c9308a664f2e418dbb0eb18
2017-09-06 13:23:13 +00:00
Deomid Ryabkov
77e44c7c0e Harden MQTT variable length parsing
PUBLISHED_FROM=e16ee57bc30277e5b5684e53da78e69baaf9f779
2017-09-06 11:49:43 +00:00
Наше вам с кисточкой
abf89d32d9 Make C ws client work with Go
PUBLISHED_FROM=263553121b992ec0f66b0275b4e10f4176281812
2017-09-01 08:35:53 +00:00
Deomid Ryabkov
177e05deb2 CC3220: AWS connection works
PUBLISHED_FROM=5831462c5be0b79afff32130a1f45784f32bc524
2017-08-31 21:52:31 +00:00
Deomid Ryabkov
c7bea65ae7 CC3220 FS support
For now, we only support SPIFFS-in-a-box, same as CC3200.
On CC3200SF it should be possible to have SPIFFS on built-in flash, but that is left for later.

PUBLISHED_FROM=dee337c8cd8ed288c22abe9960eef81e6e90cc4a
2017-08-30 16:50:03 +00:00
Deomid Ryabkov
d5a9000d46 Harden MQTT parser some more
PUBLISHED_FROM=5e7fcc7bf145aa8e1045e8d627b1c0731bb4341b
2017-08-30 12:49:30 +00:00
Deomid Ryabkov
f62018451f Fix subscription parsing in MQTT broker
Also, do not accept PUBLISH and SUBSCRIBE before a sucessful CONNECT.

PUBLISHED_FROM=b5096cdc2ec5da1358244c428efbbb2e20be1a05
2017-08-30 08:49:35 +00:00
Deomid Ryabkov
0a93e301c9 CC3220: Exception handling, NWP init
Also make CC3200 use newer ARM compiler, generates slightly smaller code.

PUBLISHED_FROM=a0be49d7ea864a95886f7110887a59f6f11802d7
2017-08-29 21:49:53 +00:00
Dmitry Frank
6fe9cae62a Add mg_next_comma_list_entry_n()
And mgos_conf_check_access_n()

PUBLISHED_FROM=c7de937b4f5463ca463d604183a4ee831617bd6d
2017-08-27 12:49:28 +00:00
Deomid Ryabkov
38e984a008 CC3220 first steps
Achievement unlocked: CC3220 port prints a boot banner.
Then locks up.

Included in this PR is refactoring to pull out common parts to be shared with CC3200.

PUBLISHED_FROM=5fb9d9a00bb9ce7f63dde20bc1876076b76d5257
2017-08-26 17:05:00 +00:00
Our CI Bot
09e4254718 Add mqtt_over_websocket_server example
Fixed bug in websocket handshake:
now adding Sec-WebSocket-Protocol header in handshake response.

PUBLISHED_FROM=e4a71ff9dc4aeec63db40cb7f356dc5b25c1215a
2017-08-24 10:34:35 +00:00
Dmitry Frank
d4b55c4ceb Separate digest auth from HTTP headers parsing
PUBLISHED_FROM=f97569ae2f31ab94ce4875eae4d0a198f719c388
2017-08-22 19:51:53 +00:00
Deomid Ryabkov
7d5479985d Enable LWIP net_if locking on ESP32 (doh!)
https://forum.mongoose-os.com/discussion/comment/4620/#Comment_4620

PUBLISHED_FROM=679dd48e078615ef4f57d1879957b734f549ef2e
2017-08-21 14:24:51 +00:00
ruslanvaliullin
7632a5e4af Fix ignoring DhcpNameServer
PUBLISHED_FROM=73d6767e4aaa7249eeb5d76f9e7160be041292ca
2017-08-17 15:51:21 +00:00
ruslanvaliullin
7f20c41dd5 Implement rmdir & sleep func instead macros
PUBLISHED_FROM=62c73e5fb4f70e2b5b8824ce092012508640b173
2017-08-17 14:32:36 +00:00