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
619ef5eb17 smd: add use class base index
In addition to the well-known classes, add a user class base bit offset
so distributed user applications can cleanly send messages using SMD
2021-01-05 10:56:38 +00:00
Andy Green
4b2c0fdc1d smd: lock when removing messages 2021-01-05 10:56:38 +00:00
Andy Green
940abe557a ss: policy: add auth mapping section 2021-01-05 10:56:38 +00:00
Andy Green
ce3b99cd8f clean: reduce logging and add some conditional debug helpers 2021-01-05 10:56:38 +00:00
Andy Green
c48bebc9ae h2: post: http_action: issue _HTTP and consume deferred body when resuming
When we have to defer http_action for a stream because we may not have
any writeability, we stash any incoming body on the rx buflist for the wsi
which is good.

But when we resume under some conditions, we don't issue the _HTTP cb and
don't drain the stashed body.  It's cleaned out in the close flow, but it's
broken.

This makes the deferred resume flow do the right thing under those conditions.
2021-01-05 10:56:38 +00:00
Andy Green
5af65114c9 cgi: modernize sul usage 2021-01-05 10:56:38 +00:00
Andy Green
c9731c5f17 type comparisons: fixes
This is a huge patch that should be a global NOP.

For unix type platforms it enables -Wconversion to issue warnings (-> error)
for all automatic casts that seem less than ideal but are normally concealed
by the toolchain.

This is things like passing an int to a size_t argument.  Once enabled, I
went through all args on my default build (which build most things) and
tried to make the removed default cast explicit.

With that approach it neither change nor bloat the code, since it compiles
to whatever it was doing before, just with the casts made explicit... in a
few cases I changed some length args from int to size_t but largely left
the causes alone.

From now on, new code that is relying on less than ideal casting
will complain and nudge me to improve it by warnings.
2021-01-05 10:56:38 +00:00
Andy Green
2d6b9a06a7 windows: migrate to WSAPoll
Switch out the guts of the default window platform
wait to use WSAPoll(), switch the lws_cancel_service()
mechanism to use a UDP socket pair.
2021-01-05 10:56:38 +00:00
Andy Green
cef8ce81f7 client: dns-sort: classify on no source if dest ads 2021-01-05 10:56:38 +00:00
Andy Green
cb1e893e2d client: connect: use memmove due to possible overlap 2021-01-05 10:56:38 +00:00
Andy Green
815b9074fc lws-struct: json and sqlite on 32-bit OS
Test that we can handle int -1 correctly on sqlite and
greater than 32-bit unsigned on json with ull
2021-01-05 10:56:26 +00:00
Andy Green
cc5a802b0d glib: workaround old glib without G_SOURCE_FUNC 2021-01-05 09:25:30 +00:00
Andy Green
2e22393c4b sai: add minimal examples / ctest on DISTRO_RECOMMENDED 2021-01-05 08:33:32 +00:00
Andy Green
1422b23899 dll2: explicitly confim detached dll2 has no linkage 2021-01-04 05:40:12 +00:00
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