Commit Graph

3109 Commits

Author SHA1 Message Date
novlean
6523cc4da0 2018
PUBLISHED_FROM=63ce52177f5f13cb76f0fcb4689efb65a04318a2
2018-03-12 21:20:20 +00:00
novlean
2516da1c89
updated to 2018 2018-03-12 16:49:45 +00:00
Serge A. Zaitsev
0ae2b82b60 freshen: early attempts to make ota and config work
freshen: implement ota rollback

freshen: api for rpc

freshen: implement rpc api (without transport)

PUBLISHED_FROM=9f935f676161c81464a0dc53d5d8d085b2437ffb
2018-02-27 14:19:33 +00:00
Sergey Lyubka
dab526936f Add missing test files to mongoose repo
PUBLISHED_FROM=9a81cc34aa0039a75c851bc3685055f46936252e
2018-02-23 11:19:42 +00:00
Бобби
780077d118 Fix mg_socketpair for lwip + UDP
CL: Fix mg_socketpair for lwip + UDP

PUBLISHED_FROM=6dd09136b3837016026523fb34acb5cc893cadbe
2018-02-18 16:49:38 +00:00
Deomid Ryabkov
ad8f1d88d4 Fix buffer size passed to inet_ntop()
Fixes https://github.com/cesanta/mongoose-os/issues/394

CL: Fix buffer size passed to inet_ntop()

PUBLISHED_FROM=4a6702527627ccbb780f45200274b09a28be69ee
2018-02-13 12:49:53 +00:00
Deomid Ryabkov
a3c4a48ef7 Make sure test assertions are evaluated once
E.g. if `ASSERT_EQ(myfunc(), 123)` fails, `myfunc()` would be invoked again to print the actual value.
This can cause confusion sometimes.
To avoid this, we cast arguments to double, which is wide enough for most cases and we provide a variant for 64 bit value types for when it's not.
We also perform a check and fail if argument to the check results in loss of precision.

CL: none

PUBLISHED_FROM=a14551289d92e8a5dead21d16471ebddebe938a8
2018-02-10 12:19:40 +00:00
Deomid Ryabkov
84a11fe3b1 Count both tests and individual checks
CL: none

PUBLISHED_FROM=ab7f50e1c68154832e862ebfb4a02d385ef7c6be
2018-02-08 19:20:00 +00:00
Dmitry Frank
2a3cfc9858 Bump mongoose version to 6.11
PUBLISHED_FROM=92604e1b7c65009a6214fea9f1b2460df721d38e
2018-02-08 16:51:43 +00:00
Dmitry Frank
b9b20c6494 Implement mg_http_parse_header2()
Which is a replacement of (deprecated) `mg_http_parse_header`, but,
similarly to `asprintf`, allocates a new buffer if the client-provided
one is not large enough.

Also use it throughout mongoose code, and thus some header-related
limitations are removed; in particular,
https://github.com/cesanta/mongoose/issues/813 is fixed.

CL: Mongoose Web Server: Deprecate `mg_http_parse_header()` and implement `mg_http_parse_header2()` instead, which allocates a new buffer if the client-provided one is not large enough (similarly to `asprintf`).
CL: Mongoose Web Server: Fix limitations of header value lengths, e.g. when parsing authentication headers such as nonce, etc.

PUBLISHED_FROM=c75b1bbbbdb294ea85075ce69b1368f115fdd1ef
2018-02-07 23:04:29 +00:00
Deomid Ryabkov
a8a7d2cf7e Minor tweaks for testing
PUBLISHED_FROM=d52aea1648ed8ec8dd2e71168884795d995b1826
2018-02-07 20:19:31 +00:00
Deomid Ryabkov
50ecc30b4d Commonize unit test main()
CL: none

PUBLISHED_FROM=ee76407d89f3fcbe3da23810117a374d06af0a25
2018-02-07 16:19:32 +00:00
Deomid Ryabkov
cd89db5c2f Add a convenience macro invoke subroutines
To properly fail a test in a subroutine, return value needs to be passed up.
This snippet makes it short.

PUBLISHED_FROM=2f6328b5eb2921a4caa53d8887c02f73a5d817ea
2018-02-07 14:49:23 +00:00
Deomid Ryabkov
1ed99999bd Add ASSERT_{TRUE,FALSE} convenience macros
PUBLISHED_FROM=3cd6dd7f04b650ca637788d1017b6b5146c79569
2018-02-06 16:49:32 +00:00
Dmitry Frank
4afebdcb2b Add UDP client example
CL: Mongoose Web Server: Add UDP client example

