Skip to content

Commit

Permalink
Merge pull request #224 from c-jimenez/develop
Browse files Browse the repository at this point in the history
Version 1.5.7
  • Loading branch information
c-jimenez authored Feb 5, 2025
2 parents 1538ecc + 8d3eff3 commit e409c11
Show file tree
Hide file tree
Showing 52 changed files with 297 additions and 200 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
permissions:
actions: read
contents: read
Expand All @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -66,4 +66,4 @@ jobs:
make clang
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/install-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand Down
53 changes: 41 additions & 12 deletions 3rdparty/libwebsockets/.sai.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# has somewhere to go to find its /usr/share content like certs

"platforms": {
"linux-debian-buster/x86_64-amd/gcc": {
"linux-debian-11/x86_64-amd/gcc": {
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export SAI_CPACK=\"-G DEB\";cmake .. ${cmake} && make -j4 && rm -rf ../destdir && make -j DESTDIR=../destdir install && ctest -j2 --output-on-failure ${cpack}"
},
"linux-debian-buster/x86-amd/gcc": {
Expand All @@ -20,6 +20,10 @@
"linux-debian-sid/x86-amd/gcc": {
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export SAI_CPACK=\"-G DEB\";cmake .. ${cmake} && make -j4 && rm -rf ../destdir && make -j DESTDIR=../destdir install && ctest -j2 --output-on-failure ${cpack}"
},
"linux-debian-sid/x86_64-amd/gcc": {
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export SAI_CPACK=\"-G DEB\";cmake .. ${cmake} && make -j4 && rm -rf ../destdir && make -j DESTDIR=../destdir install && ctest -j2 --output-on-failure ${cpack}"
},

"linux-ubuntu-1804/x86_64-amd/gcc": {
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export SAI_CPACK=\"-G DEB\";cmake .. ${cmake} && make -j4 && rm -rf ../destdir && make -j DESTDIR=../destdir install && ctest -j2 --output-on-failure ${cpack}"
},
Expand All @@ -38,6 +42,9 @@
"linux-centos-8/x86_64-amd/gcc": {
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export SAI_CPACK=\"-G RPM\";cmake .. ${cmake} && make -j4 && rm -rf ../destdir && make -j DESTDIR=../destdir install && ctest -j2 --output-on-failure ${cpack}"
},
"linux-centos-8/aarch64-a72-bcm2711-rpi4/gcc": {
"build": "mkdir build destdir;cd build;export CCACHE_DISABLE=1;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export SAI_CPACK=\"-G RPM\";cmake .. ${cmake} && make -j4 && rm -rf ../destdir && make -j DESTDIR=../destdir install && ctest -j2 --output-on-failure ${cpack}"
},
"linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc": {
"build": "mkdir build;cd build;export CCACHE_DISABLE=1;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export SAI_CPACK=\"-G DEB\";cmake .. ${cmake} && make -j3 && rm -rf ../destdir && make -j DESTDIR=../destdir install && ctest -j3 --output-on-failure ${cpack}",
"default": false
Expand Down Expand Up @@ -91,6 +98,11 @@
"build": "rm -rf ebuild ; mkdir ebuild; cd ebuild; cp -rp ../minimal-examples/embedded/esp32/${cpack} . ; cd ${cpack} ; . /opt/esp/esp-idf/export.sh ; ln -sf ../.. libwebsockets ; idf.py set-target esp32 && cp libwebsockets/minimal-examples/embedded/esp32/${cpack}/sdkconfig . && cp sdkconfig.h build && idf.py ${cmake} build size size-components size-files && cd build && /usr/local/bin/sai-device ${cpack} ESPPORT=0 ctest --output-on-failure",
"default": false
},
"freertos-espidf/riscv-esp32c3/gcc": {
"build": "rm -rf ebuild ; mkdir ebuild; cd ebuild; cp -rp ../minimal-examples/embedded/esp32/${cpack} . ; cd ${cpack} ; . /opt/esp/esp-idf/export.sh ; ln -sf ../.. libwebsockets ; idf.py set-target esp32c3 && cp libwebsockets/minimal-examples/embedded/esp32/${cpack}/sdkconfig . && cp sdkconfig.h build && idf.py ${cmake} build size size-components size-files && cd build && /usr/local/bin/sai-device ${cpack} ESPPORT=0 ctest --output-on-failure",
"default": false
},

"linux-fedora-32/riscv64-virt/gcc": {
"build": "mkdir build destdir;cd build;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export CCACHE_DISABLE=1;export SAI_CPACK=\"-G RPM\";cmake .. ${cmake} && make -j4 && rm -rf ../destdir && make -j12 DESTDIR=../destdir install && ctest -j3 --output-on-failure ${cpack}",
"default": false
Expand All @@ -105,29 +117,39 @@
"netbsd/aarch64BE-bcm2837-a53/gcc": {
"build": "mkdir build destdir;cd build;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export CCACHE_DISABLE=1;cmake .. ${cmake};make -j6 && rm -rf ../destdir && make -j6 DESTDIR=../destdir install && /usr/pkg/bin/ctest -j3 --output-on-failure",
"default": false
},
"netbsd/x86_64-amd/gcc": {
"build": "mkdir build destdir;cd build;export LD_LIBRARY_PATH=../destdir/usr/local/share/libwebsockets-test-server/plugins:../destdir/usr/local/lib;export CCACHE_DISABLE=1;cmake .. ${cmake};make -j6 && rm -rf ../destdir && make -j6 DESTDIR=../destdir install && /usr/pkg/bin/ctest -j3 --output-on-failure",
"default": false
}

},

"configurations": {
"default": {
"cmake": "",
"platforms": "w10/x86_64-amd/msvc, w10/x86_64-amd/noptmsvc, freertos-linkit/arm32-m4-mt7697-usi/gcc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc, w10/x86_64-amd/mingw32, w10/x86_64-amd/mingw64, netbsd/aarch64BE-bcm2837-a53/gcc, w10/x86_64-amd/wmbedtlsmsvc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
"platforms": "w10/x86_64-amd/msvc, w10/x86_64-amd/noptmsvc, freertos-linkit/arm32-m4-mt7697-usi/gcc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc, w10/x86_64-amd/mingw32, w10/x86_64-amd/mingw64, netbsd/aarch64BE-bcm2837-a53/gcc, netbsd/x86_64-amd/gcc, w10/x86_64-amd/wmbedtlsmsvc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
},
"default-noudp": {
"cmake": "-DLWS_WITH_UDP=0",
"platforms": "w10/x86_64-amd/msvc, w10/x86_64-amd/noptmsvc, freertos-linkit/arm32-m4-mt7697-usi/gcc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc, w10/x86_64-amd/mingw32, w10/x86_64-amd/mingw64, netbsd/aarch64BE-bcm2837-a53/gcc, w10/x86_64-amd/wmbedtlsmsvc"
"platforms": "w10/x86_64-amd/msvc, w10/x86_64-amd/noptmsvc, freertos-linkit/arm32-m4-mt7697-usi/gcc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc, w10/x86_64-amd/mingw32, w10/x86_64-amd/mingw64, netbsd/aarch64BE-bcm2837-a53/gcc, netbsd/x86_64-amd/gcc, w10/x86_64-amd/wmbedtlsmsvc"
},
"fault-injection": {
"cmake": "-DLWS_WITH_SYS_FAULT_INJECTION=1 -DLWS_WITH_MINIMAL_EXAMPLES=1",
"cmake": "-DLWS_WITH_SYS_FAULT_INJECTION=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_CBOR=1",
"platforms": "w10/x86_64-amd/msvc"
},
"esp32-c3": {
"cmake": "-DLWS_IPV6=0",
"cpack": "esp-c3dev",
"platforms": "none, freertos-espidf/riscv-esp32c3/gcc"
},
"esp32-heltec": {
"cmake": "-DLWS_IPV6=0",
"cpack": "esp-heltec-wb32",
"platforms": "none, freertos-espidf/xl6-esp32/gcc"
},
"esp32-wrover": {
"cmake": "-DLWS_IPV6=0",
"cmake": "-DLWS_IPV6=0 -DLWS_WITH_CBOR=1",
"cpack": "esp-wrover-kit",
"platforms": "none, freertos-espidf/xl6-esp32/gcc"
},
Expand Down Expand Up @@ -158,11 +180,11 @@
},
"default-examples": {
"cmake": "-DLWS_WITH_MINIMAL_EXAMPLES=1",
"platforms": "w10/x86_64-amd/msvc, w10/x86_64-amd/noptmsvc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc, netbsd/aarch64BE-bcm2837-a53/gcc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
"platforms": "w10/x86_64-amd/msvc, w10/x86_64-amd/noptmsvc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc, netbsd/aarch64BE-bcm2837-a53/gcc, netbsd/x86_64-amd/gcc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
},
"default-examples-tls-sess": {
"cmake": "-DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_TLS_SESSIONS=1",
"platforms": "w10/x86_64-amd/msvc, w10/x86_64-amd/noptmsvc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc, netbsd/aarch64BE-bcm2837-a53/gcc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
"platforms": "w10/x86_64-amd/msvc, w10/x86_64-amd/noptmsvc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc, netbsd/aarch64BE-bcm2837-a53/gcc, netbsd/x86_64-amd/gcc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
},
"h1only-examples": {
"cmake": "cmake .. -DLWS_WITH_HTTP2=0 -DLWS_WITH_MINIMAL_EXAMPLES=1",
Expand All @@ -187,11 +209,11 @@
},
"secure-streams-proxy": {
"cmake": "-DLWS_WITH_SECURE_STREAMS=1 -DLWS_WITH_SECURE_STREAMS_PROXY_API=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_SECURE_STREAMS_AUTH_SIGV4=1",
"platforms": "not w10/x86_64-amd/msvc, netbsd/aarch64BE-bcm2837-a53/gcc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
"platforms": "not w10/x86_64-amd/msvc, netbsd/aarch64BE-bcm2837-a53/gcc, netbsd/x86_64-amd/gcc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
},
"secure-streams-proxy-metrics": {
"cmake": "-DLWS_WITH_SECURE_STREAMS=1 -DLWS_WITH_SECURE_STREAMS_PROXY_API=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_SECURE_STREAMS_AUTH_SIGV4=1 -DLWS_WITH_SYS_METRICS=1",
"platforms": "not w10/x86_64-amd/msvc, netbsd/aarch64BE-bcm2837-a53/gcc"
"platforms": "not w10/x86_64-amd/msvc, netbsd/aarch64BE-bcm2837-a53/gcc, netbsd/x86_64-amd/gcc"
},
"distro_recommended": { # minimal examples also needed for ctest
"cmake": "-DLWS_WITH_DISTRO_RECOMMENDED=1 -DLWS_WITH_MINIMAL_EXAMPLES=1",
Expand All @@ -210,7 +232,7 @@
"platforms": "not linux-centos-8/x86_64-amd/gcc"
},
"lwsws2": {
"cmake": "-DLWS_WITH_LWSWS=ON -DLWS_WITHOUT_EXTENSIONS=0 -DLWS_WITH_HTTP2=1 -DLWS_WITH_ACME=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DCMAKE_BUILD_TYPE=DEBUG -DLWS_WITH_LWS_DSH=1",
"cmake": "-DLWS_WITH_LWSWS=ON -DLWS_WITHOUT_EXTENSIONS=0 -DLWS_WITH_HTTP2=1 -DLWS_WITH_ACME=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DCMAKE_BUILD_TYPE=DEBUG -DLWS_WITH_LWS_DSH=1 -DLWS_WITH_CACHE_NSCOOKIEJAR=0",
# no distro -devel package for libuv
"platforms": "not linux-centos-8/x86_64-amd/gcc"
},
Expand All @@ -221,11 +243,11 @@
"mbedtls": {
"cmake": "-DLWS_WITH_MBEDTLS=1 -DLWS_WITH_HTTP2=1 -DLWS_WITH_LWSWS=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_JOSE=1 -DCMAKE_BUILD_TYPE=DEBUG",
# no distro -devel package for mbedtls
"platforms": "not linux-centos-7/x86_64-amd/gcc, not linux-centos-8/x86_64-amd/gcc"
"platforms": "not linux-centos-7/x86_64-amd/gcc, not linux-centos-8/x86_64-amd/gcc, not linux-ubuntu-xenial/x86_64-amd/gcc"
},
"mbedtls-metrics": {
"cmake": "-DLWS_WITH_MBEDTLS=1 -DLWS_WITH_HTTP2=1 -DLWS_WITH_LWSWS=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_JOSE=1 -DCMAKE_BUILD_TYPE=DEBUG -DLWS_WITH_SYS_METRICS=1",
"platforms": "not linux-centos-7/x86_64-amd/gcc, not linux-centos-8/x86_64-amd/gcc"
"platforms": "not linux-centos-7/x86_64-amd/gcc, not linux-centos-8/x86_64-amd/gcc, not linux-ubuntu-xenial/x86_64-amd/gcc"
},
"noserver": {
"cmake": "-DLWS_WITHOUT_SERVER=ON -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_SECURE_STREAMS=1",
Expand Down Expand Up @@ -279,6 +301,13 @@
"nologs": {
"cmake": "-DLWS_WITH_NO_LOGS=ON"
},
"cookiejar": {
"cmake": "-DLWS_WITH_CACHE_NSCOOKIEJAR=ON"
},
"jittrust": {
"cmake": "-DLWS_WITH_TLS_JIT_TRUST=1",
"platforms": "none, linux-fedora-32/x86_64-amd/gcc"
},
"smp": {
"cmake": "-DLWS_MAX_SMP=32 -DLWS_WITH_MINIMAL_EXAMPLES=1"
},
Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/libwebsockets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ set(CPACK_RPM_PACKAGE_LICENSE "MIT")
set(CPACK_PACKAGE_NAME "${PACKAGE}")
set(CPACK_PACKAGE_VERSION_MAJOR "4")
set(CPACK_PACKAGE_VERSION_MINOR "3")
set(CPACK_PACKAGE_VERSION_PATCH_NUMBER "2")
set(CPACK_PACKAGE_VERSION_PATCH_NUMBER "3")

set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH_NUMBER}-${LWS_BUILD_HASH}")
set(CPACK_PACKAGE_RELEASE 1)
Expand Down Expand Up @@ -880,7 +880,7 @@ endif()
#
# ZLIB (needed for deflate extension and if LWS_WITH_HTTP_STREAM_COMPRESSION)
#
if (LWS_WITH_ZLIB)
if (LWS_WITH_ZLIB AND NOT LWS_WITH_BUNDLED_ZLIB)
if (NOT ZLIB_FOUND)
if (LWS_WITH_MINIZ)
find_package(Miniz REQUIRED)
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/libwebsockets/cmake/lws_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
#cmakedefine LWS_HAVE_mbedtls_ssl_set_verify
#cmakedefine LWS_HAVE_mbedtls_x509_crt_parse_file
#cmakedefine LWS_HAVE_MBEDTLS_NET_SOCKETS
#cmakedefine LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET
#cmakedefine LWS_HAVE_MBEDTLS_AUTH_KEY_ID
#cmakedefine LWS_HAVE_NEW_UV_VERSION_H
#cmakedefine LWS_HAVE_OPENSSL_ECDH_H
Expand Down
4 changes: 0 additions & 4 deletions 3rdparty/libwebsockets/include/libwebsockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ extern "C" {

#include "lws_config.h"

#if defined(LWS_SUPPRESS_DEPRECATED_API_WARNINGS)
#define OPENSSL_USE_DEPRECATED
#endif

/* place for one-shot opaque forward references */

typedef struct lws_context * lws_ctx_t;
Expand Down
9 changes: 0 additions & 9 deletions 3rdparty/libwebsockets/include/libwebsockets/lws-callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,6 @@ enum lws_callback_reasons {
* the default callback action of returning 0 allows the client
* certificates. */

LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY = 37,
/**< if configured for including OpenSSL support but no private key
* file has been specified (ssl_private_key_filepath is NULL), this is
* called to allow the user to set the private key directly via
* libopenssl and perform further operations if required; this might be
* useful in situations where the private key is not directly accessible
* by the OS, for example if it is stored on a smartcard.
* user is the server's OpenSSL SSL_CTX* */

LWS_CALLBACK_SSL_INFO = 67,
/**< SSL connections only. An event you registered an
* interest in at the vhost has occurred on a connection
Expand Down
13 changes: 9 additions & 4 deletions 3rdparty/libwebsockets/include/libwebsockets/lws-context-vhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,15 @@ struct lws_context_creation_info {
*/
const char *ssl_private_key_filepath;
/**< VHOST: filepath to private key if wanting SSL mode;
* if this is set to NULL but ssl_cert_filepath is set, the
* OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY callback is called
* to allow setting of the private key directly via openSSL
* library calls. (For backwards compatibility, this can also be used
* this should not be set to NULL when ssl_cert_filepath is set.
*
* Alteratively, the certificate and private key can both be set in
* the OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS callback directly via
* openSSL library calls. This requires that
* LWS_SERVER_OPTION_CREATE_VHOST_SSL_CTX is set in the vhost info options
* to force initializtion of the SSL_CTX context.
*
* (For backwards compatibility, this can also be used
* to pass the client cert private key filepath when setting up a
* vhost client SSL context, but it is preferred to use
* .client_ssl_private_key_filepath for that.)
Expand Down
2 changes: 2 additions & 0 deletions 3rdparty/libwebsockets/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ if (DEFINED LWS_PLAT_UNIX)
endif()
endif()
set(LWS_HAVE_MBEDTLS_NET_SOCKETS ${LWS_HAVE_MBEDTLS_NET_SOCKETS} PARENT_SCOPE)
set(LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET ${LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET} PARENT_SCOPE)
set(LWS_HAVE_mbedtls_ssl_conf_alpn_protocols ${LWS_HAVE_mbedtls_ssl_conf_alpn_protocols} PARENT_SCOPE)
set(TEST_SERVER_SSL_KEY "${TEST_SERVER_SSL_KEY}" PARENT_SCOPE)
set(TEST_SERVER_SSL_CERT "${TEST_SERVER_SSL_CERT}" PARENT_SCOPE)
set(TEST_SERVER_DATA ${TEST_SERVER_DATA} PARENT_SCOPE)
Expand Down
8 changes: 7 additions & 1 deletion 3rdparty/libwebsockets/lib/core-net/client/connect3.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ lws_client_connect_check(struct lws *wsi, int *real_errno)

#else

if (!connect(wsi->desc.sockfd, (const struct sockaddr *)&wsi->sa46_peer.sa4, 0))
if (!connect(wsi->desc.sockfd, (const struct sockaddr *)&wsi->sa46_peer.sa4,
#if defined(WIN32)
sizeof(struct sockaddr)))
#else
0))
#endif

return LCCCR_CONNECTED;

en = LWS_ERRNO;
Expand Down
14 changes: 14 additions & 0 deletions 3rdparty/libwebsockets/lib/core-net/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,20 @@ __lws_vhost_destroy2(struct lws_vhost *vh)

// lwsl_info("%s: %s\n", __func__, vh->name);

/*
* remove ourselves from the defer binding list
*/
lws_start_foreach_llp(struct lws_vhost **, pv,
vh->context->no_listener_vhost_list) {
if (*pv == vh) {
lwsl_debug("deferred iface: removing vh %s\n",
(*pv)->name);
*pv = vh->no_listener_vhost_list;
vh->no_listener_vhost_list = NULL;
break;
}
} lws_end_foreach_llp(pv, no_listener_vhost_list);

/*
* let the protocols destroy the per-vhost protocol objects
*/
Expand Down
28 changes: 20 additions & 8 deletions 3rdparty/libwebsockets/lib/core/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,6 @@ static const char * const opts_str =
#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API)
"SSPROX "
#endif

#if defined(LWS_WITH_MBEDTLS)
"MbedTLS "
#endif
#if defined(LWS_WITH_CONMON)
"ConMon "
#endif
Expand Down Expand Up @@ -390,6 +386,9 @@ lws_create_context(const struct lws_context_creation_info *info)
#if defined(LWS_WITH_CACHE_NSCOOKIEJAR) && defined(LWS_WITH_CLIENT)
struct lws_cache_creation_info ci;
#endif
#if defined(LWS_WITH_MBEDTLS)
char mbedtls_version[32];
#endif

#if defined(__ANDROID__)
struct rlimit rt;
Expand Down Expand Up @@ -609,6 +608,12 @@ lws_create_context(const struct lws_context_creation_info *info)
goto early_bail;
}

#if defined(LWS_WITH_SYS_STATE)
// NOTE: we need to init this fields because they may be used in logger when context destroying
context->mgr_system.state_names = system_state_names;
context->mgr_system.context = context;
#endif

#if defined(LWS_WITH_NETWORK)
context->event_loop_ops = plev->ops;
context->us_wait_resolution = us_wait_resolution;
Expand Down Expand Up @@ -782,7 +787,16 @@ lws_create_context(const struct lws_context_creation_info *info)

#endif /* network */

#if defined(LWS_WITH_MBEDTLS)
mbedtls_version_get_string(mbedtls_version);
#endif

#if defined(LWS_WITH_MBEDTLS)
lwsl_cx_notice(context, "LWS: %s, MbedTLS-%s %s%s", library_version, mbedtls_version, opts_str, s);
#else
lwsl_cx_notice(context, "LWS: %s, %s%s", library_version, opts_str, s);
#endif

#if defined(LWS_WITH_NETWORK)
lwsl_cx_info(context, "Event loop: %s", plev->ops->name);
#endif
Expand Down Expand Up @@ -1340,11 +1354,9 @@ lws_create_context(const struct lws_context_creation_info *info)
* init the lws_state mgr for the system state
*/

context->mgr_system.state_names = system_state_names;
context->mgr_system.name = "system";
context->mgr_system.state = LWS_SYSTATE_CONTEXT_CREATED;
context->mgr_system.parent = context;
context->mgr_system.context = context;
#if defined(LWS_WITH_SYS_SMD)
context->mgr_system.smd_class = LWSSMDCL_SYSTEM_STATE;
#endif
Expand Down Expand Up @@ -1676,9 +1688,9 @@ lws_pt_destroy(struct lws_context_per_thread *pt)
pt->pipe_wsi = NULL;
}

if (pt->dummy_pipe_fds[0]
if ((pt->dummy_pipe_fds[0] || pt->dummy_pipe_fds[1])
#if !defined(WIN32)
&& (int)pt->dummy_pipe_fds[0] != -1
&& ((int)pt->dummy_pipe_fds[0] != -1 || (int)pt->dummy_pipe_fds[1] != -1)
#endif
) {
struct lws wsi;
Expand Down
Loading

0 comments on commit e409c11

Please sign in to comment.