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

4205 commits

Author SHA1 Message Date
Andy Green
5570692cab sai: add SUL_DEBUGGING to osx m1 2021-01-04 05:40:12 +00:00
Andy Green
b2898b5bfc lejp: allow for no cb on unprepared lejp on destroy
On an error path, we might not have a valid spa / lejp to destroy.
In that case, don't hurl ourselves into calling a
function pointer that can be NULL for the destroy cb.
2021-01-04 05:40:12 +00:00
Andy Green
3ced2a4f90 sys: blob: appended bugflist blob offset by LWS_PRE 2021-01-04 05:40:12 +00:00
Andy Green
454d173aea sys vh: set NO_LISTEN 2021-01-04 05:40:12 +00:00
Andy Green
38496b9184 smp: connect3: hold pt lock when removing failed connect attempt 2021-01-04 05:40:12 +00:00
Andy Green
0d720082fb ss: smd: make sure to cancel write sul 2021-01-04 05:40:12 +00:00
Andy Green
ad11a09a79 lws_smd: make api test fail immediately 2021-01-04 05:40:12 +00:00
Andy Green
a13b34db1c smd: add warning for queue depth 2021-01-04 05:40:12 +00:00
Andy Green
e11d78dc5e sspc: cleanup bridged wsi 2021-01-04 05:40:12 +00:00
Andy Green
ef6bebda3c lws_wsi_close: fix wsi name 2021-01-04 05:40:12 +00:00
Andy Green
905e5373c6 ss: proxy_buflen in policy sets proxy max dsh alloc per streamtype 2021-01-04 05:39:06 +00:00
Andy Green
93f54c61c5 ss: enforce balanced CONNECT vs DISCONNECT 2021-01-04 05:26:50 +00:00
Andy Green
b5d656058f tags: prefix tags with pid if SS_PROXY_API
Make the logs a bit easier to understand when dealing with tagged objects,
when multiple client processes active, including at the proxy
2021-01-04 05:26:50 +00:00
Andy Green
0ceba15d9c lws_lifecycle
This adds some new objects and helpers for keeping and logging
info on grouped allocations, a group is, eg, SS handles or client
wsis.

Allocated objects get a context-unique "tag" string intended to replace
%p / wsi pointers etc.  Pointers quickly become confusing when
allocations are freed and reused, the tag string won't repeat
until you produce 2^64 objects in a context.

In addition the tag string documents the object group, with prefixes
like "wsi-" or "vh-" and contain object-specific additional
information like the vhost name, address / port  or the role of the wsi.
At creation time the lws code can use a format string and args
to add whatever group-specific info makes sense, eg, a wsi bound
to a secure stream can also append the guid of the secure stream,
it's copied into the new object tag and so is still available
cleanly after the stream is destroyed if the wsi outlives it.
2021-01-04 05:26:50 +00:00
Andy Green
d330dbd76a wsi: unify base wsi creation function
A few different places want to create wsis and basically repeat their
own versions of the flow.  Let's unify it into one helper in wsi.c

Also require the context lock held (this only impacts LWS_MAX_SMP > 1)
2021-01-04 05:26:50 +00:00
Rogonov Stepan
31435c9f70 cmake: move LWS__INCLUDE_DIRS def to after REL_INCLIDE_DIR def
Generate the config file for the installation tree
fix wrong LWS__INCLUDE_DIRS definition
2020-12-27 08:42:13 +00:00
Andy Green
ac6a582254 protocol_init: ensure its happening without client 2020-12-27 08:42:02 +00:00
Andy Green
3234201531 lws_struct: sqlite: use incoming ac ptr as well as set on exit 2020-12-27 08:42:02 +00:00
Andy Green
54e909a126 mbedtls: tls flow for mqtt 2020-12-27 08:42:02 +00:00
Andy Green
d98c9310e1 ss: UNREACHABLE: set ordinal in state cb b0 if due to DNS server reachability issue
For LWSSSCS_UNREACHABLE state, the additional ord arg has b0 set if the
reason for the unreachability is because the DNS server itself was not
reachable (implying either DNS server is wrongly set, or is not reachable
due to not having connectivity through to it)
2020-12-27 08:42:02 +00:00
Andy Green
556154c3c9 cpd: trigger if getaddrinfo failed
If getaddrinfo() is not able to reach the server, there may be
a connectivity problem downstream of the device that has not
been recognized by the Captive Portal Detect pieces yet.

