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

316 commits

Author SHA1 Message Date
Daniel Danzberger
4c50636912 unix: Fix linker errors when building without sdevent
When building without systemd event support (-DLWS_WITH_SDEVENT=OFF) on
a system that has libsystemd headers installed, lib/plat/unix-systemd.c
is build in anyway.
The final libwebsockets library has then references to symbols from
libsystemd even though it won't be linked.

Resulting in the follwoing linker errros:
--
/usr/bin/ld: /usr/local/lib/libwebsockets.so: undefined reference to `sd_is_socket_inet'
/usr/bin/ld: /usr/local/lib/libwebsockets.so: undefined reference to `sd_is_socket_unix'
/usr/bin/ld: /usr/local/lib/libwebsockets.so: undefined reference to `sd_listen_fds'
--

This commit ensures that unix-system.c is only build when LWS_WITH_SDEVENT is set and
the system has libsystemd headers installed.

Signed-off-by: Daniel Danzberger <dd@embedd.com>
2025-03-01 08:13:50 +00:00
Andy Green
2ffb8c6d5e sll_protocol may be be16
Google's fuzzer platform blows a warning

/src/libwebsockets/lib/plat/unix/unix-sockets.c:497:21: warning: implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to '__be16' (aka 'unsigned short') [-Wimplicit-int-conversion]
  497 |         sll.sll_protocol = (uint32_t)(htons((uint16_t)0x800));
2025-02-14 16:09:44 +00:00
Lucas
6328231f2a mbedtls: fix issue about memory leak
https://github.com/warmcat/libwebsockets/issues/3177
2024-11-08 07:57:25 +00:00
Andy Green
4393edf1a5 esp-idf-update 2024-11-03 07:59:12 +00:00
Orgad Shaneh
0336ff058e win: simplify error logging in windows-sockets.c 2024-10-03 05:27:48 +01:00
Orgad Shaneh
994278eff3 unix-file: Fix signed/unsigned implicit conversion 2024-10-03 05:21:43 +01:00
Andy Green
da61d4df06 win: file: use INVALID_HANDLE_VALUE directly
c571d22dba (commitcomment-142753910)
2024-09-25 12:25:05 +01:00
stropee
6bf61482b2 freertos: extra do_ripe 2024-09-25 10:30:24 +01:00
Andy Green
4f32b715ce win: trigger context destroy if pt destroying itself
https://github.com/warmcat/libwebsockets/issues/3182

This follows the flow for *nix
2024-09-25 09:36:29 +01:00
Andy Green
b486c2b545 pipe: only pt destroy pipe close should close pipe fds
https://github.com/warmcat/libwebsockets/issues/2873
2024-09-25 08:42:44 +01:00
Andy Green
2b47b276d4 win32: upscale timeout_ms to 64-bit int
This may help with this:

https://github.com/warmcat/libwebsockets/issues/3201
2024-09-25 07:12:50 +01:00
Andy Green
6112189aac unix-sockets: extra care around short for some toolchains
https://github.com/warmcat/libwebsockets/issues/3163
2024-09-25 06:46:25 +01:00
Andy Green
a542eb0a3b openbsd: disable HIGH_RELIABLITY socket option
https://github.com/warmcat/libwebsockets/issues/3204
2024-09-25 06:29:30 +01:00
ribes96
457a186f5b cgi: setenv: remove equals from arg
https://github.com/warmcat/libwebsockets/issues/3222
2024-09-23 10:36:50 +01:00
Andy Green
c57733cb00 systemd-sockact: set port to 0 on unix domain 2024-01-15 09:18:48 +00:00
Andy Green
3207da067e vhost: allow fd adoption 2024-01-04 11:35:01 +00:00
Orgad Shaneh
a1cda26305 windows: evade unused var warnings when logs disabled
https://github.com/warmcat/libwebsockets/pull/2792
2023-11-23 09:45:12 +00:00
Dylan Taft
18fdb0d6ec ipv6: Add support for RFC5014 for Linux
Linux has a sockopt flag defined by RFC5014 that informs IPv6 systems with
SLAAC config to prefer to bind the socket to a public address instead of
any temporary private address.

This patch adds a client info flag LCCSCF_IPV6_PREFER_PUBLIC_ADDR that lets
the user indicate the client socket should be prepared with the public
address binding preference.

Currently it's only implemented on Linux.
2023-10-15 07:54:50 +01:00
wangyingdong
07778789f4 Introducing libwebsockets support for nuttx
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-09-21 13:08:16 +01:00
songbuhuang
237506fed1 delete_from_fd: assert if fd beyond the max_fds
Signed-off-by: songbuhuang <544824346@qq.com>
2022-09-18 08:17:25 +01:00
Andy Green
03c7ce7365 win32: correct include path 2022-09-18 08:17:25 +01:00
Martlaak
50f32d0da2 windows: allow serving files open for write
https://github.com/warmcat/libwebsockets/issues/2713
2022-08-23 12:56:08 +01:00
Arenoros
e3ed2ba690 From a966322704 Mon Sep 17 00:00:00 2001
Subject: [PATCH] fix build on QNX 6.5.0
2022-07-13 06:24:12 +01:00
Andy Green
523c921206 win32: zip header path 2022-07-09 19:38:15 +01:00
Mykola Stryebkov
c92d9f9c5d eventloop: windows: ssl: remove spin 2022-06-14 07:37:19 +01:00
Harshit Malpani
ce49f1d0e5 plat: esp32: Remove esp_attr.h file 2022-04-23 07:39:43 +01:00
dcpng
609d0b82d8 windows: plugins uv fixes
https://github.com/warmcat/libwebsockets/issues/2617
2022-04-22 07:41:16 +01:00
Andy Green
6d88669b69 logs: use finegrained level test on unix-sockets.c 2022-04-10 06:56:12 +01:00
Andy Green
76d8840c5f coverity: fixes 2022-04-10 06:56:12 +01:00
Andy Green
e3743d47b4 lws_spi: Add esp32 DMA support
This provides an alternative esp32-specific SPI driver with ops that can be
swapped in place of the gpio bitbang one.

The pinmux info and lws gpio driver and other data in the spi bitbang
struct are used as-is by the DMA one.

New ops are provided which are able to allocate and free DMA-able memory so
the device drivers can prepare directly usable buffers.  Bounce through to
DMA-able buffers is also transparently supported.
2022-03-25 08:18:30 +00:00
Andy Green
7db51f4096 esp32s2: wifi and pwm
s2 ROM needs an explicit set_mode() as tested on Kaluga
Adapt PWM but unable to test as Kaluga has a smart RGB LED unlike Wrover
Kit
2022-03-25 08:18:30 +00:00
Andy Green
fcbc0dafa4 lws_ota 2022-03-25 08:18:30 +00:00
Andy Green
946b1fbff1 coverity: 2021-12-1 uplevel fixes 2022-03-15 10:28:09 +00:00
Andy Green
843ee10205 mbedtls: v3.1 reverts privacy of mbedtls_net_context fd
mbedtls seemed to realize that they went overboard with the privacy stuff
on v3.0 and removed some of it.  Introduce support for those members that
are only private on exactly v3.0 and unprotected before and after.
2022-03-15 10:28:09 +00: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
Luciano Iam
b61174b4b0 mingw: correct winsock recv() and send() buffer ptr type
This allows to build libwebsockets on MinGW. Winsock recv() and send()
expect non unsigned char* while lws uses uint_8*.

https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-send
https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recv
2022-03-15 10:28:09 +00:00
Sylvian Saunier
b3ec5a0a4e client: support socket reuseaddr 2022-01-16 10:48:16 +00:00
chenzhongaaron
27f8affcd0 qnx: toolchain file and adaptations
https://github.com/warmcat/libwebsockets/issues/2527
2021-12-15 13:28:23 +00:00
Andy Green
b8c4820be4 openssl: support SSLKEYLOGFILE client secret logging
This patch checks for the env var SSLKEYLOGFILE=path, if present, then
client connection tls secrets are appended into path.vhostname.

This allows decryption of captured encrypted data for debugging purposes.

SSKEYLOGFILE=path env var method is the same as provided by Firefox and
Chrome for this purpose.
2021-12-13 19:02:49 +00:00
Andy Green
ba89af373b async dns: allow multiple servers and public add remove apis 2021-11-17 14:50:08 +00:00
calvin2021y
c8811bfe48 android: fix extra warnings on android-resolv 2021-11-11 11:52:48 +00:00
Andy Green
53d195022f cmake: Enable WITH_MINIMAL_EXAMPLES by default
Although many of the examples must be run from the example directory as
cwd, everyone getting started probably wants to try the examples, cmake
knows how to do it, so let's enable it by default.
2021-11-11 11:52:46 +00:00
Andy Green
8ddcb16ef1 freertos-service: remove cruft
This can't be reached currently, so remove it and simplify the setting of c
to the exact equivalent.
2021-11-11 08:34:51 +00:00
Andy Green
591d42ff67 windows: mingw file type is int 2021-11-11 08:34:02 +00:00
Andy Green
d1f6101bad unix-sockets: NOP for coverity
continue here makes no difference than using break, but continue gets us a
pointless complaint "statement continue does not have any effect" and break
does not.
2021-11-08 13:44:45 +00:00
Andy Green
7c9f1ca0a6 plugins: iterate builtin plugins as if loaded
For plugins that handle PROTOCOL_INIT, we have to iterate any PLUGINS_BUILTIN
plugins as if we had just discovered and loaded them from plugin files, so
they bind to vhosts appropriately.

Add some private helpers to keep the guts from duplication in plat.
2021-11-07 07:04:09 +00:00
Andy Green
3f4800b88f log: cherrypick common errno to be strings
Pick some common errno constants for the platform and provide strings for
them.  Replace numeric errno logging with the new api for client.

Replace any usage of strerror() in network code with the new api.  For
constrained devices, this should give a small saving on .rodata.

Leave some usages in daemonize.c and unix plat where the size isn't going
to matter.
2021-10-29 20:10:52 +01:00
Chunho Lee
41c88959d2 plat: freertos: selectively use old service looping 2021-10-26 09:55:09 +01:00
Andy Green
7e09e42472 freertos: no need to freak out if service_adjust_to is 0
If lws_s_a_t() is zero, there's a path where n stays -1 from its
declaration and we return -1.
2021-10-15 19:07:33 +01:00
Orefkov Aleksander
1274ea03c0 mbedtls: windows: add define to be compatible with the latest versions of mbedtls 2021-10-12 15:37:23 +01:00