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

571 commits

Author SHA1 Message Date
Andy Green
0111d95d6b cmake: unbreak LWS_WITH_SYS_STATE disabled build 2021-09-27 06:37:25 +01:00
Andy Green
bd8f32d1f4 libevent: use event_enable_debug_mode 2021-09-17 04:21:16 +01:00
oaleshina
c6cd4150c1 h2: ping pong: separate payloads 2021-09-13 17:31:02 +01:00
Andy Green
c52f909961 warn: avoid one toolchain false positive 2021-09-09 17:03:40 +01:00
xionghui
ff0e9db12f http server: allow serving files with special unicode path 2021-09-09 17:02:56 +01:00
Andy Green
b0cdc05b6b h1: remove lwsl_wsi_err 2021-08-28 07:38:27 +01:00
Andy Green
a85b70bfe6 http: hdr: sync lws_hdr_total_length with lws_hdr_copy 2021-08-27 05:51:12 +01:00
Andy Green
40db9f9f19 server: http-proxy: fix POST 2021-08-14 05:01:20 +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
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
Yucong Sun
1f99c206ab h2: server: file serving chunk restricted to max frame size from SETTINGS 2021-07-20 10:31:07 +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
Andy Green
ad3901d0fe raw-proxy: fix role bind flag 2021-07-07 08:46:14 +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
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
2f9ed48d93 coverity: report problem in hpack_dynamic_size() to parent 2021-06-06 11:47:09 +01:00
Andrey Grafin
62af701cc8 netlink: fix UB on RTM_NEWADDR/RTM_DELADDR
this patch makes ubsan (-fsanitize-undefined-trap-on-error) happy.

let's look at the following scenario:
1. netlink sends RTM_NEWADDR/RTM_DELADDR message
2. rops_handle_POLLIN_netlink() handles message attributes as RTA_*
3. rops_handle_POLLIN_netlink() finds RTA_PRIORITY attribute and
handles it as u32 value, but it's IFA_CACHEINFO attribute in reality
and payload holds another type
4. ubsan throws SIGTRAP

so, don't handle RTM_NEWADDR/RTM_DELADDR attributes as RTA_*
2021-05-27 17:13:17 +01:00
Andy Green
b156268521 sse: server: handle close found as HUP 2021-05-23 17:17:33 +01:00
Andy Green
edcf346f9f h2: migration: migrate for_ss
The attribute indicating that a wsi belongs to an SS object also must be
migrated when we split out the original transaction wsi into a new nwsi, if we're
not going to lose track of its affiliation.

Likewise if the affiliated SS object points to the original wsi, we have to
migrate his pointer when we migrate the wsi.

Taking care of this book-keeping is necessary to get correct behaviours at
close-time.
2021-05-20 14:07:01 +01:00
Andy Green
9cd1f4d78b listen: ip bind: force ipv4 if given ipv4 numeric iface 2021-05-20 14:06:39 +01:00
Yury Is
f1ff43ddea netlink: fix RTM_NEWLINK handling
https://github.com/warmcat/libwebsockets/issues/2287
2021-04-29 12:29:35 +01:00
Marco Gratzke
61a94f5f83 spa: parser should tolerate additional headers 2021-04-27 11:56:40 +01:00
Andy Green
b746a2c75a netlink: make failure to bind nonfatal 2021-04-20 16:05:46 +01:00
Chunho Lee
8c26063828 mqtt: log correct subscribe packet id 2021-04-15 17:33:50 +01:00
Per Bothner
018d443863 http: mimetypes: add mjs as builtin 2021-04-12 06:36:24 +01:00
Andy Green
24abd699f6 http: parser: straighten out %00 legality
https://github.com/warmcat/libwebsockets/issues/2262

This adds a README explaining what can be expected if your URLs contain
%00, and adds a safe helper for urlargs-by-name that is length-based.

Contains fix for extra NUL on some headers

