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

651 commits

Author SHA1 Message Date
Andy Green
19d59f9977 listen: ip bind: force ipv4 if given ipv4 numeric iface 2021-05-06 20:51:43 +01:00
Yury Is
7247205e40 netlink: fix RTM_NEWLINK handling
https://github.com/warmcat/libwebsockets/issues/2287
2021-04-29 12:28:39 +01:00
Marco Gratzke
32c4d2cb29 spa: parser should tolerate additional headers 2021-04-27 11:54:06 +01:00
Andy Green
ff8912ba96 netlink: make failure to bind nonfatal 2021-04-20 16:05:01 +01:00
Andy Green
68d9f3a7f2 ss: wire up EVENT_WAIT_CANCELLED
Currently the lws_cancel_service() api only manifests itself at lws level.
This adds a state LWSSSCS_EVENT_WAIT_CANCELLED that is broadcast to all
SS in the event loop getting the cancel service api call, and allows
SS-level user code to pick up handling events from other threads.

There's a new example minimal-secure-streams-threads which shows the
pattern for other threads to communicate with and trigger the event in the
lws service thread.
2021-04-15 19:10:54 +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
Andy Green
09b9ac6e33 minimal-http-client: set option to fix broken server window update 2021-02-28 12:10:26 +00:00
Andy Green
fc5302589c HUP: mark socket unusable 2021-02-20 13:54:34 +00:00
Gang Chen
54110778ab http: x-amn-dss-signature header 2021-02-17 11:39:15 +00:00
Andy Green
f42c97baa9 route: on change also check source address still extant 2021-02-17 11:39:12 +00:00
Andy Green
00b9ef09c0 netlink: back out lifecycle tag on netlink fail 2021-02-03 08:49:59 +00:00
Andy Green
611e6477fd h2: post: handle lws_h2_bind_for_post_before_action error 2021-02-01 19:12:54 +00:00
Andy Green
d73c4baab2 options: fixes
sai: add default-noudp and windows plats for noserver
2021-02-01 15:19:38 +00:00
Yichen Gu
403a6591e1 h2: client: handle END_STREAM and END_HEADERS togther on all paths 2021-01-29 21:22:35 +00:00
Andy Green
cfe4fa1551 http: proxy: fix uri relisting 2021-01-29 21:22:31 +00:00
terry.lu
3bf3b540ad windows: pipe: avoid busy loop in windows pipe event 2021-01-29 15:53:49 +00:00
Andy Green
2fea1e49bd bsd: POLLHUP always bound to POLLIN
On OSX, POLLHUP is always |POLLIN, even if you did not wait
on POLLIN.  This causes a loop because we don't want to
ack the POLLHUP until we cleared any pollin (but there is
no pending POLLIN...)
2021-01-29 15:53:37 +00:00
Andy Green
3eeda84a8d http: client: defer HUP if pending buflist 2021-01-28 05:52:44 +00:00
Andy Green
33f3709426 h2: make headers in h2 even in wsi not in h2 role yet 2021-01-26 07:47:42 +00:00
Andy Green
1d0d05ea1b dbus: also add wsi tags
Add wsi tags for dbus role, also dbus may add a watcher in a disabled
state, don't action it if so on the lws event loop.  It'll re-add
if it wants it, confusingly.
2021-01-25 06:26:17 +00:00
Andy Green
1236114303 h2: client: action END_STREAM and END_HEADERS immediately 2021-01-23 20:58:39 +00:00
Sakthi Kannan
f17bb1aa29 mqtt: destroy PUBLISH pointers each time 2021-01-22 18:56:36 +00:00
Andy Green
beacabbdb1 vhost_destroy: refactor 2021-01-22 12:31:15 +00:00
Andy Green
d5618f6059 Wconversion: workarounds for CentOS7 2021-01-22 12:25:03 +00:00
Andy Green
bf9c517b39 set-cookie: force semicolon for concatenation 2021-01-22 12:25:03 +00:00
Andy Green
95a545b741 evlib: count extant evlib handles instead of wsi 2021-01-19 17:07:33 +00:00