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
Yichen Gu
403a6591e1 h2: client: handle END_STREAM and END_HEADERS togther on all paths 2021-01-29 21:22:35 +00:00
Andy Green
cfe4fa1551 http: proxy: fix uri relisting 2021-01-29 21:22:31 +00:00
terry.lu
3bf3b540ad windows: pipe: avoid busy loop in windows pipe event 2021-01-29 15:53:49 +00:00
Jed Lu
e588f308ac sigv4: allow arbitrary hash payloads 2021-01-29 15:53:49 +00:00
Andy Green
2fea1e49bd bsd: POLLHUP always bound to POLLIN
On OSX, POLLHUP is always |POLLIN, even if you did not wait
on POLLIN.  This causes a loop because we don't want to
ack the POLLHUP until we cleared any pollin (but there is
no pending POLLIN...)
2021-01-29 15:53:37 +00:00
Andy Green
3eeda84a8d http: client: defer HUP if pending buflist 2021-01-28 05:52:44 +00:00
Andy Green
6497220e87 plugins: add LWS_BUILD_HASH to header and require match
Also prioritize LD_LIBRARY_PATH check for plugins first

Iterate through paths in LD_LIBRARY_PATH in order

Warn on failed plugins init but continue protocol init
2021-01-28 05:52:41 +00:00
Andy Green
56f7007185 ctest: adapt background script 2021-01-26 07:48:10 +00:00
Andy Green
d5c90645c4 ctest: valgrind on hcm 2021-01-26 07:47:54 +00:00
Andy Green
33f3709426 h2: make headers in h2 even in wsi not in h2 role yet 2021-01-26 07:47:42 +00:00
Andy Green
1d0d05ea1b dbus: also add wsi tags
Add wsi tags for dbus role, also dbus may add a watcher in a disabled
state, don't action it if so on the lws event loop.  It'll re-add
if it wants it, confusingly.
2021-01-25 06:26:17 +00:00
Andy Green
1236114303 h2: client: action END_STREAM and END_HEADERS immediately 2021-01-23 20:58:39 +00:00
Andy Green
fd24392cd3 tls: add cmake options to dump tls 2021-01-23 20:58:36 +00:00
Andy Green
ffa0a38a1a openssl: acquire ex indexes once for multicontext
https://github.com/warmcat/libwebsockets/issues/2178
2021-01-23 04:55:56 +00:00
Sakthi Kannan
f17bb1aa29 mqtt: destroy PUBLISH pointers each time 2021-01-22 18:56:36 +00:00
Andy Green
beacabbdb1 vhost_destroy: refactor 2021-01-22 12:31:15 +00:00
Andy Green
d5618f6059 Wconversion: workarounds for CentOS7 2021-01-22 12:25:03 +00:00
Andy Green
bf9c517b39 set-cookie: force semicolon for concatenation 2021-01-22 12:25:03 +00:00
Andy Green
bdf472b411 ctest: add tests for evlib foreign example
This just runs each of the eventlib-foreign cases that are enabled, it doesn't
do a client action during the test yet since that's hard to arrange with ctest,
but it will catch most breakage.

Change the LD_LIBRARY_PATH order when looking for evlib plugins, so that it
searches there first, if given
2021-01-22 12:25:03 +00:00
Andy Green
f1e5e573e6 destroy: shuffle for internal 2021-01-22 12:24:58 +00:00
Andy Green
95a545b741 evlib: count extant evlib handles instead of wsi 2021-01-19 17:07:33 +00:00
Andy Green
50d032c0f5 openssl: client ctx: track tcrs in vh object 2021-01-19 14:13:41 +00:00
Andy Green
a520547a55 libuv: use centralize context_destroy path 2021-01-19 06:43:30 +00:00
Andy Green
9ed9a04870 unix-caps: switch to unsigned mode for Wconversion 2021-01-19 06:43:27 +00:00
Andy Green
9e10442103 ws-client-binance: make sure to cancel the sul on wsi close 2021-01-18 20:50:04 +00:00
Andy Green
46c925e3b7 h2: post: adapt in on _HTTP to be after mountpoint 2021-01-18 19:49:04 +00:00
Andy Green
e5b191be35 h2: post buflist: track rx_content_length
On h2 server POST, there's a race to see if the POST body is going to be
received coalesced with the headers.

The problem is on h2, we can't action the stream http request or body until
the stream is writeable, since we may start issuing the response right away;
there's already DEFERRING_ACTION state to manage this.  And indeed, the
coalesced, not-immediately-actionable POST body is buflisted properly.

However when we come to action the POST using buflisted data, we don't follow
the same pattern as dealing with the incoming data immediately.

