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

4776 commits

Author SHA1 Message Date
Haopeng Li
b3bff76a73 strexp: handle NULL better 2021-06-07 15:11:12 +01:00
Andy Green
9fe4b37650 wilcard: change api to use length for check
The wilcard part was always length driven... but the check part relied on
being NUL terminated.  Change that to also use a length specifier and not
need any NUL.

To migrate old uses, just add a fourth param as strlen(check).
2021-06-07 14:57:57 +01:00
DUOLabs333
d815c39c0c cygwin: include in unix type socket init 2021-06-07 08:17:52 +01:00
Andy Green
509d0528a9 examples: embedded: keep loop running on WROVER 2021-06-07 08:17:51 +01:00
Andy Green
7baf400017 evlib: allow custom evlib ops
Adapt the event lib support slighly so we can pass an event lib "plugin"
header in at context creation time, and direct all event loop handling to
go via that.

This can then be lightly adapted to interface to an existing custom event
loop cleanly, without the problems of EXTERNAL_POLL.

The external loop must consult with us about the max wait timeout as shown
in the added minimal-http-server-eventlib-custom example.

The example shows a complete implementation working with a custom poll()
loop cleanly while only needing 5 ops in the custom event lib handler.
2021-06-07 08:17:49 +01:00
caobug
cc4fd2c916 OSX: Fixed can't find clock_gettime 2021-06-06 05:38:56 +01:00
Khem Raj
4b180546db 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-05 07:51:05 +01:00
Andy Green
890023f821 ss: h2: handle zero length COLON_PATH for metadata 2021-06-04 15:31:49 +01:00
Andy Green
6c5636889d sspc: handle nonexistent metadata cleanly 2021-06-04 15:05:36 +01:00
Andy Green
faad862fb2 coverity: ntp from blob: handle blob missing 2021-06-04 14:58:15 +01:00
Andy Green
614c1e0ff6 coverity: report problem in hpack_dynamic_size() to parent 2021-06-04 14:52:01 +01:00
Andy Green
436bb70919 coverity: h->cwsi must be valid if we are handling rx on it 2021-06-04 14:17:13 +01:00
Andy Green
0517a2a629 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-05-28 10:10:15 +01:00
Jed Lu
5b1a260881 ss: sspc: handle destroy for client_connect and request_tx 2021-05-28 09:41:39 +01:00
Andy Green
f96f2a88de windows: mbedtls: use recv / send 2021-05-27 11:40:44 +01:00
Chunho Lee
c5484c0232 ss-mqtt: Add support for MQTT UNSUBSCRIBE and DISCONNECT
Send UNSUBSCRIBE and DISCONNECT when LWSSSSRET_DISCONNECT_ME is
returned.
2021-05-27 11:37:44 +01:00
Chunho Lee
85cec16f95 mqtt: Add support for QoS 2
Add support for QoS 2.
2021-05-27 11:36:54 +01:00
Jed Lu
ae8b11aa83 ss: do not restrict close handling to WITH_SERVER 2021-05-26 14:07:27 +01:00
Andrey Grafin
4341d756ae 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-26 14:07:27 +01:00
Andy Green
c70c4bac89 coverity: ss: handle NULL omd 2021-05-26 14:07:02 +01:00
Andy Green
632ffa1eca ss: deal with missing handle metadata 2021-05-25 14:57:57 +01:00
Andy Green
ad3aa5339e TCP_FASTOPEN 2021-05-25 08:13:13 +01:00
Andy Green
f9ae34c320 sse: server: handle close found as HUP 2021-05-23 14:59:42 +01:00
Or Lupovitz
16328b1918 mbedtls: server: enforce client cert check when vhost requires 2021-05-23 14:58:07 +01:00
Andy Green
8ebe1d9323 mbedtls: prepare for v3 changes 2021-05-23 10:55:52 +01:00
Andy Green
212690fb23 smd_queue_depth: cast around toolchain int16_t conv warning 2021-05-23 10:29:51 +01:00
Jin Wang
2197c2eafc sspc: handle DESTROY_ME at proxy link close cb
It's open to user state callback to respond to the DISCONNECT we issue on
the proxy link closure by escalating it to a DESTROY_ME... we have to deal
with that if it comes.
2021-05-20 15:24:42 +01:00
Andy Green
7b315e394f smp: give PROTOCOL_INIT a privake fakewsi
At init-time, PROTOCOL_INIT needs to be sent to each vhost-protocol
combination to give them a chance to instantiate themselves.

PROTOCOL_INIT can be deferred a bit, and since its subject is per vhost,
which has no tsi affinity, in SMP case, its current use of context->pt[0]
fakewsi can clash with other stuff happening simultaneously, eg,
CANCEL_SERVICE broadcast, which happens on each pt.

