Commit Graph

1397 Commits

Author SHA1 Message Date
Бобби
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
ruslanvaliullin
66b23b11b0 Fix Nmap reset on ESP8266
PUBLISHED_FROM=7b9c85e7708721f2c6d0e2fc8ad5c32c61b48854
2017-08-16 17:40:48 +00:00
Deomid Ryabkov
448b44094a Add automated check for extern "C"
Fix headers that didn't have it

PUBLISHED_FROM=ce8140783d4b661f16278a4a5adc957b21965473
2017-07-27 11:19:56 +00:00
Sergey Lyubka
8bbb44f90c Always send MG_EV_HTTP_CHUNK
PUBLISHED_FROM=33957356e1510b73b37768496c74a6bf12630215
2017-07-21 13:34:52 +00:00
Deomid Ryabkov
0fba87c755 Make mg_url_encode public
Change the API to heap-allocate the string and get rid of a bunch of fat stack buffers.

PUBLISHED_FROM=c793dc64a9a044a9769d92ea16859f5d704a2181
2017-07-21 12:06:52 +00:00
Sergey Lyubka
fea648496c Fix https://github.com/cesanta/mongoose-os/issues/318
PUBLISHED_FROM=2fc7b59b2edd0f473acd22067439471778acef8e
2017-07-20 08:05:12 +00:00
Deomid Ryabkov
4c37e49274 Disable insecure and deprectaed SSL protocols
Also allow disabling conmpression and forcing server cipher list.

PUBLISHED_FROM=5539deec9c2382ba34597872dd7f3a5abc0cc311
2017-07-05 17:04:31 +00:00
Deomid Ryabkov
2a2bc33a89 Add mg_strstr
PUBLISHED_FROM=4306e870e2cab854febb6becc198ca2247e2e002
2017-07-05 16:20:32 +00:00
Dmitry Frank
41558bbf64 Fix formatting
PUBLISHED_FROM=4d4d49136e13ba8035d452a4f64fcaf48f15bdb3
2017-07-04 19:35:55 +00:00
Sergey Lyubka
4d0cc95ff4 Add JS net api test
PUBLISHED_FROM=f2821b104f8f2fc196ce4064b7c9f35ea152368d
2017-07-04 19:04:45 +00:00
Deomid Ryabkov
cfd28a4f7a Add mg_strchr
Write unit tests for some mg_str functions.

PUBLISHED_FROM=1fc7e1d5d5ef259d4023f295aec8651caa3e7e86
2017-07-03 15:05:54 +00:00
Deomid Ryabkov
5a0b6fc35a Use SSL_CTX_{get,set}_app_data to store context
h/t @hendrikw01

Fixes https://github.com/cesanta/mongoose/issues/826
Closes https://github.com/cesanta/mongoose/pull/831

PUBLISHED_FROM=d5e1285bee9bcbb85d581ee62972a2fde7d9c0db
2017-07-03 11:04:40 +00:00
Sergey Lyubka
ae611a6e55 Clean up v7 from mongoose
PUBLISHED_FROM=efa9cc3aaf0c5ae8841e029370f882b615cebf1b
2017-07-01 08:51:09 +00:00
Sergey Lyubka
a7a2e3deb1 Introduce log filter
PUBLISHED_FROM=b8f538f87e034452032284d45b78090338e87f72
2017-06-29 14:34:28 +00:00
Deomid Ryabkov
cae0a1cbc0 Fix mongoose amalgamation
PUBLISHED_FROM=16ae777c949caf87e7dce428d62fa8878a30d318
2017-06-28 19:13:47 +00:00
Sergey Lyubka
244e5f67d3 Commonize pattern matching functions
PUBLISHED_FROM=e69e298a51dbe0f9c47184169ecad06eef0676fc
2017-06-28 18:35:37 +00:00
Sergey Lyubka
8d76733fad Make mg_conn_addr_to_str return len
Also amend api_net.js to use returned length.

PUBLISHED_FROM=38e15f9587edf28049c5b9e5f126b4db159910e8
2017-06-26 21:02:02 +00:00
Deomid Ryabkov
fb3a5a7d90 Disable cert verification when ssl_ca_cert is '*'
PUBLISHED_FROM=578706e48a2c1fbbf5e9aaab3eba743e7d13fa61
2017-06-21 14:23:30 +00:00
Deomid Ryabkov
f374ac5f9a Do not close already closed connection
PUBLISHED_FROM=9e345f2319141f20b89e28a2d29adba21ea213e1
2017-06-20 20:06:18 +00:00
Deomid Ryabkov
02707364f0 Lower conn accept message verbosity to DEBUG
Raised in previous commit by mistake

PUBLISHED_FROM=31a73fb610c34ed0c85d081bfa11a8067f216696
2017-06-20 19:14:33 +00:00
Deomid Ryabkov
104106b9cf Invoke tcp_accepted() on the listening pcb
As required by the LWIP API

PUBLISHED_FROM=7bfc6d816aa69f8fdd7592ade48b2d52e2d4991a
2017-06-20 19:14:31 +00:00
Deomid Ryabkov
474e065a30 MAX_PATH_SIZE -> MG_MAX_PATH
PUBLISHED_FROM=32bda9e86a11cad3b908d211a1f7bc9d27312874
2017-06-20 18:06:36 +00:00
Deomid Ryabkov
27094896b1 mOS filesystem refactoring: introduce VFS
With different filesystem implementations and storage drivers, like grown-ups have :)
This is not currently used to add any new functionality, we still have
only one FS and driver on ESP8266 and ESP32; CC3200 has two: SPIFFS and SLFS.
This will be used soon to implement filesystems on additional SPI flash chips and SD cards.

PUBLISHED_FROM=293960fef82952c505e9b1925aac7724c7308362
2017-06-13 15:35:38 +00:00
Dmitry Frank
cd48bcfd7d Don't ignore userdata in mg_bind
PUBLISHED_FROM=0ffcd770535efa66ff1b6f9201f2caf832bd5055
2017-06-09 19:05:40 +00:00