Skip to content

Commit e409c11

Browse files
authored
Merge pull request #224 from c-jimenez/develop
Version 1.5.7
2 parents 1538ecc + 8d3eff3 commit e409c11

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+297
-200
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
analyze:
2525
name: Analyze
26-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-20.04
2727
permissions:
2828
actions: read
2929
contents: read
@@ -42,7 +42,7 @@ jobs:
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
45+
uses: github/codeql-action/init@v3
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -66,4 +66,4 @@ jobs:
6666
make clang
6767
6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v2
69+
uses: github/codeql-action/analyze@v3

.github/workflows/install-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-20.04
1313

1414
steps:
1515
- uses: actions/checkout@v2

.github/workflows/unit-test-debug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-20.04
1313

1414
steps:
1515
- uses: actions/checkout@v2

.github/workflows/unit-test-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-20.04
1313

1414
steps:
1515
- uses: actions/checkout@v2

3rdparty/libwebsockets/.sai.json

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# has somewhere to go to find its /usr/share content like certs
66

77
"platforms": {
8-
"linux-debian-buster/x86_64-amd/gcc": {
8+
"linux-debian-11/x86_64-amd/gcc": {
99
"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}"
1010
},
1111
"linux-debian-buster/x86-amd/gcc": {
@@ -20,6 +20,10 @@
2020
"linux-debian-sid/x86-amd/gcc": {
2121
"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}"
2222
},
23+
"linux-debian-sid/x86_64-amd/gcc": {
24+
"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}"
25+
},
26+
2327
"linux-ubuntu-1804/x86_64-amd/gcc": {
2428
"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}"
2529
},
@@ -38,6 +42,9 @@
3842
"linux-centos-8/x86_64-amd/gcc": {
3943
"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}"
4044
},
45+
"linux-centos-8/aarch64-a72-bcm2711-rpi4/gcc": {
46+
"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}"
47+
},
4148
"linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc": {
4249
"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}",
4350
"default": false
@@ -91,6 +98,11 @@
9198
"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",
9299
"default": false
93100
},
101+
"freertos-espidf/riscv-esp32c3/gcc": {
102+
"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",
103+
"default": false
104+
},
105+
94106
"linux-fedora-32/riscv64-virt/gcc": {
95107
"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}",
96108
"default": false
@@ -105,29 +117,39 @@
105117
"netbsd/aarch64BE-bcm2837-a53/gcc": {
106118
"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",
107119
"default": false
120+
},
121+
"netbsd/x86_64-amd/gcc": {
122+
"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",
123+
"default": false
108124
}
125+
109126
},
110127

111128
"configurations": {
112129
"default": {
113130
"cmake": "",
114-
"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"
131+
"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"
115132
},
116133
"default-noudp": {
117134
"cmake": "-DLWS_WITH_UDP=0",
118-
"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"
135+
"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"
119136
},
120137
"fault-injection": {
121-
"cmake": "-DLWS_WITH_SYS_FAULT_INJECTION=1 -DLWS_WITH_MINIMAL_EXAMPLES=1",
138+
"cmake": "-DLWS_WITH_SYS_FAULT_INJECTION=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_CBOR=1",
122139
"platforms": "w10/x86_64-amd/msvc"
123140
},
141+
"esp32-c3": {
142+
"cmake": "-DLWS_IPV6=0",
143+
"cpack": "esp-c3dev",
144+
"platforms": "none, freertos-espidf/riscv-esp32c3/gcc"
145+
},
124146
"esp32-heltec": {
125147
"cmake": "-DLWS_IPV6=0",
126148
"cpack": "esp-heltec-wb32",
127149
"platforms": "none, freertos-espidf/xl6-esp32/gcc"
128150
},
129151
"esp32-wrover": {
130-
"cmake": "-DLWS_IPV6=0",
152+
"cmake": "-DLWS_IPV6=0 -DLWS_WITH_CBOR=1",
131153
"cpack": "esp-wrover-kit",
132154
"platforms": "none, freertos-espidf/xl6-esp32/gcc"
133155
},
@@ -158,11 +180,11 @@
158180
},
159181
"default-examples": {
160182
"cmake": "-DLWS_WITH_MINIMAL_EXAMPLES=1",
161-
"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"
183+
"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"
162184
},
163185
"default-examples-tls-sess": {
164186
"cmake": "-DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_TLS_SESSIONS=1",
165-
"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"
187+
"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"
166188
},
167189
"h1only-examples": {
168190
"cmake": "cmake .. -DLWS_WITH_HTTP2=0 -DLWS_WITH_MINIMAL_EXAMPLES=1",
@@ -187,11 +209,11 @@
187209
},
188210
"secure-streams-proxy": {
189211
"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",
190-
"platforms": "not w10/x86_64-amd/msvc, netbsd/aarch64BE-bcm2837-a53/gcc, openbsd/x86_64-amd/llvm, solaris/x86_64-amd/gcc"
212+
"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"
191213
},
192214
"secure-streams-proxy-metrics": {
193215
"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",
194-
"platforms": "not w10/x86_64-amd/msvc, netbsd/aarch64BE-bcm2837-a53/gcc"
216+
"platforms": "not w10/x86_64-amd/msvc, netbsd/aarch64BE-bcm2837-a53/gcc, netbsd/x86_64-amd/gcc"
195217
},
196218
"distro_recommended": { # minimal examples also needed for ctest
197219
"cmake": "-DLWS_WITH_DISTRO_RECOMMENDED=1 -DLWS_WITH_MINIMAL_EXAMPLES=1",
@@ -210,7 +232,7 @@
210232
"platforms": "not linux-centos-8/x86_64-amd/gcc"
211233
},
212234
"lwsws2": {
213-
"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",
235+
"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",
214236
# no distro -devel package for libuv
215237
"platforms": "not linux-centos-8/x86_64-amd/gcc"
216238
},
@@ -221,11 +243,11 @@
221243
"mbedtls": {
222244
"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",
223245
# no distro -devel package for mbedtls
224-
"platforms": "not linux-centos-7/x86_64-amd/gcc, not linux-centos-8/x86_64-amd/gcc"
246+
"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"
225247
},
226248
"mbedtls-metrics": {
227249
"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",
228-
"platforms": "not linux-centos-7/x86_64-amd/gcc, not linux-centos-8/x86_64-amd/gcc"
250+
"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"
229251
},
230252
"noserver": {
231253
"cmake": "-DLWS_WITHOUT_SERVER=ON -DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_SECURE_STREAMS=1",
@@ -279,6 +301,13 @@
279301
"nologs": {
280302
"cmake": "-DLWS_WITH_NO_LOGS=ON"
281303
},
304+
"cookiejar": {
305+
"cmake": "-DLWS_WITH_CACHE_NSCOOKIEJAR=ON"
306+
},
307+
"jittrust": {
308+
"cmake": "-DLWS_WITH_TLS_JIT_TRUST=1",
309+
"platforms": "none, linux-fedora-32/x86_64-amd/gcc"
310+
},
282311
"smp": {
283312
"cmake": "-DLWS_MAX_SMP=32 -DLWS_WITH_MINIMAL_EXAMPLES=1"
284313
},

3rdparty/libwebsockets/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ set(CPACK_RPM_PACKAGE_LICENSE "MIT")
410410
set(CPACK_PACKAGE_NAME "${PACKAGE}")
411411
set(CPACK_PACKAGE_VERSION_MAJOR "4")
412412
set(CPACK_PACKAGE_VERSION_MINOR "3")
413-
set(CPACK_PACKAGE_VERSION_PATCH_NUMBER "2")
413+
set(CPACK_PACKAGE_VERSION_PATCH_NUMBER "3")
414414

415415
set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH_NUMBER}-${LWS_BUILD_HASH}")
416416
set(CPACK_PACKAGE_RELEASE 1)
@@ -880,7 +880,7 @@ endif()
880880
#
881881
# ZLIB (needed for deflate extension and if LWS_WITH_HTTP_STREAM_COMPRESSION)
882882
#
883-
if (LWS_WITH_ZLIB)
883+
if (LWS_WITH_ZLIB AND NOT LWS_WITH_BUNDLED_ZLIB)
884884
if (NOT ZLIB_FOUND)
885885
if (LWS_WITH_MINIZ)
886886
find_package(Miniz REQUIRED)

3rdparty/libwebsockets/cmake/lws_config.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
#cmakedefine LWS_HAVE_mbedtls_ssl_set_verify
7979
#cmakedefine LWS_HAVE_mbedtls_x509_crt_parse_file
8080
#cmakedefine LWS_HAVE_MBEDTLS_NET_SOCKETS
81+
#cmakedefine LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET
8182
#cmakedefine LWS_HAVE_MBEDTLS_AUTH_KEY_ID
8283
#cmakedefine LWS_HAVE_NEW_UV_VERSION_H
8384
#cmakedefine LWS_HAVE_OPENSSL_ECDH_H

3rdparty/libwebsockets/include/libwebsockets.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ extern "C" {
4141

4242
#include "lws_config.h"
4343

44-
#if defined(LWS_SUPPRESS_DEPRECATED_API_WARNINGS)
45-
#define OPENSSL_USE_DEPRECATED
46-
#endif
47-
4844
/* place for one-shot opaque forward references */
4945

5046
typedef struct lws_context * lws_ctx_t;

3rdparty/libwebsockets/include/libwebsockets/lws-callbacks.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,6 @@ enum lws_callback_reasons {
160160
* the default callback action of returning 0 allows the client
161161
* certificates. */
162162

163-
LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY = 37,
164-
/**< if configured for including OpenSSL support but no private key
165-
* file has been specified (ssl_private_key_filepath is NULL), this is
166-
* called to allow the user to set the private key directly via
167-
* libopenssl and perform further operations if required; this might be
168-
* useful in situations where the private key is not directly accessible
169-
* by the OS, for example if it is stored on a smartcard.
170-
* user is the server's OpenSSL SSL_CTX* */
171-
172163
LWS_CALLBACK_SSL_INFO = 67,
173164
/**< SSL connections only. An event you registered an
174165
* interest in at the vhost has occurred on a connection

3rdparty/libwebsockets/include/libwebsockets/lws-context-vhost.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,15 @@ struct lws_context_creation_info {
390390
*/
391391
const char *ssl_private_key_filepath;
392392
/**< VHOST: filepath to private key if wanting SSL mode;
393-
* if this is set to NULL but ssl_cert_filepath is set, the
394-
* OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY callback is called
395-
* to allow setting of the private key directly via openSSL
396-
* library calls. (For backwards compatibility, this can also be used
393+
* this should not be set to NULL when ssl_cert_filepath is set.
394+
*
395+
* Alteratively, the certificate and private key can both be set in
396+
* the OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS callback directly via
397+
* openSSL library calls. This requires that
398+
* LWS_SERVER_OPTION_CREATE_VHOST_SSL_CTX is set in the vhost info options
399+
* to force initializtion of the SSL_CTX context.
400+
*
401+
* (For backwards compatibility, this can also be used
397402
* to pass the client cert private key filepath when setting up a
398403
* vhost client SSL context, but it is preferred to use
399404
* .client_ssl_private_key_filepath for that.)

3rdparty/libwebsockets/lib/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ if (DEFINED LWS_PLAT_UNIX)
368368
endif()
369369
endif()
370370
set(LWS_HAVE_MBEDTLS_NET_SOCKETS ${LWS_HAVE_MBEDTLS_NET_SOCKETS} PARENT_SCOPE)
371+
set(LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET ${LWS_HAVE_MBEDTLS_SSL_NEW_SESSION_TICKET} PARENT_SCOPE)
372+
set(LWS_HAVE_mbedtls_ssl_conf_alpn_protocols ${LWS_HAVE_mbedtls_ssl_conf_alpn_protocols} PARENT_SCOPE)
371373
set(TEST_SERVER_SSL_KEY "${TEST_SERVER_SSL_KEY}" PARENT_SCOPE)
372374
set(TEST_SERVER_SSL_CERT "${TEST_SERVER_SSL_CERT}" PARENT_SCOPE)
373375
set(TEST_SERVER_DATA ${TEST_SERVER_DATA} PARENT_SCOPE)

3rdparty/libwebsockets/lib/core-net/client/connect3.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,13 @@ lws_client_connect_check(struct lws *wsi, int *real_errno)
105105

106106
#else
107107

108-
if (!connect(wsi->desc.sockfd, (const struct sockaddr *)&wsi->sa46_peer.sa4, 0))
108+
if (!connect(wsi->desc.sockfd, (const struct sockaddr *)&wsi->sa46_peer.sa4,
109+
#if defined(WIN32)
110+
sizeof(struct sockaddr)))
111+
#else
112+
0))
113+
#endif
114+
109115
return LCCCR_CONNECTED;
110116

111117
en = LWS_ERRNO;

3rdparty/libwebsockets/lib/core-net/vhost.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,20 @@ __lws_vhost_destroy2(struct lws_vhost *vh)
14371437

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

1440+
/*
1441+
* remove ourselves from the defer binding list
1442+
*/
1443+
lws_start_foreach_llp(struct lws_vhost **, pv,
1444+
vh->context->no_listener_vhost_list) {
1445+
if (*pv == vh) {
1446+
lwsl_debug("deferred iface: removing vh %s\n",
1447+
(*pv)->name);
1448+
*pv = vh->no_listener_vhost_list;
1449+
vh->no_listener_vhost_list = NULL;
1450+
break;
1451+
}
1452+
} lws_end_foreach_llp(pv, no_listener_vhost_list);
1453+
14401454
/*
14411455
* let the protocols destroy the per-vhost protocol objects
14421456
*/

3rdparty/libwebsockets/lib/core/context.c

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,6 @@ static const char * const opts_str =
327327
#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API)
328328
"SSPROX "
329329
#endif
330-
331-
#if defined(LWS_WITH_MBEDTLS)
332-
"MbedTLS "
333-
#endif
334330
#if defined(LWS_WITH_CONMON)
335331
"ConMon "
336332
#endif
@@ -390,6 +386,9 @@ lws_create_context(const struct lws_context_creation_info *info)
390386
#if defined(LWS_WITH_CACHE_NSCOOKIEJAR) && defined(LWS_WITH_CLIENT)
391387
struct lws_cache_creation_info ci;
392388
#endif
389+
#if defined(LWS_WITH_MBEDTLS)
390+
char mbedtls_version[32];
391+
#endif
393392

394393
#if defined(__ANDROID__)
395394
struct rlimit rt;
@@ -609,6 +608,12 @@ lws_create_context(const struct lws_context_creation_info *info)
609608
goto early_bail;
610609
}
611610

611+
#if defined(LWS_WITH_SYS_STATE)
612+
// NOTE: we need to init this fields because they may be used in logger when context destroying
613+
context->mgr_system.state_names = system_state_names;
614+
context->mgr_system.context = context;
615+
#endif
616+
612617
#if defined(LWS_WITH_NETWORK)
613618
context->event_loop_ops = plev->ops;
614619
context->us_wait_resolution = us_wait_resolution;
@@ -782,7 +787,16 @@ lws_create_context(const struct lws_context_creation_info *info)
782787

783788
#endif /* network */
784789

790+
#if defined(LWS_WITH_MBEDTLS)
791+
mbedtls_version_get_string(mbedtls_version);
792+
#endif
793+
794+
#if defined(LWS_WITH_MBEDTLS)
795+
lwsl_cx_notice(context, "LWS: %s, MbedTLS-%s %s%s", library_version, mbedtls_version, opts_str, s);
796+
#else
785797
lwsl_cx_notice(context, "LWS: %s, %s%s", library_version, opts_str, s);
798+
#endif
799+
786800
#if defined(LWS_WITH_NETWORK)
787801
lwsl_cx_info(context, "Event loop: %s", plev->ops->name);
788802
#endif
@@ -1340,11 +1354,9 @@ lws_create_context(const struct lws_context_creation_info *info)
13401354
* init the lws_state mgr for the system state
13411355
*/
13421356

1343-
context->mgr_system.state_names = system_state_names;
13441357
context->mgr_system.name = "system";
13451358
context->mgr_system.state = LWS_SYSTATE_CONTEXT_CREATED;
13461359
context->mgr_system.parent = context;
1347-
context->mgr_system.context = context;
13481360
#if defined(LWS_WITH_SYS_SMD)
13491361
context->mgr_system.smd_class = LWSSMDCL_SYSTEM_STATE;
13501362
#endif
@@ -1676,9 +1688,9 @@ lws_pt_destroy(struct lws_context_per_thread *pt)
16761688
pt->pipe_wsi = NULL;
16771689
}
16781690

1679-
if (pt->dummy_pipe_fds[0]
1691+
if ((pt->dummy_pipe_fds[0] || pt->dummy_pipe_fds[1])
16801692
#if !defined(WIN32)
1681-
&& (int)pt->dummy_pipe_fds[0] != -1
1693+
&& ((int)pt->dummy_pipe_fds[0] != -1 || (int)pt->dummy_pipe_fds[1] != -1)
16821694
#endif
16831695
) {
16841696
struct lws wsi;

0 commit comments

Comments
 (0)