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

228 commits

Author SHA1 Message Date
Andy Green
d568eccd4c spa: use sized local info rather than incoming
We allow a default 0 length in the incoming const info to mean a default
size (of 512).  We implement it by copying the incoming const info to a
copy in the spa that we can adapt, which is all good.

But in two cases after we dumbly use the incoming const info directly
instead of the adapted copy.

https://github.com/warmcat/libwebsockets/issues/3294
2024-12-13 09:22:26 +00:00
Andy Green
4393edf1a5 esp-idf-update 2024-11-03 07:59:12 +00:00
Orgad Shaneh
8263a6814e clean: var unused when no logs 2024-11-02 09:37:27 +00:00
Andy Green
032adce8c3 minimal: add note about binding mount 2024-10-31 15:20:11 +00:00
Dmitry Potapov
3b0eb45518 http: server: _lws_vhost_init_server_af only needed once
If we already have vh_listen_sockfd ready, call _lws_vhost_init_server_af
only once, regardless of IPv6 support.
2024-05-12 05:11:54 +01:00
Dmitry Potapov
4eab8f5a19 http: windows: adapt dup() to use windows api 2024-05-12 05:10:22 +01:00
Andy Green
837db622eb clean: avoid maybe-uninitialized
https://github.com/warmcat/libwebsockets/issues/3049
2024-01-16 07:15:30 +00:00
markmaker
43df4901ee vhost: server: Ignore a vhost port mismatch when using CONTEXT_PORT_NO_LISTEN_SERVER
https://github.com/warmcat/libwebsockets/issues/3044
2024-01-08 14:40:46 +00:00
Ogre Transporter
50ba61082d windows: clean quirks
https://github.com/warmcat/libwebsockets/issues/3039
2024-01-05 05:50:57 +00:00
Andy Green
3207da067e vhost: allow fd adoption 2024-01-04 11:35:01 +00:00
Andy Green
7efab5f905 h1: reset pipelined parsing 2023-12-27 06:34:03 +00:00
Andy Green
93ae4cb628 ipv6: avoid spinning on interface set
https://github.com/warmcat/libwebsockets/issues/3028
2023-12-14 05:58:15 +00:00
Andy Green
957503436e http: mounts: LWSMPRO_NO_MOUNT
Provide a way to apply exception mount urls that exist on top of a larger
mount, but provide an exception which enforces the url to not be serviced
by the mount code, but by whatever dynamic handler is in place.
2023-12-12 05:57:38 +00:00
tjwalton
83eeb76d66 server: Always return result of _lws_vhost_init_server_af
Fixes https://github.com/warmcat/libwebsockets/issues/2702
2023-11-23 09:45:12 +00:00
songbuhuang
2c981f7670 clean: unreachable cruft
Signed-off-by: songbuhuang <544824346@qq.com>
2022-09-18 08:17:25 +01:00
Andy Green
af64c7fc4f http proxy: fix host 2022-09-18 08:17:20 +01:00
Marco Gratzke
c28b390e77 spa: file upload fix 2022-07-04 14:23:02 +01:00
Paul Shark
8fe3950acd http: server: correct plugin name in error 2022-06-14 07:37:11 +01:00
Andy Green
2de67dd0ae file_ops: vfs: support prefix matches and use of bound ops members
VFS needs some small updates... pass in the bound fops as well as the
context fops to the member callbacks.  ZIP_FOPS only cared about doing
operations on the platform / context vfs to walk the ZIP file, but other
uses are valid where we are doing operation inside the bound VFS itself.

Also, stash a cx pointer into file ops struct for convenience.
2022-03-15 10:28:09 +00:00
Andy Green
6829dba9a1 http: server: mounts: dont assume Basic Auth if no FILE_OPS 2022-03-15 10:28:09 +00:00
Andy Green
32698a2f4b lejp-conf: provide matches for block start paths
Also valgrind shows we should zero down the lejp context to avoid problems
with the wildcard stack
2022-03-15 10:28:09 +00:00
Andy Green
8cc4c1713d http: proxy server: move C99 VLA to heap 2022-03-15 10:28:09 +00:00
Andy Green
8dc438ce2c http: access_log: fix nwsi check
h2 logging often lacked the IP as it checked the af on the sa46_peer of the
child stream when it meant to check the nwsi one.
2022-01-16 10:48:16 +00:00
Vitaliy Orazov
05997f4503 http: proxying: allow for large headers
set the buffer size (rpath) for header processing during
 proxying equal to the value in max_http_header_data