https://github.com/warmcat/libwebsockets/issues/2267
2021-04-10 09:21:33 +01:00
Andy Green
354b29c747 http: redirect: dont try from h2 at the moment
h1->h1, h1->h2 are OK, but h2->anything needs more work.
Just fail it early at the moment.
2021-04-10 09:20:33 +01:00
Andy Green
b28b03eee1 smp: hold pt lock for lws_client_reset removing fds
https://github.com/warmcat/libwebsockets/issues/2268
2021-04-10 06:14:12 +01:00
Mykola Stryebkov
3c334d4906 windows: pipe role does not use file handle any more 2021-04-05 10:55:04 +01:00
Andy Green
7d8f742594 smp: more lock assertions 2021-04-05 10:55:04 +01:00
Andy Green
51490ae6e6 Fault injection
add lws_xos: xoshiro256 PRNG
2021-04-05 10:55:04 +01:00
Andy Green
7451702722 tls-sessions: serialization 2021-04-04 05:45:53 +01:00
Andy Green
e2f42387b7 route: assert if route table becomes full 2021-04-02 16:50:49 +01:00
Gary Christiansen
12f20503b4 mqtt: Fixes setting the length of the last will message
It was previously using the length of the topic for the message. It
would break if the topic and message were not the same length.
2021-04-02 16:44:35 +01:00
Chunho Lee
25ae9facc9 mqtt: topic validation for different mqtt servers
AWS IoT enforces limits topic level and length. If 'aws_iot' is set
on the policy, the topic limits will be enforced for AWS IoT.
2021-03-30 07:38:37 +01:00
Sakthi Kannan
f3531ef673 mqtt: wildcard topic and topic to 256 chars
Adding supports to MQTT wildcard support, topic to 256 chars,
incorrect topic validation.
2021-03-30 07:38:37 +01:00
Pavel Otchertsov
f84b90ba03 use gmtime_r instead of gmtime if possible
Also check tm result is not NULL before using it.
2021-03-25 10:08:40 +00:00
Pavel Otchertsov
932527a3e7 access-log: use localtime_r instead of localtime if possible
Also replace the WIN32 check to global LWS_HAVE_LOCALTIME_R in logs.c
2021-03-25 09:12:11 +00:00
Andy Green
ffb49e2612 http: post: defer body pending end until no more buffered out 2021-03-25 08:40:52 +00:00
Andy Green
f576f317aa ws: wsi unusability only applies when no pending
We basically hear about HUP out-of-band with respect to
pending rx... now we mark the wsi as "unusable" once we
see the HUP - the connection has ended.

This means we have to differentiate between the wsi
being unusable for new things now, like replying, and
what it has already sent still being servicible and
pending.
2021-03-25 08:40:52 +00:00
Andy Green
50e1f1ed13 h2: dont try to get ahead of POST if its a cgi mount or proxied 2021-03-25 08:40:52 +00:00
Andy Green
b5bc6028e6 http_proxy: report failed http code
Improve how we report what happened with http_proxy... if
we can't recognize the response as http/1.0 or http/1.1
do a CCE with "http_proxy fail", or if we did get valid h1
response but no 200 response code, do a CCE with
"http_proxy -> xxx" where xxx is the decimal representation
of the response code, eg, "http_proxy -> 407"
2021-03-25 08:40:52 +00:00
Andy Green
fb9abfdf0e ws: accept newer IANA close codes
Close codes 1012 - 1014 are not defined in RFC6455 but were defined later
in https://www.iana.org/assignments/websocket/websocket.xml#close-code-number

Accept these guys that are a bit late to the party, and 1015 as well.
2021-03-25 08:40:52 +00:00
Andy Green
06509e287d lws_conmon: connection monitoring and stats generation
This provides a build option LWS_WITH_CONMON that lets user code recover
detailed connection stats on client connections with the LCCSCF_CONMON
flag.

In addition to latencies for dns, socket connection, tls and first protocol
response where possible, it also provides the user code an unfiltered list
of DNS responses that the client received, and the peer it actually
succeded to connect to.
2021-03-17 07:31:49 +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
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
Andy Green
ede7f8b0f3 ss: support huge urls 2021-03-05 14:13:26 +00:00
Andy Green
9af105ebf8 sai: xenial 2021-02-28 19:05:25 +00:00