1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
Commit graph

4250 commits

Author SHA1 Message Date
calvin2021y
439651fa7e openssl: manage _GNU_SOURCE better 2021-07-10 08:27:33 +01:00
Andy Green
c042ba8c65 mqtt: handle NULL mqtt publish metadata 2021-07-08 10:18:20 +01:00
marcelo-gonzalez
04761c4b7c event libs: glib: use glib.h specifically
https://github.com/warmcat/libwebsockets/issues/2338
2021-07-08 06:24:52 +01:00
Andy Green
599d318ab8 mqtt: coverity: help coverity see we wont have an mqtt role wsi without mqtt member allocated 2021-07-07 10:34:07 +01:00
Bing Zhao
bae99f63a3 tls: add option to serialize ssl handshake
This is useful for memory constrained systems such as esp32
to improve heap usage minfree/watermark.

On esp32 with simultaneous_ssl_restriction = 2 (MQTT+H1),
Without this change, sys heap minfree ranges from 59k to 71k
  in 100 iterations, average 66.5k.
With this change, sys heap minfree ranges from 64k to 71k
  in 100 interations, average 68.7k
2021-07-07 08:49:36 +01:00
Bing Zhao
ff1b8ed0c9 tls: fix inbalanced tls restrict borrow/return calls
lws_tls_restrict_borrow() returns error when tls restriction limit is
reached. However lws_ssl_close() still calls lws_tls_restrict_return()
to decrease simultaneous_ssl. Thus LWS accepts more than allowed ssl
links, making simultaneous_ssl_restriction useless.

Fix it by tracking lws_tls_restrict_borrow() return value and only
calling lws_tls_restrict_return() if lws_tls_restrict_borrow() is
successful.
2021-07-07 08:47:37 +01:00
Andy Green
ad3901d0fe raw-proxy: fix role bind flag 2021-07-07 08:46:14 +01:00
Andy Green
4bc8b1a4b9 extpoll: clean up test server for Wconversion in extpoll parts
https://github.com/warmcat/libwebsockets/issues/2332
2021-07-07 08:45:43 +01:00
Andy Green
eeea000ced dns: handle EAI_NONAME as fatal
This causes the blocking dns lookup to treat EAI_NONAME as immediately
fatal, this is usually caused by an assertive NXDOMAIN from the DNS server
or similar.

Not being able to reach the server should continue to retry.

In order to make the problem visible, it reports the situation using
CLIENT_CONNECTION_ERROR, even though it is still inside the outer client
creation call.
2021-07-07 08:43:56 +01:00
Andy Green
9e5acc05e4 minimal: hcmulti: modernize startup to use OPERATIONAL 2021-06-27 09:07:51 +01:00
Andy Green
55533f96b9 netlink: hold in COLDPLUG until we actually have some routing table contents 2021-06-27 09:06:39 +01:00
Andy Green
fa1a704046 sspc: close: differentiate between ss and sspc at final wsi close
A second chunk of ss / sspc handling did not get cleaned up
along with the other patch from a few weeks ago, it wrongly
treats sspc the same as ss.  This can cause the wrong thing
to be zeroed down, 64-bit and 32-bit builds end up with
different victims.