2021-12-13 19:02:56 +00:00
Joerg Wendel
fe8170dcdc http: server: added no-cache handling to mounts 2021-12-13 19:02:56 +00:00
Vitaliy Orazov
5747203406 http proxy: support PUT, PATCH and DELETE methods 2021-11-29 15:18:16 +00:00
Andy Green
81b481ef2f h2: coverity: check for OOM on dynamic table alloc
It can fail, we should check it.
2021-11-09 07:45:58 +00:00
Ron Frederick
b5b7e793d4 server: SO_REUSEPORT: enable with LWS_MAX_SMP > 1
Either explicit option selection, or multiple SMP service threads, should
enable SO_REUSEPORT

https://github.com/warmcat/libwebsockets/issues/2470
2021-10-30 06:19:37 +01:00
Orefkov Aleksander
abef9ba252 http: spa: fetch any params
Added the ability to get additional form parameters with unknown names in the form parameters parser lws_spa. The example of using the form parameters parser has been updated. Fixed bug of double freeing memory in the example.
2021-10-15 08:47:52 +01:00
Andy Green
27fac9dd86 warn: avoid one toolchain false positive 2021-09-09 15:27:41 +01:00
xionghui
365328c4d3 http server: allow serving files with special unicode path 2021-09-09 15:27:27 +01:00
Yucong Sun
e5944a7da2 h2: server: file serving chunk restricted to max frame size from SETTINGS 2021-07-23 04:22:06 +01:00
Andy Green
ee510154a0 fi: wsi: fault to fake peer hangup after a delay range
Example usage, client

$ valgrind ./bin/lws-minimal-secure-streams-stress-client -c 4 --budget 40

proxy

$ valgrind ./lws-minimal-secure-streams-proxy --fault-injection "ss=mintest/wsi/timedclose(20%),ss=mintest/wsi/timedclose_ms(0..100)"
2021-07-04 10:29:54 +01:00
Andy Green
5d8cf03221 logs: log contexts 2021-07-01 05:20:53 +01:00
Andy Green
8e76634ed3 logs: introduce log_cx 2021-07-01 05:20:53 +01:00
Andy Green
cf2dbdc6a0 vhost: create multiple listen sockets per AF
On some platforms AF_INET and AF_INET6 must be listened for on separate
sockets.  Adapt the vhost server creation code to use the new support for
multiple listen sockets per vhost to create up to two listen sockets for
AF_INET and AF_INET6.

It refactors how the decision about the AF is made and propagated so
there's only one place for it.
2021-06-22 16:25:50 +01:00
Andy Green
6163c96727 vhost: allow multiple listen sockets
Some platforms need two sockets with AF_INET and AF_INET6 to listen to both
protocols.

This patch changes the single listen socket each vhost could previously
handle to become an lws_dll2 and adapts the related code to handle them as
a linked-list rather than as a singleton.

The next patch adapts the listen / server code to create multiple listen
wsi for vhosts listening on multiple ip protocols.
2021-06-22 15:55:47 +01:00
Andy Green
ad3aa5339e TCP_FASTOPEN 2021-05-25 08:13:13 +01:00
Andy Green
19d59f9977 listen: ip bind: force ipv4 if given ipv4 numeric iface 2021-05-06 20:51:43 +01:00
Marco Gratzke
32c4d2cb29 spa: parser should tolerate additional headers 2021-04-27 11:54:06 +01:00
Per Bothner
018d443863 http: mimetypes: add mjs as builtin 2021-04-12 06:36:24 +01:00
Andy Green
51490ae6e6 Fault injection
add lws_xos: xoshiro256 PRNG
2021-04-05 10:55:04 +01: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
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
f42c97baa9 route: on change also check source address still extant 2021-02-17 11:39:12 +00:00
Andy Green
d73c4baab2 options: fixes
sai: add default-noudp and windows plats for noserver
2021-02-01 15:19:38 +00:00
Andy Green
cfe4fa1551 http: proxy: fix uri relisting 2021-01-29 21:22:31 +00:00
Andy Green
d5618f6059 Wconversion: workarounds for CentOS7 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
Andy Green
c9731c5f17 type comparisons: fixes
This is a huge patch that should be a global NOP.

For unix type platforms it enables -Wconversion to issue warnings (-> error)
for all automatic casts that seem less than ideal but are normally concealed
by the toolchain.

This is things like passing an int to a size_t argument.  Once enabled, I
went through all args on my default build (which build most things) and
tried to make the removed default cast explicit.

With that approach it neither change nor bloat the code, since it compiles
to whatever it was doing before, just with the casts made explicit... in a
few cases I changed some length args from int to size_t but largely left
the causes alone.

From now on, new code that is relying on less than ideal casting
will complain and nudge me to improve it by warnings.
2021-01-05 10:56:38 +00:00