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

3618 commits

Author SHA1 Message Date
Haopeng Li
108b4608f4 ss: make ss timeout handle underlying wsi gone 2021-03-13 07:16:15 +00:00
Curi0
dbc89c88ec windows: openssl: load certificates from certificate store 2021-03-12 09:25:51 +00:00
Andy Green
a7f7053591 connect2: log dereferences things that may have been destroyed
It's perfectly possible we will have destroyed the wsi and report that
back in the return code.  So let's not dumbly defreference the wsi to
make a log inbetweentimes.

Found with fault injection and valgrind.
2021-03-11 06:59:03 +00:00
Andy Green
9528acb4b8 connect: erase previous unusability when retrying connect
In the case that we try ipv6 that isn't routable, we get a POLLHUP, that
marks the wsi as unusable (for writes, not pending reads), that's what
we want.

But in the case we go around and retry other dns results that are
routable, we have to clear the wsi unusable flag.  Otherwise we will
connect and find that we can't write on the connection...
2021-03-11 06:59:03 +00:00
Andy Green
9d13b97e37 client: DNS failure should retry while waiting for connect timeout
If the DNS lookup fails, we just sit out the remaining connect time.

The adapts it to reuse the wsi->sul_connect_timeout to schedule DNS lookup
retries until we're out of time.

Eventually we want to try other things as well, this is aligned with that.

Found with fault injection.
2021-03-11 06:58:59 +00:00
Andy Green
0775a0d0f1 tokenize: add option for equals as non-delimiter
We may want to handle "x=y" as one token string, to be
passed up to something else to parse.
2021-03-10 15:05:23 +00:00
Jin Wang
84565adf72 sspc: allow longer streamtype names in proxy 2021-03-10 15:04:37 +00:00
Andy Green
3f4623bb36 lws_metrics
There are a few build options that are trying to keep and report
various statistics

 - DETAILED_LATENCY
 - SERVER_STATUS
 - WITH_STATS

remove all those and establish a generic rplacement, lws_metrics.

lws_metrics makes its stats available via an lws_system ops function
pointer that the user code can set.

Openmetrics export is supported, for, eg, prometheus scraping.
2021-03-08 21:47:28 +00:00
Andy Green
c11a49c0b9 sai: solaris 2021-03-08 21:47:14 +00:00
Andy Green
d72955cc7f solaris: spawn: vfork is deprecated on solaris 11 2021-03-08 20:43:50 +00:00
Andy Green
2123bfce25 solaris: dir: remove accidental dirent type reference 2021-03-08 20:43:39 +00:00
Andy Green
e7a96a7175 solaris: socket priority 2021-03-08 20:43:29 +00:00
Andy Green
f9c3d432a8 netlink: migrate to context
For SMP case, it was desirable to have a netlink listener per pt so they
could deal with pt-level changes in the pt's local service thread.  But
Linux restricts the process to just one netlink listener.

We worked around it by only listening on pt[0], this aligns us a bit more
with the reality and moves to a single routing table in the context.
There's still more to do for SMP case locking.
2021-03-08 20:43:19 +00:00
Curi0
8dbe8507a3 windows-resolv: fix dns resolution
before this patch all i got was 'cant get dns servers' on my laptop running windows 10 1909
2021-03-05 20:08:51 +00:00
Andy Green
6d0f2500b0 windows: doesnt have #warning 2021-03-05 20:08:49 +00:00
Andy Green
ede7f8b0f3 ss: support huge urls 2021-03-05 14:13:26 +00:00
Andreas Weigel
d1763df9ed lws_struct: fix implicit schema recognition
actually use the index to iterate through the map of children to
not only match the first ever occurring entry
2021-03-01 19:51:12 +00:00
Andy Green
9af105ebf8 sai: xenial 2021-02-28 19:05:25 +00:00
Andy Green
09b9ac6e33 minimal-http-client: set option to fix broken server window update 2021-02-28 12:10:26 +00:00
Andy Green
a79342014d sspc: only do CREATING if its our first rodeo 2021-02-26 08:23:12 +00:00
Andy Green
789d98b98b sspc: handle loss of proxy manifesting itself as 0 length rx
If the client library loses the proxy connection, it can receive
an endless stream of 0 length rx instead of understanding that
the UDS peer has gone.

Handle that correctly so the client reacts to the loss of the
proxy link by trying to reacquire it.

