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

4519 commits

Author SHA1 Message Date
Andy Green
a7edd16399 logs: more internal conversion to log_cx 2021-07-01 05:20:53 +01:00
Andy Green
5d8cf03221 logs: log contexts 2021-07-01 05:20:53 +01:00
Andy Green
8e76634ed3 logs: introduce log_cx 2021-07-01 05:20:53 +01:00
Andy Green
9d123ea507 extpoll: clean up test server for Wconversion in extpoll parts
https://github.com/warmcat/libwebsockets/issues/2332
2021-07-01 05:20:49 +01:00
Chunho Lee
349cc1b635 mqtt: fix wrong packet id in some conditions 2021-07-01 05:11:25 +01:00
Andy Green
66afeaa5bc 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-06-28 08:52:20 +01:00
Andy Green
604968a31d minimal: hcmulti: modernize startup to use OPERATIONAL 2021-06-27 08:42:28 +01:00
Andy Green
34afca321c netlink: hold in COLDPLUG until we actually have some routing table contents 2021-06-27 08:42:26 +01:00
Andy Green
d5475807b0 tls restriction: check before doing bio 2021-06-26 14:59:50 +01:00
Andy Green
576bed631f 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-26 13:03:13 +01:00
Andy Green
9e8eb28c72 sul: improve debugging 2021-06-26 13:03:13 +01:00
Andy Green
c0680fa2b6 connect: fix cli_hostname leak breaking staggered h1 pipeline 2021-06-26 13:03:13 +01:00
Jed Lu
c2e10db5f2 ss-policy2c-update 2021-06-26 12:31:44 +01:00
David Jeffers
c90feba3f6 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-24 17:32:57 +01:00
Andy Green
1c72e9eee6 minimal: ws client spam: modernize with pvo and cancel service after interrupted 2021-06-24 16:55:25 +01:00
Andy Green
0dd8a4a503 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:31:39 +01:00
Andy Green
a095e6c60b ss: sspc: enforce not allowed to call lws_ss[pc]_destroy from callbacks
For both ss and sspc, enforce at runtime that user code cannot call
lws_ss[pc]_destroy on a handle from a callback.

The error indicates the remedy (return DESTROY_ME) and asserts.
2021-06-23 16:51:59 +01:00
Andy Green
5ea9194378 ss: check destroy null policy 2021-06-22 17:44:40 +01:00
Andy Green
7135b3113b ss: check serialize null policy 2021-06-22 16:54:04 +01:00
Andy Green
c859b60854 ss: avoid null ss policy on req tx len 2021-06-22 16:47:59 +01:00
Andy Green
9bd8819045 ss: avoid null ss policy on req tx 2021-06-22 16:47:11 +01:00
Andy Green
cf2dbdc6a0 vhost: create multiple listen sockets per AF
On some platforms AF_INET and AF_INET6 must be listened for on separate
sockets.  Adapt the vhost server creation code to use the new support for
multiple listen sockets per vhost to create up to two listen sockets for
AF_INET and AF_INET6.

It refactors how the decision about the AF is made and propagated so
there's only one place for it.
2021-06-22 16:25:50 +01:00
Andy Green
6163c96727 vhost: allow multiple listen sockets
Some platforms need two sockets with AF_INET and AF_INET6 to listen to both
protocols.

This patch changes the single listen socket each vhost could previously
handle to become an lws_dll2 and adapts the related code to handle them as
a linked-list rather than as a singleton.

The next patch adapts the listen / server code to create multiple listen
wsi for vhosts listening on multiple ip protocols.
2021-06-22 15:55:47 +01:00
Andy Green
8c122cd8bd redirect: make sure we start with / on path 2021-06-22 15:55:36 +01:00
Andy Green
272dba8307 http: redo redirects to follow close flow
Until now although we can follow redirects, and they can promote the
protocol from h1->h2, we couldn't handle h2 wsi reuse since there are many
states in the wsi affected by being h2.

This wipes the related states in lws_wsi_reset() and follows the generic
wsi close flow before deviating into the redirect really close to the end,
ensuring we cleaned out evidence of our previous life properly.

h2->h2 redirects work properly after this.

The max number of redirects is increased from 3 -> 4 since this was seen in
the wild with www and then geographic-based redirects.
2021-06-22 15:55:29 +01:00
Andy Green
2f9bb7a30a tls: JIT Trust
Add support for dynamically determining the CAs needed to validate server
certificates.  This allows you to avoid instantiating > 120 X.509 trusted
CA certs and have them take up heap the whole time.

Works for both openssl and mbedtls.

See READMEs/README.jit-trust.md for the documentation

You likely want the next patch for http redirect enhancements as well.
2021-06-22 15:55:29 +01:00
Andy Green
f8f1749be9 client: add option for allowing redirect tls downgrades 2021-06-22 15:55:29 +01:00
Andy Green
983edafdb4 mbedtls: add AKID and SKID support 2021-06-22 15:55:29 +01:00
Andy Green
b25079c4b4 lws_cache_ttl 2021-06-22 15:55:29 +01:00
Haopeng Li
cb5b1f720b ss: h1: log dereferences NULL 2021-06-22 15:54:22 +01:00
Andy Green
c09d69e291 minimal: htt-client: send user agent and accept
Some servers will 4xx us if they don't see these headers
2021-06-22 15:54:13 +01:00
Andy Green
3ef0b0268d ctest: do not reuse ctest-ssp path 2021-06-22 15:54:05 +01:00
Andy Green
c476d30a94 android: getnameinfo uses nonstandard size_t 2021-06-20 13:39:46 +01:00
Andy Green
1929e1f128 getifaddrs: casts for android 2021-06-20 08:40:00 +01:00
Mykola Stryebkov
8886cc263f win32: client: just do WIN32 check 2021-06-20 07:51:28 +01:00
Andy Green
a2091bdbc8 windows: only conceal mode_t on windows 2021-06-20 07:51:24 +01:00
Andy Green
350a6dc9ef threadpool: disassociate wsi on close 2021-06-20 06:03:59 +01:00
RobHap
226c88ba32 freertos: check for forcing each time around service loop
https://github.com/warmcat/libwebsockets/issues/2325
2021-06-16 05:56:25 +01:00
kekxv
c61ce6f07f cmake: tls: use CHECK_SYMBOL_EXISTS 2021-06-15 15:17:34 +01:00
Andy Green
a481a6eb69 plugin: post: check unexpected write after protocol unbind 2021-06-14 11:20:42 +01:00
Jed Lu
2abf4115a8 ss: direct protocol string 2021-06-11 14:44:10 +01:00
Jed Lu
e82778e07a ss: static policy for sigv4 2021-06-11 14:25:12 +01:00
Chunho Lee
af2067365e clean: else became a NOP 2021-06-09 08:11:20 +01:00
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