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

4225 commits

Author SHA1 Message Date
Andy Green
a85b70bfe6 http: hdr: sync lws_hdr_total_length with lws_hdr_copy 2021-08-27 05:51:12 +01:00
Andy Green
15a078c2cc windows: plat: only build client ctx init if WITH_TLS
https://github.com/warmcat/libwebsockets/issues/2385
2021-08-17 06:45:14 +01:00
Andy Green
40db9f9f19 server: http-proxy: fix POST 2021-08-14 05:01:20 +01:00
Andy Green
a938f943fc lws_struct: add CHILD_PTR setting 2021-08-13 05:52:16 +01:00
Yichen Gu
d90cd7be6d conmon: pass userobj to ss rx not handle 2021-08-13 05:51:37 +01:00
Andy Green
750f0a60e6 smd: avoid recursive lock when unregistering during delivery 2021-08-13 05:51:17 +01:00
Jed Lu
82e2e6cb7f ss: unpick failed create using destroy
The late_bail discrete unpick flow is missing some pieces compared
to lws_ss_destroy.  Unify the creation fail flow to also use
lws_ss_destroy so everything in one place.

Make lws_ss_destroy() not issue any states if the creation flow
didn't get as far as issuing CREATING.
2021-08-13 05:49:53 +01:00
Andy Green
21697b3210 ss: handle DESTROY_ME from inside ss creation
Normally when doing a Client Connection Error handling,
we can action any ss relationship straight away since
we are in a wsi callback without any ss-aware parents
in the call stack.

But in the specific case we're doing the initial onward
wsi connection part on behalf of a ss, in fact the call
stack does have earlier  parents holding references on
the related ss.

For example

  secstream_h1 (ss-h1.c:470)                          CCE
  lws_inform_client_conn_fail (close.c:319)           fails early
  lws_client_connect_2_dnsreq (connect2.c:349)
  lws_http_client_connect_via_info2 (connect.c:71)
  lws_header_table_attach (parsers.c:291)
  rops_client_bind_h1 (ops-h1.c:1001)
  lws_client_connect_via_info (connect.c:429)         start onward connect
  _lws_ss_client_connect (secure-streams.c:859)
  _lws_ss_request_tx (secure-streams.c:1577)
  lws_ss_request_tx (secure-streams.c:1515)           request tx
  ss_cpd_state (captive-portal-detect.c:50)
  lws_ss_event_helper (secure-streams.c:408)
  lws_ss_create (secure-streams.c:1256)                SS Create

Under these conditions, we can't action the DESTROY_ME that
is coming when the CCE exhausts the retries.

This patch adds a flag that is set during the SS's onward wsi
connection attempt and causes it to stash rather than action
the result code.

The result code is brought out from the stash when we return to
_lws_ss_client_connect level, and passed up in the SS flow until
it is actioned, cleanly aborting the ss create.
2021-08-13 05:47:00 +01:00
Andy Green
afce869758 http: date: use timegm 2021-08-13 05:46:05 +01:00
Andy Green
2ea2c37f9d h2: data: frame header already parsed out 2021-08-13 05:45:51 +01:00
Andy Green
e35029a749 types: handle ssize_t is int 2021-08-13 05:45:12 +01:00
Yichen Gu
5624659d37 conmon: only build if WITH_CONMON 2021-08-13 05:44:59 +01:00
Andy Green
03482d4c01 seq: fix 2021-08-13 05:42:10 +01:00
Andy Green
1de1aafca5 h2-fix-fileserving-2 2021-07-23 04:24:31 +01:00
Yucong Sun
a82219b0fc h2: server: fix file serving chunk restricted to max frame size from SETTINGS
previous fix was buggy and result in sending incomplete files.
2021-07-22 08:25:37 +01:00
Hassan Sahibzada
d2b87efb0a b64: add downcasts for gcc 4.4
gcc 4.4 complains with the following:
warning: conversion to 'char' from 'int' may alter its value

After the explicit cast the warning is gone.
2021-07-22 05:01:52 +01:00
Yucong Sun
1f99c206ab h2: server: file serving chunk restricted to max frame size from SETTINGS 2021-07-20 10:31:07 +01:00
Yucong Sun
d1db1d7b3f windows: tls: make sure we are telling correct errno 2021-07-20 10:30:59 +01:00
Yucong Sun
30e97fc08f cmake: tls: check correct api for availability 2021-07-20 10:30:59 +01:00
Andy Green
6435bfe309 iface: score binds 2021-07-20 10:30:58 +01:00
Andy Green
8a580b59b2 v4.2.1 2021-07-13 07:22:16 +01:00
Andy Green
e90f005a10 vhost: listen: protect listen port transfer between
...vhosts from vh destroy on zero refcount