Adapt the sspc state to be suitable for retry in that case,
by dropping any dsh and letting the logical ss know that he
is DISCONNECTED, if he thought he was CONNECTED.
2021-02-26 07:59:13 +00:00
Andy Green
cb5c0059a3 sai-resource 2021-02-24 08:56:27 +00:00
Andy Green
b47511352e async-dns: 2021-02-20 13:54:38 +00:00
Andy Green
14c5b7ebaf ss: state violations need to report lifecycle tags
The state tracking and violation detection is very powerful at enforcing
only legal transitions, but if it's busy, we don't get to see which stream
had to problem.  Add a pointer to the handle lc tag, do that rather than
just pass the handle so we can deal with ss and sspc handles cleanly.
2021-02-20 13:54:37 +00:00
Andy Green
10a6afdcd9 sspc: avoid dsh deref if stream instantiation failed 2021-02-20 13:54:35 +00:00
Andy Green
3fe08ce5d8 fault injection 2021-02-20 13:54:35 +00:00
Andy Green
8a087043c6 smd: account for new interested peers joining while queue exists 2021-02-20 13:54:35 +00:00
Andy Green
fc5302589c HUP: mark socket unusable 2021-02-20 13:54:34 +00:00
Andy Green
8d5341d74e vh init: make sure protocol set 2021-02-20 13:54:32 +00:00
Andy Green
dc051fb2ae OpenBSD: various api ports 2021-02-17 11:39:15 +00:00
Andy Green
8e5f8491db opensslv3: handle deprecation of EC apis
openssl v3-alpha11 has marked EC_KEY pieces as deprecated... we use it in
LWS_WITH_GENCRYPTO but the related RSA etc pieces were already deprecated
for that.  We use EC_KEY pieces in vhost init...

The apis are not removed but deprecated, we should have a way to keep
trucking, but as it is the deprecation warning is promoted to an error.

Let's add LWS_SUPPRESS_DEPRECATED_API_WARNINGS option off by default.  If
enabled at cmake, external deprecated api warnings are suppressed.  This
gives a general workaround for now for opensslv3.

In addition, even if you don't do that, let's notice we are on openssl v3
and don't build the EC curve selection stuff, I don't think anyone is
actually using it anyway.
2021-02-17 11:39:15 +00:00
Andy Green
599691d233 dhcp: clean 2021-02-17 11:39:15 +00:00
Andy Green
d86d2884c8 libevent: use evutil_socket_t 2021-02-17 11:39:15 +00:00
Gang Chen
54110778ab http: x-amn-dss-signature header 2021-02-17 11:39:15 +00:00
Andy Green
1f019f99f4 libressl: adapt type rules
Update libressl rules for options api type,
add some docs to build, use CHECK_SYMBOL_EXISTS since
CHECK_FUNCTION_EXISTS is fooled by the conditionals
in the headers
2021-02-17 11:39:15 +00:00
Andy Green
f42c97baa9 route: on change also check source address still extant 2021-02-17 11:39:12 +00:00
Andy Green
8a6df77dce adns: keep last 3 tids for slow responses 2021-02-09 17:11:25 +00:00
Andy Green
24c0814fd3 async dns: correctly deal with cb killing wsi 2021-02-09 16:56:09 +00:00
Andy Green
eb782bd41e ip tos support 2021-02-04 10:28:02 +00:00
Jed Lu
0a453e3be3 tls: wrapper: make sure alpn freed once 2021-02-03 08:49:59 +00:00
Andy Green
00b9ef09c0 netlink: back out lifecycle tag on netlink fail 2021-02-03 08:49:59 +00:00
Andy Green
a6d81e3fcc async dns: add dump helper when _DEBUG 2021-02-03 08:49:54 +00:00
Andy Green
79c02baa9e async dns: add write confirm sul
If no routeable gateway, we can be unable to get WRITEABLE.  Add
a sul in the query to limit that situation to 3s before failing
the query.
2021-02-03 07:21:45 +00:00
Andy Green
ed01fc2d44 async dns: tolerate no nameserver at startup
No need to be fatal about it, we will pick up on the nameserver
next time we try to resolve something after it appears.
2021-02-03 07:21:45 +00:00
Andy Green
3192b3cab9 adns-api-test-l
Add -l option on lws-api-test-async-dns that makes it sit there trying to
lookup warmcat.com every 5s until ^C.  This is useful to test behaviour
over loss of connectivity and regaining it.
2021-02-03 07:21:45 +00:00
Andy Green
15bb455249 sspc: dsh: add rx flow control to policy
Add .proxy_buflen_rxflow_on_above / .proxy_buflen_rxflow_off_below policy streamtype options
and manage the rx flow control for the onward ss wsi according to how the dsh for the
remote client is doing.

client_buflen_rxflow_... are there but not wired up.
2021-02-02 09:11:29 +00:00
Andy Green
9f1bd0a5c8 lws-dsh: fix alignment and boost size add per kind totaling 2021-02-02 08:53:44 +00:00
Andy Green
611e6477fd h2: post: handle lws_h2_bind_for_post_before_action error 2021-02-01 19:12:54 +00:00
Andy Green
d73c4baab2 options: fixes
sai: add default-noudp and windows plats for noserver
2021-02-01 15:19:38 +00:00
Andy Green
6f6147d7a5 ss: state filter: timeout could be followed by connect 2021-02-01 11:49:56 +00:00