If it looks like that might have happened, used the getaddrinfo()
return to provoke a new CPD scan.
2020-12-27 08:42:02 +00:00
Andy Green
094bfc4e99 ss-hx: make sure hanging_some handled once 2020-12-27 08:41:58 +00:00
Andy Green
097bbbd1eb ss: client_connect and request_tx also return dispositions
Since client_connect and request_tx can be called from code that expects
the ss handle to be in scope, these calls can't deal with destroying the
ss handle and must pass the lws_ss_state_return_t disposition back to
the caller to handle.
2020-12-24 16:14:36 +00:00
Andy Green
747ea560a0 ss: cpd: ignore new requests while ongoing up to timeout 2020-12-24 16:14:36 +00:00
Andy Green
20ea15112f ss: proxy: more max fds 2020-12-24 16:14:36 +00:00
Andy Green
19e7bc106e sspc: allocate dsh once per stream 2020-12-24 16:14:36 +00:00
Andy Green
44ad73e07c sspc: close sequencing fixes 2020-12-24 16:14:36 +00:00
Andy Green
d8551a4be8 sspc: handle not inherited 2020-12-24 16:14:36 +00:00
Andy Green
da30c6483f ss: fetch_policy cleanup 2020-12-24 16:14:36 +00:00
Andy Green
5947e54a66 ss: mark client wsi bound to ss using flag 2020-12-24 16:14:36 +00:00
Jed Lu
83feefe288 If network is down, SS reaches ALL_RETRIES_FAILED, and user
callback returns LWSSSSRET_DESTROY_ME, it does not go to DESTROYING
state
2020-12-24 16:14:36 +00:00
Andy Green
f409878bb6 dummy: unhandled POST completion issues 200 2020-12-24 16:14:36 +00:00
Andy Green
1f477e4915 client: clean up pwsi if late failure 2020-12-24 16:14:36 +00:00
Andy Green
eb5f437578 h2: post: add states to wait for body 2020-12-24 16:14:36 +00:00
Andy Green
c6cb821165 h2: post: handle no content length better
http content-length is not mandatory on POST, making a whole
bunch of difficulties.  On h2, the client will set the stream
half-closed by DATA with END_STREAM flag when it is done.

Improve the post data tracking to understand that situation
properly.
2020-12-24 16:14:36 +00:00
Andy Green
677b6e370c h2: remove length tracking just use pointer arithmetic 2020-12-24 16:14:36 +00:00
Andy Green
e560d2c049 h2: stay a client if a client 2020-12-24 16:14:36 +00:00
Andy Green
81bd0f8e55 sai: OSX target 10.15 2020-12-24 16:14:36 +00:00
Andy Green
67c50d0585 sai: restrict individual build parallelism 2020-12-24 16:14:36 +00:00
Andy Green
50d949dda9 sai: freebsd: reduce parallel from 12 to 3 for OOM 2020-12-24 16:14:36 +00:00
Jed Lu
3c661ede9e ss: http: make sure we dont duplicate leading path slash if already present 2020-12-24 16:14:36 +00:00
Andy Green
19935e5861 minimal-h-s-tls: bind to default http-only 2020-12-24 16:14:36 +00:00
Andy Green
49b301b53b minimal: http-client-multi: set h2 or h1 via alpn 2020-12-24 16:14:36 +00:00
Andy Green
96eb1cd760 ctest: add valgrind to some tests if platform has it available 2020-12-24 16:14:36 +00:00
Andy Green
68afe5b492 ss: minimal example: testsfail
A minimal example aimed at various SS failure paths.
2020-12-24 16:14:36 +00:00
Andy Green
36de3d8300 ss: h2: dont report nwsi close
SS protocol doesn't want to hear about the nwsi closing after
any streams on the protocol closed.
2020-12-24 16:14:36 +00:00
Andy Green
cdbd50a2e6 dns-sort: reduce logging to info 2020-12-24 16:14:36 +00:00
Andy Green
3cd5492a15 client: reject mux same endpoint conn on h1 if no h1 alpn
With synthetic tests, we can have an h1 connection open to a server
and ask for an h2-specific connection to the same thing... lws will
bind it to the idle h1 connection since the endpoint and tls matches.

This also makes it check that the alpn filtering matches h1 before
allowing that.
2020-12-24 16:14:36 +00:00
Andy Green
828b5cae24 ss: h2: set alpn
In order to force h2, we need to specify the client acceptable alpn as h2
2020-12-24 16:14:36 +00:00
Andy Green
8312ff499e ss: clean up wsi when handling DESTROY_ME 2020-12-24 16:14:36 +00:00