Solve this by changing PROTOCOL_INIT to use an on-stack fakewsi that cannot
clash with any other service loop use of them.

Take care about using a full fake wsi or an lws_a fakewsi if PLAT_FREERTOS.
2021-05-20 11:29:12 +01:00
ycyang1229
e76ee9cb91 mbedtls: privkey from file: fix off-by-one 2021-05-20 11:28:47 +01:00
Andy Green
ecacbfbbbd mqtt: coverity: help coverity see we wont have an mqtt role wsi without mqtt member allocated 2021-05-17 11:34:30 +01:00
Yichen Gu
febca16a0b lwip: handle ECONNABORTED on tls read 2021-05-17 11:34:28 +01:00
Andy Green
9c6e2ffb65 smp: fix client tsi detection 2021-05-12 09:06:11 +01:00
Andy Green
a3765d118c ss: h2: leave the ss bound to its affiliated wsi until close clears it
In sai, on Xenial (only...) noticed that the wsi is still bound to the ss
handle, and can reference it even after the ss has been destroyed on
ss-testsfail sometimes.

Leave the handle knowing its wsi and able to detach it later during close.
2021-05-07 11:12:51 +01:00
Andy Green
3016385671 h2: migration: migrate for_ss
The attribute indicating that a wsi belongs to an SS object also must be
migrated when we split out the original transaction wsi into a new nwsi, if we're
not going to lose track of its affiliation.

Likewise if the affiliated SS object points to the original wsi, we have to
migrate his pointer when we migrate the wsi.

Taking care of this book-keeping is necessary to get correct behaviours at
close-time.
2021-05-07 10:24:30 +01:00
Andy Green
88c824b89d ss: avs: let multipart handle content-type
We added the neccessary return check on set_metadata which is good, but it
doesn't take into account that for LWA, we will normally use the multipart
stuff, that provides its own conflicting content-type.

Currently the lwa streamtype policy doesn't even provide ctype metadata
type, let's just comment it out.
2021-05-07 10:15:05 +01:00
Andy Green
19d59f9977 listen: ip bind: force ipv4 if given ipv4 numeric iface 2021-05-06 20:51:43 +01:00
Jed Lu
6595d3da72 cpd: remove scheduled recheck on dns fail 2021-05-06 17:11:27 +01:00
Andy Green
c58532803e license: fix two old headers from pre-MIT change
These two headers managed to avoid the global switch from
LGPL2.1 -> MIT back in the day, correct them to be aligned
with the rest of lws' own license, ie, MIT.
2021-05-04 18:33:36 +01:00
Andy Green
a12d5ebed6 LICENSE: copy secondary license texts into LICENSE as a convenience 2021-05-04 15:51:45 +01:00
Catalin Raceanu
cf867faa46 tls: client: session cache synthetic cb 2021-04-29 20:03:41 +01:00
Yury Is
7247205e40 netlink: fix RTM_NEWLINK handling
https://github.com/warmcat/libwebsockets/issues/2287
2021-04-29 12:28:39 +01:00
Yucong Sun
abada11fe1 cmake: Allow OPENSSL_INCLUDE_DIR to be empty
on some system the include dir is empty, and the detection will miss a lot of functions and fail to compile.
2021-04-29 05:29:58 +01:00
Catalin
373b50d7d1 tls-sessions: Use OpenSSL API to test if a session was reused 2021-04-27 15:42:53 +01:00
Catalin
d2a40a119e tls-sessions: Assign loaded TLS session to its intended pointer 2021-04-27 14:45:17 +01:00
Catalin
80ca71d598 Remove incorrect session ref count increment 2021-04-27 14:45:14 +01:00
Marco Gratzke
32c4d2cb29 spa: parser should tolerate additional headers 2021-04-27 11:54:06 +01:00
Yichen Gu
5fdd9c99b1 ss: policy2c: type error on respmap 2021-04-21 19:30:42 +01:00
Andy Green
2dba500d4f h2: just log nwsi close and pass thru
User reports problems with the close / retry flow not happening if we don't
pass thru the nwsi close... it may be happening before the sid1 migration.

Just log it and don't end the handling before the passthru.  Logging it
because there was a reason for the change to not passing it through...
2021-04-21 16:05:24 +01:00
Andy Green
891f28b43e ss: proxy: fix conn deref on onward
Trying to use the opaque pointer in the handle to point to the conn isn't
going to work when we need it to point to the ss handle.

Move it to have its on place in the handle.
2021-04-21 10:02:00 +01:00
Andy Green
ff8912ba96 netlink: make failure to bind nonfatal 2021-04-20 16:05:01 +01:00