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

3618 commits

Author SHA1 Message Date
Andy Green
eba4f8cfb8 http: remove stray debug log 2021-11-22 15:39:42 +00:00
Andy Green
bc83a57207 h2: post: do not try to bind origin for files 2021-11-18 08:06:32 +00:00
Andy Green
121dd5e8ee ss: revert make ss timeout handle underlying wsi gone 2021-11-09 09:54:08 +00:00
Andy Green
3ef446f27c freertos-service: remove cruft
This can't be reached currently, so remove it and simplify the setting of c
to the exact equivalent.
2021-11-09 09:29:00 +00:00
Andy Green
b45dfcb81e windows: mingw file type is int 2021-11-09 09:28:37 +00:00
Yichen Gu
cab34801ea wsimux: immortal: only process immortality once per stream
We can call mark immortal multiple times for a child stream, make sure it
is only processed (and increments the nwsi refcount) the once.
2021-11-09 09:28:26 +00:00
Andy Green
f8a21fec22 adopt: coverity: move vh deref until after pointless check 2021-11-09 09:27:41 +00:00
Andy Green
3e1a1a443d coverity: client_reset: no longer any way to get NULL *pwsi
Coverity belatedly noticed that client_reset no longer changes *pwsi
2021-11-08 11:08:45 +00:00
Andy Green
f9fc45bd98 sspc: proxy: coverity: handle unknown metadata name 2021-11-08 11:05:28 +00:00
Andy Green
1db45d17df h2: coverity: check for OOM on dynamic table alloc
It can fail, we should check it.
2021-11-08 11:05:28 +00:00
Andy Green
b415f59bd2 ss-deserialize: add pointless h NULL check
h cannot be NULL since it's set by address offset earlier.
Help coverity understand that.
2021-11-08 11:05:28 +00:00
Andy Green
11ba0b713b adopt: coverity: add pointless vh NULL check
The wsi is always created on a valid vhost.  Add a needless NULL check on
it to satisfy coverity.
2021-11-08 11:05:28 +00:00
Andy Green
b0cd8f6703 ss-h1: coverity: add needless header NULL check
Coverity does not understand that once we checked that  the header has
a non-zero length, the associated pointer can never be NULL.  Add a
pointless check to make it happy.
2021-11-08 11:05:28 +00:00
Andy Green
6e9c25d1f7 mbedtls-x509: coverity: remove needless check
ip can't be NULL, it's set to the address of another object.
2021-11-08 11:05:28 +00:00
Andy Green
a00703f500 unix-sockets: NOP for coverity
continue here makes no difference than using break, but continue gets us a
pointless complaint "statement continue does not have any effect" and break
does not.
2021-11-08 11:05:28 +00:00
Andy Green
39380ffbac client: connect: confirm we have a protocol
Coverity gets antsy that we were checking wsi->a.protocol for NULL earlier
then start using it... explicitly bail if it's NULL before we start using
it.
2021-11-08 11:05:28 +00:00
Andy Green
57c5a0da55 jit-trust: SAN_RFC822_NAME needs other_name union member
->san is a union, in this case we set the type to indicate we use
SAN_OTHER_NAME member, but set the unstructured_name union member, that is
smaller.

This doesn't cause any problem, since the union has space for it.  But
Coverity noticed, it is wrong, so fix it.
2021-11-08 11:05:28 +00:00
Andy Green
240cd55ef6 jit-trust: show coverity we handle NULL attribute source
Coverity doesn't understand that since we already handled
akid.keyIdentifier.MBEDTLS_PRIVATE(len) being zero, we don't need to
check for akid.keyIdentifier.MBEDTLS_PRIVATE(p) being NULL.

So explicitly check it, even though it is a NOP.
2021-11-08 11:05:28 +00:00
Andy Green
7882a6dc13 jit-trust: clean after failed mbedtls_x509_get_name
mbedtls_x509_get_name() does not clean up properly after itself in the case
of OOM on multi-segment name.  We have to add extra handling and cleaning.
2021-11-08 11:05:24 +00:00
Andy Green
c42c2adba9 retry: handle empty retry table 2021-11-08 10:33:12 +00:00
Andy Green
4935fe9e1e openssl: remove lws_ssl_get_error_string as cruft
It's not exported, it seems nothing wants it any more
2021-11-02 07:23:28 +00:00
Ron Frederick
7451ce5cfb server: SO_REUSEPORT: enable with LWS_MAX_SMP > 1
Either explicit option selection, or multiple SMP service threads, should
enable SO_REUSEPORT

https://github.com/warmcat/libwebsockets/issues/2470
2021-10-30 06:24:04 +01:00
Andy Green
b912958a67 cmake: bring tls include requirement out as PUBLIC
There's no problem for library build, also with LWS_WITH_MINIMAL_EXAMPLES,
but after install at least on OSX, there are problems finding the installed
lws include dir (concealed on most platforms by the path being in the
default search list for the toolchain), and the references in the lws
includes to the tls includes meaning that explicit paths for that must be
available at consuming cmakes.

