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

2414 commits

Author SHA1 Message Date
Chunho Lee
05a1f9ef37 coverity: check timer opaque before dereferencing
Actually we always set this correctly using the uv_timer_start() wrapper,
so this is a false positive.  But satisfy Coverity nonetheless.
2021-06-30 06:52:57 +01:00
Andy Green
d3f6f08f2c h1: handle LRS_FLUSHING_BEFORE_CLOSE at ops read
read has a tight leash on the states it's happy to turn up there,
it's good to be like that but it turns out LRS_FLUSHING_BEFORE_CLOSE
should be whitelisted since it can happen under some transient
conditions and is valid.

https://github.com/warmcat/libwebsockets/issues/1872
2020-03-26 18:10:18 +00:00
Akira Tsukamoto
9a5861cf76 jws: lws_gencrypto_jws_alg_to_definition needs sentinel
Otherwise segfault when end of array reached.
2020-03-21 07:02:27 +00:00
Andy Green
9cac58a4c2 lws_spa: avoid reading past table
Didn't check the lenghts of the NUL-terminated header
table properly.

https://github.com/warmcat/libwebsockets/issues/1859
2020-03-14 07:50:05 +00:00
TerryZhang
5eaab80708 ws: make sure we understand frame finished when buflist_out flushed
When lws_write as many bytes as user can until function returns not all sent,
the next user`s lws_write call will write wrong frame to the other end. This
will cause connection be close by the other side.
2020-03-04 12:51:47 +00:00
Andy Green
3a4698e63a malloc_trim: move out of unix plat and into lwsws
https://github.com/warmcat/libwebsockets/issues/1849
2020-02-24 10:32:59 +00:00
Oliver Langlois
17357ddd5a unix plat: use eventfd in place of pipe where possible
From eventfd man page:
Applications can use an eventfd file descriptor instead of a pipe (see
pipe(2)) in all cases where a pipe is used simply to signal events.
The kernel overhead of an eventfd file descriptor is much lower than
that of a pipe, and only one file descriptor is required
(versus the two required for a pipe).
2020-02-09 05:48:16 +00:00
Oliver Langlois
8c690f1ed9 ev: log aio backend 2020-02-09 05:48:10 +00:00
Andy Green
de978800f0 openssl: disallow client connections if X509_VERIFY_PARAM_set1_host absent from tls lib
https://github.com/warmcat/libwebsockets/issues/1827
2020-01-16 19:51:44 +00:00
Christian Thießen
3179323afa http client: Fix overwite of addrlen for connect if binding to iface
The addrlen argument to connect() was overwritten by the
lws_socket_bind() result, which is a port number.
Fixes https://github.com/warmcat/libwebsockets/issues/1817
2020-01-10 06:00:14 +00:00
Jaco Kroon
0cf41c06ac build options: fix SOCKS5 and WITHOUT_CLIENT
If LWS is build with SOCKS5 support, but WITHOUT_CLIENT then a compile
failure occurs which this fixes.

Signed-off-by: Jaco Kroon <jaco@iewc.co.za>
2020-01-06 19:56:20 +00:00
Andy Green
bb244c0b2b lextable: fix x-forwarded-for
https://github.com/warmcat/libwebsockets/issues/1801
2019-12-20 18:45:04 +00:00
Wojtek Kaniewski
fd70c1ac81 openssl: handle negotiation errors handling in client
If a client connects to a SSL server and the server sends handshake
alert (e.g. no matching ciphers) SSL_connect() fails, but because
SSL_ERROR_SSL return value is not handled, it's not considered a
failure. SSL_want_read() will return 1 and the client will happily wait
for more data from the server. Now if the server closes connection after
sending handshake alert, POLLIN event will be triggered,
lws_tls_client_connect() called again, but SSL_connect() will fail
without calling read(), so the client will end up consuming 100% CPU
because POLLIN will be triggered repeatedly.

Similar error handling is used in lws_tls_server_accept() and the
condition checks for SSL_ERROR_SSL. Using the same condition in
lws_tls_client_connect() fixes the problem.

Tested with OpenSSL 1.0.2k.
2019-12-19 21:32:31 +00:00
Jerry Jacobs
9f9dba9f20 close.c: close reason length wrong
The string length is actually 25... solve it by measuring the same
string.
2019-12-18 14:45:31 +00:00
Andy Green
f4f4d25faa mbedtls: cast ecdh enum type for some toolchains 2019-11-27 07:43:55 +00:00
Andy Green
3de710e223 lws_context_create: clean up cancel pipes on fail
https://github.com/warmcat/libwebsockets/issues/1765
2019-11-16 16:55:09 +00:00
Andy Green
f04d18b5da server vfs: close: cleanup also at just_kill_connection
... and at transaction completion
2019-11-16 08:20:48 +00:00
Andy Green
25a2ce56e2 connect: make sure SOCK_STREAM set either way 2019-11-15 20:22:29 +00:00
Andy Green
c450d06413 server: vfs: make sure handle freed if problems while setting up file transfer
https://github.com/warmcat/libwebsockets/issues/1765
2019-11-15 20:14:32 +00:00
Andy Green
d8fa971b8a http_proxy: fix for mbedtls 2019-11-15 09:15:37 +00:00
Andy Green
0516966d7d http_proxy: fixes 2019-11-15 08:44:22 +00:00
Andy Green
0019b67f8b ws-over-h2: wrong sid on rst_stream
rst_stream is almost always called from the h2 parser... in the case
a ws-over-h2 is closing though, it can't reference the h2n parser sid
context to get the sid to send... it's unrelated at that time.

https://bugzilla.mozilla.org/show_bug.cgi?id=1590299
https://github.com/warmcat/libwebsockets/issues/1752
2019-11-04 21:24:55 +00:00
Andy Green
7fad06e9e0 unix: sul schedule rename internal api and call regardless of existing timeout
Pre-sul, checking for interval to next pending scheduled event was expensive and
iterative, so the service avoided it if the wait was already 0.

With sul though, the internal "check" function also services ripe events and
removes them, and finding the interval to the next one is really cheap.

Rename the "check" function to __lws_sul_service_ripe() to make it clear it's
not just about returning the interval to the next pending one.  And call it
regardless of if we already decided we are not going to wait in the poll.

After https://github.com/warmcat/libwebsockets/pull/1745
2019-11-01 12:35:31 +00:00
Kristján Valur Jónsson
e949b20c00 windows: service: do sul check and service regardless of service timeout 2019-11-01 06:46:25 +00:00
Kristján Valur Jónsson
16e31d4fd6 windows: Fix ioctl result check polarity 2019-10-28 13:24:21 +00:00
Kristján Valur Jónsson
1485db1805 Use IPPROTO_TCP if getprotobyname("tcp") fails. 2019-10-27 16:39:19 +00:00
Kristján Valur Jónsson
9dd8d03387 Improve logging when setting sock opts on windows 2019-10-27 16:39:07 +00:00
Kristján Valur Jónsson
f958c0f03e fix integer conversions from 64 bit 2019-10-27 16:38:54 +00:00
Andy Green
5bd1bed6e9 sul: more paranoid casting vs libc header types 2019-10-27 15:46:58 +00:00
Andy Green
4d23fb1389 ws: handle no ws object at sul_ping callback 2019-10-23 12:04:32 +01:00
Andy Green
841a762992 wsproxy: clear down proxy struct at alloc 2019-10-07 16:09:24 +01:00
Zhiwen Zheng
6b0e2e7cfa cgi: fix passing cgi envs using setenv() 2019-10-07 10:14:06 +01:00
Zhiwen Zheng
de6a8e8194 illumos: fix build errors and warnings for v3.2-stable on illumos 2019-10-07 10:14:02 +01:00
Andy Green
3e013bf352 cgi: check for stdout failed or gone away 2019-10-05 11:15:14 +01:00
Jakob Szumacher
d949b5529a client: LCCSCF_ALLOW_INSECURE
AG add options the minimal http client related to this
2019-09-18 10:09:43 +01:00
Andy Green
bd8a751fc4 client_reset: don't reset protocol 2019-09-17 10:13:00 +01:00
Andy Green
280c94bace COV225132: check if no JOSE alg
In the cases where an alg was expected, make sure it
came.
2019-09-17 09:25:31 +01:00
Andy Green
cd207447e0 COV225133: coverity false positive 2019-09-17 09:25:18 +01:00
Andy Green
6625cc059c pem_to_der: fix binary mode length handling 2019-09-16 18:19:36 +01:00
Andy Green
55e2a3eabe libevent: fix cut and paste error 2019-09-14 06:26:34 +01:00
Andy Green
d9a675d213 sul: additional handling for event libs after resurrect changes 2019-09-13 06:54:56 +01:00
Andy Green
7c40fc9b12 vhost protocol timer: dont leak the object containing the sul
Converting the vhost-protocol timer to sul was correct, but we don't
clean up the object containing the sul after the timer fires, causing
a leak.
2019-09-13 06:50:39 +01:00
Andy Green
c398920ab4 service: resurrect timeout_ms being -1 as return immediately
There's no longer any reason to come out of sleep for periodic service
which has been eliminated by lws_sul.

With event libs, there is no opportunity to do it anyway since their
event loop is atomic and makes callbacks and sleeps until it is stopped.

But some users are relying on the old poll() service loop as
glue that's difficult to replace.  So for now help that happen by
accepting the timeout_ms of -1 as meaning sample poll and service
what's there without any wait.
2019-09-12 14:03:36 +01:00
Andy Green
a74d9f8896 tls certs: update warmcat.com and libwebsockets.org public certs
Old certs were getting near the end of their life and we switched the
server to use letsencrypt.  The root and intermediate needed for the
mbedtls case changed accordingly
2019-09-12 11:58:08 +01:00
Andy Green
0250eac9a0 sul: remove NULL service calls from all plats 2019-08-30 06:11:45 +01:00
Sviatoslav Grebenchucov
aefecce938 socks: Fix compilation error 2019-08-25 19:52:20 +01:00
Sviatoslav Grebenchucov
550023ce78 sul_compare: prevent integer overflow bug 2019-08-25 19:52:11 +01:00
Andy Green
d9dd253021 Coverity fixes 2019-08-17 08:03:47 +01:00
Andy Green
1726b96d41 c++: establish a single place for opaque forward references 2019-08-17 07:20:59 +01:00
Andy Green
b606c883f3 lws_system 2019-08-14 08:59:12 +01:00