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

3119 commits

Author SHA1 Message Date
Andy Green
0516966d7d http_proxy: fixes 2019-11-15 08:44:22 +00:00
Andy Green
1bd08c3941 test-client: crl: declare vars before code
Some toolchains blow chunks otherwise

https://github.com/warmcat/libwebsockets/issues/1451
2019-11-06 09:11:04 +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
Fabrice Fontaine
3817780ea7 CMakeLists.txt: fix build with libev and without testapps
Move libev workaround outside the
if ((LWS_ROLE_H1 OR LWS_ROLE_H2) AND NOT LWS_WITHOUT_TESTAPPS) block
otherwise build fails on:

/home/naourr/work/instance-1/output-1/build/libwebsockets-3.2.0/lib/event-libs/libev/libev.c: In function 'lws_ev_hrtimer_cb':
/home/naourr/work/instance-1/output-1/build/libwebsockets-3.2.0/lib/event-libs/libev/libev.c:34:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
   ev_timer_set(&pt->ev.hrtimer, ((float)us) / 1000000.0, 0);
   ^~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/b5a2188dce90f3ca9bf0cc7a043c1a946b8e288f

AG: this doesn't really fix anything... the spew is intentionally part of libev.
    It just hides the spew... since the maintainer won't fix it
    this is the only way AFAIK.  Other than don't use libev.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-10-06 15:26:00 +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
b2de3c98cc doxygen: cleanup and add recent includes 2019-09-17 09:25:45 +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
3aab3d8401 server-status: still produce valid json if files cant be opened
Kernel update changed the /sys path for temp monitoring... the status had
already emitted a , in the json committing it to make a new entry, but the
code skips making it if the file can't be opened.

Change it to produce "(unknown)" in that case.
2019-09-13 05:50:08 +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
0f983d0aca lws_sul: make it clear NULL no longer valid in lws_service_fd 2019-09-12 11:14:14 +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
94931cad00 v3.2.0 2019-08-14 09:22:50 +01:00
Andy Green
b606c883f3 lws_system 2019-08-14 08:59:12 +01:00
Andy Green
f00194c321 lws_dsh 2019-08-12 12:45:31 +01:00
Mike Owens
22ece2c0e4 Subject: Build on SmartOS 2019-08-12 12:45:31 +01:00
Andy Green
69447d0445 logs: just use a single char for most loglevels 2019-08-12 12:44:36 +01:00
Andy Green
d302198019 external poll: add default-off cmake option
External poll support generates a lot of messages on a busy system
for no value unless you're one of the few people using it.  It's
not recommended for new users and is there for backwards compatibility.

Make it not built by default and selectable by cmake option.
2019-08-12 12:44:36 +01:00
Andy Green
7b517eac87 lws_inform_client_conn_fail
There are many places where we have the same code to inform about client
connection failure... consolidate it
2019-08-12 12:44:36 +01:00
Andy Green
2fc35ef6bd stats: move to pt and improve presentation 2019-08-12 06:18:04 +01:00
Andy Green
498a4e2bd7 sul: all timed objects use a single pt sul list
wsi timeout, wsi hrtimer, sequencer timeout and vh-protocol timer
all now participate on a single sorted us list.

The whole idea of polling wakes is thrown out, poll waits ignore the
timeout field and always use infinite timeouts.

Introduce a public api that can schedule its own callback from the event
loop with us resolution (usually ms is all the platform can do).

Upgrade timeouts and sequencer timeouts to also be able to use us resolution.

Introduce a prepared fakewsi in the pt, so we don't have to allocate
one on the heap when we need it.

Directly handle vh-protocol timer if LWS_MAX_SMP == 1
2019-08-09 10:12:09 +01:00
Andy Green
5bbe26474a seq: LWS_WITH_SEQUENCER default-on
force off if NO_NETWORK (which is tested in travis)
2019-08-09 09:14:48 +01:00
Andy Green
3c12fd72e8 unify us sorted waits
There are quite a few linked-lists of things that want events after
some period.  This introduces a type binding an lws_dll2 for the
list and a lws_usec_t for the duration.

The wsi timeouts, the hrtimer and the sequencer timeouts are converted
to use these, also in the common event wait calculation.
2019-08-08 22:39:47 +01:00
Andy Green
6de416d811 h2 client: dont leak original user_space for network wsi
When creating the stream from the nwsi, the stream was created with
its own user_space that gets overwritten with the nwsi one as it is
demoted to be the stream.

Stop that leaking.
2019-08-08 22:39:44 +01:00
Andy Green
45ec3ce369 lws_dll: upgrade all instances to lws_dll2
lws_dll2 removes the downsides of lws_dll and adds new features like a
running member count and explicit owner type... it's cleaner and more
robust (eg, nodes know their owner, so they can casually switch between
list owners and remove themselves without the code knowing the owner).

This deprecates lws_dll, but since it's public it allows it to continue
to be built for 4.0 release if you give cmake LWS_WITH_DEPRECATED_LWS_DLL.

All remaining internal users of lws_dll are migrated to lws_dll2.
2019-08-08 16:58:55 +01:00
Andy Green
fed78bef42 sequencer: upgrade timeout to use us
Adapt service loops and event libs to use microsecond waits
internally, for hrtimer and sequencer.  Reduce granularity
according to platform / event lib wait.

Add a helper so there's a single place to extend it.
2019-08-08 09:45:09 +01:00
Andy Green
c27c38ffbc rtos: use mbedtls random api 2019-08-08 09:45:09 +01:00
Andy Green
1d954d52a3 sequencer: add second aux message arg
Since the messages are queued and then read in order from the event loop
thread, it's not generally safe to pass pointers to argument structs,
since there's no guarantee the lifetime of the thing sending the message
lasted until the sequencer read the message.

This puts pressure on the single void * argument-passed-as-value... this patch
adds a second void * argument-passed-as-value so it's more possible to put
what's needed directly in the argument.

It's also possible to alloc the argument on the heap and have the sequencer
callback free it after it has read it.
2019-08-08 09:45:09 +01:00