Resolves https://github.com/cesanta/mongoose/issues/886

PUBLISHED_FROM=fcce2f1de3a800147e9246ffa01c428c1b8f552b
2018-02-06 13:34:33 +00:00
Dmitry Frank
c3d9d17e34 Remove "mongoose" prefix from includes
In certain files it was necessary to make tests work from public
mongoose repo, so this commit makes things consistent.

PUBLISHED_FROM=694454d0ff007229c65d524a2a2beaf126420f15
2018-02-05 20:20:05 +00:00
Dmitry Frank
7bf5144e62 Make tests work on public repo as well
PUBLISHED_FROM=78acb18d597b6f47f31da13087fa6685f21ce445
2018-02-05 14:35:37 +00:00
Dmitry Frank
3eb4eb8074 Fix mongoose docs generation
PUBLISHED_FROM=331821dcd1f7dc8a94581cd8a9b51aa00a89fddc
2018-02-03 01:20:48 +02:00
Deomid Ryabkov
ab000c684a Fix includes
Even though it makes no prectical difference due to the way amalgamation works

CL: none

PUBLISHED_FROM=6977833f2b469e5b969385ad9ae21a28af76746f
2018-02-03 01:20:47 +02:00
Dmitry Frank
aba60dadec Add mg_ prefix to mongoose sources
CL: none

PUBLISHED_FROM=d6ebe5fa88c61ae3b8569897d9b09d54610bec73
2018-02-03 01:20:47 +02:00
Dmitry Frank
f29457e967 Remove tunneling from mongoose
CL: Mongoose Web Server: Remove tunneling functionality which was used by nobody

PUBLISHED_FROM=38b9e8ae7b0a5a1dbba5cff4074843dc681267d3
2018-02-02 21:50:13 +00:00
Dmitry Frank
8742fac5d8 Publish mongoose src and tests
CL: Mongoose Web Server: Publish sources and tests

Resolves https://github.com/cesanta/mongoose/issues/745

PUBLISHED_FROM=7ecd7a3c518cfa614a6ba0838678dcb91b75a8c0
2018-02-02 15:49:55 +00:00
Dmitry Frank
0ab1c7ef76 Fail if passed a NULL handler
Before it resulted in an endless recursion.

Resolves https://github.com/cesanta/mongoose/issues/871

CL: Mongoose Web Server: Fail if passed a NULL handler to `mg_bind` or `mg_bind_opt`.

PUBLISHED_FROM=376e5d330a643fa530f6a27a422a1500f986c721
2018-02-02 06:35:12 +00:00
Dmitry Frank
47abc641f1 Fix nonce in digest authentication
CL: Mongoose Web Server: Digest authentication: Fix nonce validity check (expired nonce or nonce from the future did not cause the the check to fail)
CL: Mongoose Web Server: Digest authentication: Fix nonce request value; it worked before because nonce validity check was broken as well
CL: Mongoose Web Server: Digest authentication: Add `nonce` argument to `mg_http_create_digest_auth_header()`: clients should use the value received from the server's authentication request.

Resolves https://github.com/cesanta/mongoose/issues/809