https://github.com/warmcat/libwebsockets/issues/2343
2021-07-12 09:29:23 +01:00
Andy Green
041baf93cf mbedtls: sessions: clean session on bail path 2021-07-10 08:28:30 +01:00
Andy Green
4038a7d4b3 windows: align plat insert socket POLLIN handling to linux
This is needed for, eg, libuv
2021-07-10 08:28:21 +01:00
Andy Green
a310e16f8f socks5: cast for mingw3 nonposix recv args 2021-07-10 08:28:06 +01:00
calvin2021y
439651fa7e openssl: manage _GNU_SOURCE better 2021-07-10 08:27:33 +01:00
Andy Green
c042ba8c65 mqtt: handle NULL mqtt publish metadata 2021-07-08 10:18:20 +01:00
marcelo-gonzalez
04761c4b7c event libs: glib: use glib.h specifically
https://github.com/warmcat/libwebsockets/issues/2338
2021-07-08 06:24:52 +01:00
Andy Green
599d318ab8 mqtt: coverity: help coverity see we wont have an mqtt role wsi without mqtt member allocated 2021-07-07 10:34:07 +01:00
Bing Zhao
bae99f63a3 tls: add option to serialize ssl handshake
This is useful for memory constrained systems such as esp32
to improve heap usage minfree/watermark.

On esp32 with simultaneous_ssl_restriction = 2 (MQTT+H1),
Without this change, sys heap minfree ranges from 59k to 71k
  in 100 iterations, average 66.5k.
With this change, sys heap minfree ranges from 64k to 71k
  in 100 interations, average 68.7k
2021-07-07 08:49:36 +01:00
Bing Zhao
ff1b8ed0c9 tls: fix inbalanced tls restrict borrow/return calls
lws_tls_restrict_borrow() returns error when tls restriction limit is
reached. However lws_ssl_close() still calls lws_tls_restrict_return()
to decrease simultaneous_ssl. Thus LWS accepts more than allowed ssl
links, making simultaneous_ssl_restriction useless.

Fix it by tracking lws_tls_restrict_borrow() return value and only
calling lws_tls_restrict_return() if lws_tls_restrict_borrow() is
successful.
2021-07-07 08:47:37 +01:00
Andy Green
ad3901d0fe raw-proxy: fix role bind flag 2021-07-07 08:46:14 +01:00
Andy Green
4bc8b1a4b9 extpoll: clean up test server for Wconversion in extpoll parts
https://github.com/warmcat/libwebsockets/issues/2332
2021-07-07 08:45:43 +01:00
Andy Green
eeea000ced dns: handle EAI_NONAME as fatal
This causes the blocking dns lookup to treat EAI_NONAME as immediately
fatal, this is usually caused by an assertive NXDOMAIN from the DNS server
or similar.

Not being able to reach the server should continue to retry.

In order to make the problem visible, it reports the situation using
CLIENT_CONNECTION_ERROR, even though it is still inside the outer client
creation call.
2021-07-07 08:43:56 +01:00
Andy Green
9e5acc05e4 minimal: hcmulti: modernize startup to use OPERATIONAL 2021-06-27 09:07:51 +01:00
Andy Green
55533f96b9 netlink: hold in COLDPLUG until we actually have some routing table contents 2021-06-27 09:06:39 +01:00
Andy Green
fa1a704046 sspc: close: differentiate between ss and sspc at final wsi close
A second chunk of ss / sspc handling did not get cleaned up
along with the other patch from a few weeks ago, it wrongly
treats sspc the same as ss.  This can cause the wrong thing
to be zeroed down, 64-bit and 32-bit builds end up with
different victims.

This patch makes it understand the difference and treat them
accordingly, same as the main for_ss handling.
2021-06-27 09:05:45 +01:00
David Jeffers
3f0fef17aa gcc: gcc8 only recognizes fallthu
Later gcc is more accepting, but there's at least one gcc8 toolchain that only likes
to hear "fallthru", or it will flag it
2021-06-27 09:04:16 +01:00
Andy Green
e319b15b96 minimal: ws client spam: modernize with pvo and cancel service after interrupted 2021-06-27 09:04:04 +01:00
Andy Green
ea4d800809 service: fix casts for EXTERNAL_POLL 2021-06-24 16:21:56 +01:00
Andy Green
aea9d0cead tls-sessions: remove no stash warning
If there's no stash, we didn't get as far as having a session, so just fail
quietly
2021-06-24 06:37:25 +01:00
Andy Green
10c1b882c6 ss: check destroy null policy 2021-06-24 06:36:10 +01:00
Andy Green
e4aa3ece17 ss: check serialize null policy 2021-06-24 06:35:57 +01:00
Andy Green
4141a68f23 ss: avoid null ss policy on req tx len 2021-06-24 06:35:46 +01:00
Andy Green
de8185db9f ss: avoid null ss policy on req tx 2021-06-24 06:35:33 +01:00
Haopeng Li
526310dfea ss: h1: log dereferences NULL 2021-06-24 06:34:04 +01:00
Andy Green
7a283eba05 minimal: htt-client: send user agent and accept
Some servers will 4xx us if they don't see these headers
2021-06-24 06:33:37 +01:00
Andy Green
3d13468e9d ctest: do not reuse ctest-ssp path 2021-06-24 06:32:58 +01:00
Andy Green
e3da2a3b3b android: getnameinfo uses nonstandard size_t 2021-06-20 13:41:53 +01:00
Andy Green
8398ef794b getifaddrs: casts for android 2021-06-20 08:43:22 +01:00