This patch makes it understand the difference and treat them
accordingly, same as the main for_ss handling.
2021-06-27 09:05:45 +01:00
David Jeffers
3f0fef17aa gcc: gcc8 only recognizes fallthu
Later gcc is more accepting, but there's at least one gcc8 toolchain that only likes
to hear "fallthru", or it will flag it
2021-06-27 09:04:16 +01:00
Andy Green
e319b15b96 minimal: ws client spam: modernize with pvo and cancel service after interrupted 2021-06-27 09:04:04 +01:00
Andy Green
ea4d800809 service: fix casts for EXTERNAL_POLL 2021-06-24 16:21:56 +01:00
Andy Green
aea9d0cead tls-sessions: remove no stash warning
If there's no stash, we didn't get as far as having a session, so just fail
quietly
2021-06-24 06:37:25 +01:00
Andy Green
10c1b882c6 ss: check destroy null policy 2021-06-24 06:36:10 +01:00
Andy Green
e4aa3ece17 ss: check serialize null policy 2021-06-24 06:35:57 +01:00
Andy Green
4141a68f23 ss: avoid null ss policy on req tx len 2021-06-24 06:35:46 +01:00
Andy Green
de8185db9f ss: avoid null ss policy on req tx 2021-06-24 06:35:33 +01:00
Haopeng Li
526310dfea ss: h1: log dereferences NULL 2021-06-24 06:34:04 +01:00
Andy Green
7a283eba05 minimal: htt-client: send user agent and accept
Some servers will 4xx us if they don't see these headers
2021-06-24 06:33:37 +01:00
Andy Green
3d13468e9d ctest: do not reuse ctest-ssp path 2021-06-24 06:32:58 +01:00
Andy Green
e3da2a3b3b android: getnameinfo uses nonstandard size_t 2021-06-20 13:41:53 +01:00
Andy Green
8398ef794b getifaddrs: casts for android 2021-06-20 08:43:22 +01:00
Andy Green
02ae95fa79 non-windows: explicit cast vaarg to mode_t 2021-06-20 07:59:14 +01:00
Mykola Stryebkov
7c3c179e0e win32: client: just do WIN32 check 2021-06-20 07:21:31 +01:00
Andy Green
4c8195df22 windows: only conceal mode_t on windows 2021-06-20 07:21:05 +01:00
Andy Green
0ba8df6eb4 threadpool: disassociate wsi on close 2021-06-20 07:20:32 +01:00
Andy Green
94c50618a4 tls: mbedtls: fix cast for dump helper 2021-06-17 14:24:32 +01:00
RobHap
d896d40156 freertos: check for forcing each time around service loop
https://github.com/warmcat/libwebsockets/issues/2325
2021-06-17 14:21:28 +01:00
kekxv
cd87bc1cbe cmake: tls: use CHECK_SYMBOL_EXISTS 2021-06-17 14:21:11 +01:00
Andy Green
da17f01878 plugin: post: check unexpected write after protocol unbind 2021-06-17 14:20:29 +01:00
Chunho Lee
1c935dff79 clean: else became a NOP 2021-06-17 14:20:09 +01:00
Haopeng Li
896a2e09fc strexp: handle NULL better 2021-06-17 14:19:55 +01:00
DUOLabs333
aa090fc287 cygwin: include in unix type socket init 2021-06-17 14:19:40 +01:00
Andy Green
58a34cb0c3 examples: embedded: keep loop running on WROVER 2021-06-06 11:49:03 +01:00
caobug
85f772f2d1 OSX: Fixed can't find clock_gettime 2021-06-06 11:48:13 +01:00
Khem Raj
014aa77ed3 core-net: Remove unused variable
variable 'n' is being set but it is not used anywhere, latest clang is
able to detect this and flags it

Fixes

lib/core-net/route.c:41:6: error: variable 'n' set but not used [-Werror,-Wunused-but-set-variable]
|         int n = 0;
|             ^
2021-06-06 11:47:52 +01:00
Andy Green
e1ef230187 ss: h2: handle zero length COLON_PATH for metadata 2021-06-06 11:47:43 +01:00
Andy Green
0557e919bb sspc: handle nonexistent metadata cleanly 2021-06-06 11:47:30 +01:00
Andy Green
07bef6b83c coverity: ntp from blob: handle blob missing 2021-06-06 11:47:21 +01:00
Andy Green
2f9ed48d93 coverity: report problem in hpack_dynamic_size() to parent 2021-06-06 11:47:09 +01:00
Andy Green
d155970b67 coverity: h->cwsi must be valid if we are handling rx on it 2021-06-06 11:46:51 +01:00
Andy Green
2d97e343a3 ss: split out blob into own minimal example
The --blob option requires GENCRYPTO that's not on by default, to handle
the hash checks... that's going to cause a lot of confusion because it
means the simplest ss example won't build by default then.

Let's remove the blob support (and GENCRYPTO dependency) from the simplest
example and make a new minimal-secure-streams-blob example that has --blob
support and the GENCRYPTO dependency as well.
2021-06-06 11:46:32 +01:00
Jed Lu
c3dd4d05fe ss: sspc: handle destroy for client_connect and request_tx 2021-06-06 11:46:06 +01:00
Jed Lu
4b6a7982b6 ss: do not restrict close handling to WITH_SERVER 2021-05-27 17:13:26 +01:00
Andrey Grafin
62af701cc8 netlink: fix UB on RTM_NEWADDR/RTM_DELADDR
this patch makes ubsan (-fsanitize-undefined-trap-on-error) happy.

let's look at the following scenario:
1. netlink sends RTM_NEWADDR/RTM_DELADDR message
2. rops_handle_POLLIN_netlink() handles message attributes as RTA_*
3. rops_handle_POLLIN_netlink() finds RTA_PRIORITY attribute and
handles it as u32 value, but it's IFA_CACHEINFO attribute in reality
and payload holds another type
4. ubsan throws SIGTRAP

so, don't handle RTM_NEWADDR/RTM_DELADDR attributes as RTA_*
2021-05-27 17:13:17 +01:00
Andy Green
da512b08c1 coverity: ss: handle NULL omd 2021-05-27 17:13:06 +01:00
Andy Green
d85bfb2816 ss: deal with missing handle metadata 2021-05-27 17:12:57 +01:00