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

4250 commits

Author SHA1 Message Date
Andy Green
1000a52df3 logs: prioritize WITH_NO_LOGS even in release
Really not having any logs makes it difficult to know what is really
happening, but if that's you're thing this will align debug and release
modes to just have ERR and USER if you give WITH_NO_LOGS
2021-03-15 12:56:15 +00:00
Andy Green
ad5047a687 sspc: make sure we cancel any retry 2021-03-14 19:50:08 +00:00
Andy Green
3ca8625129 adopt: rejection should not loop with listen adoption 2021-03-14 15:05:19 +00:00
Andy Green
baccd5b238 ss: make sure pointer to failed ss creation is wiped out 2021-03-14 15:05:19 +00:00
Andy Green
f35a3b8969 ssproxy: break immediately after determining we will not allow the stream 2021-03-14 15:05:19 +00:00
Andy Green
4df5e015ed ssproxy: deal with lack of policy when replying with stream denied 2021-03-14 15:05:19 +00:00
Andy Green
546c151555 ss: add set_metadata that takes a heap copy and make ss-h1 use it
Until now we set metadata value pointers into the onward wsi ah data
area... that's OK until we get a situation the wsi has gone away before we
have a chance to deliver the metadata over the proxy link.

Add a variant lws_ss_alloc_set_metadata() that allocates space on the heap
and takes a copy of the input metadata.  Change ss-h1 to alloc copies of
its metadata so we no longer race the wsi ah lifetime.
2021-03-14 15:05:18 +00:00
Andy Green
4804624905 ss: force check all set_metadata returns
lws_ss_set_metadata can fail... eg, due to transient OOM situation... if it does,
caller must take appropriate action like disconnect and retry.

So mark the api as requiring the result checking, and make sure all the
examples do it.
2021-03-14 08:58:26 +00:00
Andreas Weigel
12d535f839 x509: support DER recovery 2021-03-13 08:06:17 +00:00
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
b6aa4c2d5d solaris: pthread is not a ptr 2021-03-08 20:44:10 +00:00
Andy Green
c00ece34a1 solaris: openssl: defeat openssl deprecation of md5 2021-03-08 20:43:58 +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
Andy Green
b2a2e0871c sai: reduce make concurrency to avoid OOMs in VM 2021-03-05 13:13:48 +00:00
Andy Green
f22f7d91a2 minimal-ws-raw-proxy 2021-03-04 21:26:03 +00:00
Andy Green
fecf496ef9 docs: more details on ctest buddies 2021-03-02 07:45:14 +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
671ffe7063 plugins: ssh: xenial warning fixes 2021-02-28 17:07:51 +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
8d6f59d74f minimal-ss-client-tx: add -c flag for count of rx to get 2021-02-26 08:23:12 +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
ddf24783b3 minimal ss proxy: use updated policy 2021-02-25 21:57:52 +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
d92a099374 ss: client-tx example: modernize and add to CI 2021-02-20 13:54:35 +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