This patch aligns the pattern dumping the buflist content to track
expected rx_content_length and handle BODY_COMPLETION if we got to
the end of it, along with removal from the pt list of wsi with pending
buflists if we used it up.
2021-01-18 19:49:02 +00:00
Andy Green
7bed5b0d0c peer-limits: only run clean up sul if any entries 2021-01-17 19:23:48 +00:00
Andy Green
51c9e7c01e cgi: only run cleanup sul when processes pending 2021-01-17 19:20:49 +00:00
Andy Green
63d14e2cd9 dbus: only run sul when timeouts pending 2021-01-17 19:20:49 +00:00
Andy Green
1062149e9f service: restrict effective wait to platform resolution 2021-01-17 11:32:48 +00:00
Andy Green
4dbf5454c9 tokenize: asterisk-nonterm 2021-01-17 09:38:08 +00:00
Andy Green
e2f18957c1 lws_strcmp_wildcard
Add helper to do a strcmp() but against the first argument that may
contain zero or more * wildcards
2021-01-16 20:52:48 +00:00
Andy Green
82c858ee2e humanize: remove padding and clean up 2021-01-16 07:33:59 +00:00
Andy Green
9be508bdd7 h2: make sure we see END_STREAM with END_HEADERS on client 2021-01-15 19:54:14 +00:00
Andy Green
c403b129ad mbedtls: change cert load semantics to append
Adapt the wrapper for SSL_CTX_add_client_CA_ASN1 to reuse
any existing x.509 chain and just add to it.  Previously it
was replacing it.
2021-01-13 20:05:59 +00:00
Andy Green
c6d172c2ed ss: server mode fixes 2021-01-13 04:33:17 +00:00
Andy Green
06662a64fa LE-root-cert-update
warmcat.com and libwebsockets.org use Let's Encrypt certificates... LE
have changed their CA signing arrangements and after 2021-01-12 (the
point I renewed the LE server certs and received one signed using the
new arrangements) it's required to trust new root certs for the examples
to connect to warmcat.com and libwebsockets.org.

https://letsencrypt.org/2020/09/17/new-root-and-intermediates.html

This updates the in-tree CA copies, the remote policies on warmcat.com
have also been updated.

Just goes to show for real client infrastructure, you need to run your own
CA (that doesn't have to be trusted by anything outside the clients)
where you can control the CA lifetime.
2021-01-13 04:32:13 +00:00
Christian Fuchs
b961e5f351 eventlib: add sd-event support 2021-01-11 08:12:46 +00:00
Andy Green
77055c4fd7 noserver: set tag_prefix for SERVER 2021-01-11 08:12:46 +00:00
Jed Lu
780a165a76 ss: http: mime parsing with unusual section boundaries 2021-01-11 08:12:46 +00:00
Andy Green
c86e1c5b56 cpd: lws_system_cpd_start_defer 2021-01-11 08:12:46 +00:00
Andy Green
60b5ca649e server_status: adapt for tags 2021-01-11 08:12:46 +00:00
Andy Green
d5178f477f client: HUP: defer POLLUP handling while buffered rx
If the server is very close in rtt to the client, the server
hangup may get processed before buffered rx.

Make sure we clear buffered rx before dealing with the HUP.
2021-01-11 08:12:46 +00:00
Andy Green
52b87c9037 minimal: h-s-form-post: only delete the spa once 2021-01-11 08:12:46 +00:00
Andy Green
aa45de9e2a ss: enforce only valid state transitions
The various stream transitions for direct ss, SSPC, smd, and
different protocols are all handled in different code, let's
stop hoping for the best and add a state transition validation
function that is used everywhere we pass a state change to a
user callback, and knows what is valid for the user state()
callback to see next, given the last state it was shown.

Let's assert if lws manages to violate that so we can find
where the problem is and provide a stricter guarantee about
what user state handler will see, no matter if ss or sspc
or other cases.

To facilitate that, move the states to start from 1, where
0 indicates the state unset.
2021-01-11 08:12:43 +00:00
Andy Green
47905401fa sspc: clear proxy conn timeout on ack
Remember to clear the 3s timeout set at sspc -> client connection, covering
the case that the SS serialization initial handshake doesn't take place
2021-01-05 10:56:38 +00:00
Andy Green
a82be3bd39 sspc: allow NULL rx and state in ssi
Sometimes there's no need for .tx or even .state... make sure we are OK with
that in the ssi by checking before sspc callthrus
2021-01-05 10:56:38 +00:00
Andy Green
629ccd4db8 sspc: ssv1: return policy about client dsh allocation
Let's allow the proxy to pass back what the policy says about
the size of dsh buffer the client side of this streamtype
should have.

Defer clientsize dsh generation until we got the info back
from the proxy in the response to the initial packet.  If
it's zero / unset in the policy, just go with 32KB.
2021-01-05 10:56:38 +00:00
Andy Green
1033e1d4c8 sspc: ssv1: pass client PID into proxy for tagging
Let's have the client processes pass in their pid, and tag the related proxy SS
with that pid, so we can see on whose behalf the proxy is acting.
2021-01-05 10:56:38 +00:00