This patch enhances the cmake config installed by lws to deal with adding
the lws include paths to CMAKE_REQUIRED_INCLUDES and include_directories,
so it can be found before the target is introduced.

The tls include is passed back up the CMakeLists layers and the lws targets
marked with target_include_directories(PUBLIC) with them, so they are
understood as needed by consumers.

More boilerplate is moved out of the example consuming cmakes.

After this, on machines with previous installs of older lws, you may have to
clean out the cmake install path, that is usually something like

  /usr/local/lib/cmake/libwebsockets/*

before make installing lws and putting the latest content in there.
2021-10-28 10:47:12 +01:00
Chunho Lee
b843c09dc2 mqtt: allow indicating username and password are not on heap
Fix minimal-mqtt-client and minimal-mqtt-client-multi from crashes
by allowing indicating username and password are not on heap.
2021-10-27 16:55:12 +01:00
Chunho Lee
00b7fa23d0 plat: freertos: selectively use old service looping 2021-10-26 09:55:54 +01:00
Andy Green
1a69afaf6e raw-file: clear POLLOUT before handling 2021-10-24 16:57:40 +01:00
Jin Wang
b43f90a8ed ss: policy: adaptations for dynamic policy 2021-10-21 16:14:02 +01:00
Jin Wang
e9c92ec161 metrics: ss: skip tagging if no ss streamtypename 2021-10-19 10:51:23 +01:00
Andy Green
d77a6c397e client: connect_check fail just log once 2021-10-19 07:29:13 +01:00
Andy Green
36af266001 adns: fix label limit check 2021-10-16 09:44:37 +01:00
Andy Green
50f7bd4f6e logs: unconvert adns wsi deref after potential close 2021-10-16 08:28:22 +01:00
Andy Green
55a7c6a0f4 http: sse: check POLLIN during DOING_TRANSACTION
When the client goes away, on some platforms all we get is POLLIN revent
stuck on... we have to read it to find out a zero length result and
understand it's gone.

Add SSE mode's DOING_TRANSACTION to the list of states we will read for.
2021-10-16 05:33:56 +01:00
Andy Green
acb05eb1ca bind: use vhost log ctx since wsi optional 2021-10-16 05:33:41 +01:00
Andy Green
dcb115694a logs: log context: async_dns: no empty format string 2021-10-16 04:44:38 +01:00
Felipe Gasper
65faeab1bd logs: log context: async_dns
Of note: A single use of lwsl_debug() remains because the function in
question is documented as a public API, but the passed-in parameter
doesn’t offer a path to a logging context.
2021-10-15 19:10:44 +01:00
Andy Green
06bc1d8971 freertos: no need to freak out if service_adjust_to is 0
If lws_s_a_t() is zero, there's a path where n stays -1 from its
declaration and we return -1.
2021-10-15 19:10:33 +01:00
Felipe Gasper
826b221e38 client: fix nxdomain CCE 2021-10-15 14:15:12 +01:00
Felipe Gasper
ff5257e193 logs: migrate more to log context 2021-10-15 14:15:06 +01:00
Yichen Gu
9b56baca8f ss: static policy generator: fix filepath detection 2021-10-13 15:55:56 +01:00
Yichen Gu
61c2e3291f mqtt: protect printing debug only vars 2021-10-13 15:55:23 +01:00
Felipe Gasper
7fb6a450e8 logs: migrate ws extension code to contextual logging 2021-10-13 11:11:52 +01:00
Felipe Gasper
b53a09f61c logs: migrate client-parser-ws.c to contextual logging 2021-10-13 11:11:50 +01:00
Orefkov Aleksander
413ce239cd mbedtls: windows: add define to be compatible with the latest versions of mbedtls 2021-10-12 15:37:38 +01:00
Orefkov Aleksander
00b922041b mbedtls: set length even when LWS_HAVE_mbedtls_ssl_get_alpn_protocol 2021-10-12 09:46:32 +01:00
Orefkov Aleksander
c226da3e10 cmake: wrong miniz include dir + mbed link on windows 2021-10-12 09:46:28 +01:00
Andy Green
8d4526c780 smd: take message lock earlier 2021-10-12 09:46:17 +01:00
Felipe Gasper
fad2bdbeea Teach client-ws.c about log contexts. 2021-10-12 09:46:06 +01:00
Andy Green
df008ef6ce freertos: suppress return check on xSemaphoreTake
With the timeout set to portMAX_DELAY, there is no timeout and so no way
for the api to return failure.

https://www.freertos.org/a00122.html

However Coverity doesn't understand this, and futher, Coverity usually
ignores (void) result casts.  So add needless checks and the corresponding
needless unwinding to the 10 uses of lws_mutex_lock() in smd.c.

Invert the return value to align it with pthreads mutex lock return
semantics.
2021-10-08 09:49:58 +01:00
Pavel Otchertsov
05e9362df2 context: fix compilation error 2021-10-07 13:29:12 +01:00
caobug
a75fc1aae8 uv: handle uv_poll_init failure 2021-10-07 11:22:36 +01:00