PUBLISHED_FROM=5e59f90ed6b2a4311ed6763159da81c2aaf6af4c
2018-02-01 22:05:43 +00:00
Dmitry Frank
7519b2ef3a Improve websocket implementation
CL: Mongoose Web Server: Websocket: Respond to Ping with Pong
CL: Mongoose Web Server: Websocket: Properly close a connection with Close frame (in response to a client's close and when protocol failure is detected)
CL: Mongoose Web Server: Websocket: Fix support of fragmented messages
CL: Mongoose Web Server: Websocket: Add support for control frames interjected in the middle of a fragmented message

PUBLISHED_FROM=e2b3794aaacc64633540c493194cccc62afa2077
2018-02-01 13:20:19 +00:00
Dmitry Frank
ce8657f12f Fix corner case in preparing cgi env
`path_info` was dereferenced without checking for NULL, and a few lines
below, it was checked for NULL.

CL: none

PUBLISHED_FROM=9f14dc68c152b9b1119b276f047686d831bace38
2018-01-30 20:39:54 +00:00
Dmitry Frank
8e366916d5 Ensure that the name buffer is null-terminated
CL: none

PUBLISHED_FROM=f165b556582f712c2c1c752e01c41d22fe593397
2018-01-30 20:39:53 +00:00
Dmitry Frank
33f53ab000 Don't ignore setsockopt return value
PUBLISHED_FROM=f3c1fcf015f6f72eca2eb3d5dad469cd66a837a9
2018-01-30 20:39:52 +00:00
Dmitry Frank
bd15ad4301 Improve err handling in pubsub example
PUBLISHED_FROM=7660e252e1ac84bf2245718c548fb00288ff4e47
2018-01-30 20:39:51 +00:00
Dmitry Frank
e5b3b8ad32 Ensure not to overflow buf in udp server example
PUBLISHED_FROM=413f5073b0fc267d66ce04d8d40e9e9d7abac94d
2018-01-30 20:39:50 +00:00
Julien Ammous
e116c48bef Remove redundant initialization
CL: none

PUBLISHED_FROM=9d68cdc298c520798468b43a19c84251bd0c21b4
2018-01-30 19:39:08 +00:00
Julien Ammous
7d7bb3b388 Don't use user_data in mqtt server
Integrates https://github.com/cesanta/mongoose/pull/884
Closes https://github.com/cesanta/mongoose/issues/883

CL: Mongoose Web Server: Don't use user_data in mqtt server

PUBLISHED_FROM=7785784a766e0ba7514bbba604cde14e7bad3f73
2018-01-30 19:39:05 +00:00
Dmitry Frank
0b4bf13335 Fix mg_parse_multipart in case of malformed req
CL: Mongoose Web Server: Fix mg_parse_multipart in case of malformed request

PUBLISHED_FROM=9b33b03e9ab2ca204ad2f8d061df169246644072
2018-01-30 19:39:03 +00:00
Dmitry Frank
228984a3fc Fix a corner case in receiving UDP data
CL: none

PUBLISHED_FROM=9c13882517374644c6d799976f1048f04ae446d7
2018-01-30 14:35:15 +00:00
Dmitry Frank
f084ad8008 Fix pubsub example
CL: Mongoose Web Server: Fix publish-subscribe example

PUBLISHED_FROM=04fdb66c1d4eb56798a5be2634f9f9bb2f18f288
2018-01-30 14:35:14 +00:00
Dmitry Frank
255da78bed Fix socket leak when there are too many open fds
CL: Mongoose Web Server: Fix socket leak when there are too many open file descriptors

Fixes https://github.com/cesanta/mongoose/issues/870

PUBLISHED_FROM=c802b6834a54eca37821d46efde192c527e0a6b7
2018-01-30 13:37:42 +00:00
Dmitry Frank
5d5badfcee Fix memory leak in big_upload example
PUBLISHED_FROM=e6ccbd73b27985fbf9949adc3e07c90a75f75603
2018-01-30 12:51:15 +00:00
Dmitry Frank
4cf9f99ae9 Fix docs link
PUBLISHED_FROM=2b18b68e500a3d6123e80bd4db19e3b3b9900012
2018-01-30 09:50:44 +00:00
Dmitry Frank
673f25f75a Include stdbool.h for NRF52
Fixes https://github.com/cesanta/mjs/issues/82
Integrates https://github.com/cesanta/mjs/pull/85

PUBLISHED_FROM=2f5f50c25ec1c92fdfb783cd95cb57f0cb20642b
2018-01-29 22:35:15 +00:00
Бобби
961fb96bb7 Fix OOB access in mg_match_prefix_n()
CL: Fix OOB access in mg_match_prefix_n().
    Made mg_match_prefix_n() return non-negative result.

PUBLISHED_FROM=611454df6a6c55bfa7ddf05e7d268a86fa0457a8
2018-01-27 13:50:13 +00:00
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
Deomid Ryabkov
10c274c774 STM32 Ethernet support
AWS MQTT connection works

Also fixes https://github.com/mongoose-os-libs/ethernet/issues/1 (because why not).

PUBLISHED_FROM=7b0fa8894f2127335d075f2a97fcd37b932006b2
2018-01-12 13:02:29 +00:00
Deomid Ryabkov
eb3b81297d Use stock ARM GCC and Newlib from Ubuntu distro
Standardize common packages in build images, to make better use of Docker image cache.

PUBLISHED_FROM=a080e83cf5dd80feaf7960147dee36413244a92c
2018-01-04 11:56:42 +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
c5cc414181 Improve docs of str_util.h
PUBLISHED_FROM=de02f5cc6a9d854e92cf674e5382f793709da831
2017-12-17 14:50:54 +00:00