libwebsockets: update to 4.3.3

Part of the openssl3 migration efforts
This commit is contained in:
PulkoMandy
2024-08-28 20:59:29 +02:00
parent 7b5b1cc555
commit b4dfc1bc7d
2 changed files with 86 additions and 5 deletions

View File

@@ -3,11 +3,11 @@ DESCRIPTION="Libwebsockets (LWS) is a flexible, lightweight pure C library \
for implementing modern network protocols easily with a tiny footprint, \
using a nonblocking event loop."
HOMEPAGE="https://libwebsockets.org/"
COPYRIGHT="2010-2018 Andy Green"
COPYRIGHT="2010-2023 Andy Green"
LICENSE="GNU LGPL v2.1"
REVISION="3"
REVISION="1"
SOURCE_URI="https://github.com/warmcat/libwebsockets/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="a6b611c212c52f161f70556339fdaa199b7e9b6a167c4638e086d19db75d6290"
CHECKSUM_SHA256="6fd33527b410a37ebc91bb64ca51bdabab12b076bc99d153d7c5dd405e4bdf90"
SOURCE_FILENAME="libwebsockets-$portVersion.tar.gz"
SOURCE_DIR="libwebsockets-$portVersion"
@@ -38,8 +38,8 @@ REQUIRES_devel="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libcrypto$secondaryArchSuffix >= 3
devel:libssl$secondaryArchSuffix >= 3
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="

View File

@@ -0,0 +1,81 @@
From a1fe8de330859946f6bac5987bab3254df3edea2 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Wed, 28 Aug 2024 20:58:09 +0200
Subject: Disable some linux-isms for Haiku
- We don't have IPTOS_MINCOST
- We don't have stat information in dirents
- Our ioctl use an unsigned long instead of an int
diff --git a/lib/misc/dir.c b/lib/misc/dir.c
index b343b92..d703f19 100644
--- a/lib/misc/dir.c
+++ b/lib/misc/dir.c
@@ -131,7 +131,7 @@ lws_dir(const char *dirpath, void *user, lws_dir_callback_function cb)
}
for (i = 0; i < n; i++) {
-#if !defined(__sun) && !defined(__QNX__)
+#if !defined(__sun) && !defined(__QNX__) && !defined(__HAIKU__)
unsigned int type = namelist[i]->d_type;
#endif
if (strchr(namelist[i]->d_name, '~'))
@@ -143,7 +143,7 @@ lws_dir(const char *dirpath, void *user, lws_dir_callback_function cb)
* files are LDOT_UNKNOWN
*/
-#if defined(__sun) || defined(__QNX__)
+#if defined(__sun) || defined(__QNX__) || defined(__HAIKU__)
lws_dir_via_stat(combo, l, namelist[i]->d_name, &lde);
#else
/*
diff --git a/lib/misc/getifaddrs.c b/lib/misc/getifaddrs.c
index 125088e..c8f6a94 100644
--- a/lib/misc/getifaddrs.c
+++ b/lib/misc/getifaddrs.c
@@ -100,7 +100,7 @@ getifaddrs2(struct ifaddrs **ifap, int af, int siocgifconf, int siocgifflags,
/*
* Solaris returns EINVAL when the buffer is too small.
*/
- if (ioctl(fd, siocgifconf, &ifconf) < 0 && errno != EINVAL) {
+ if (ioctl(fd, (ulong)siocgifconf, &ifconf) < 0 && errno != EINVAL) {
ret = errno;
goto error_out;
}
@@ -115,7 +115,7 @@ getifaddrs2(struct ifaddrs **ifap, int af, int siocgifconf, int siocgifflags,
buf_size *= 2;
}
- for (p = ifconf.ifc_buf; p < ifconf.ifc_buf + ifconf.ifc_len; p += sz) {
+ for (p = ifconf.ifc_buf; p < (char*)ifconf.ifc_buf + ifconf.ifc_len; p += sz) {
struct ifreq ifreq;
struct sockaddr *sa;
size_t salen;
@@ -136,7 +136,7 @@ getifaddrs2(struct ifaddrs **ifap, int af, int siocgifconf, int siocgifflags,
memset(&ifreq, 0, sizeof(ifreq));
memcpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifr->ifr_name));
- if (ioctl(fd, siocgifflags, &ifreq) < 0) {
+ if (ioctl(fd, (ulong)siocgifflags, &ifreq) < 0) {
ret = errno;
goto error_out;
}
diff --git a/lib/plat/unix/unix-sockets.c b/lib/plat/unix/unix-sockets.c
index cb2f1bb..8e91d9c 100644
--- a/lib/plat/unix/unix-sockets.c
+++ b/lib/plat/unix/unix-sockets.c
@@ -198,8 +198,10 @@ static const int ip_opt_lws_flags[] = {
#endif
}, ip_opt_val[] = {
IPTOS_LOWDELAY, IPTOS_THROUGHPUT, IPTOS_RELIABILITY
-#if !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNX__)
+#if !defined(__OpenBSD__) && !defined(__sun) && !defined(__QNX__) && !defined(__HAIKU__)
, IPTOS_MINCOST
+#else
+ , 0
#endif
};
#if !defined(LWS_WITH_NO_LOGS)
--
2.45.2