Skip to content

Commit 57176a6

Browse files
authored
Merge pull request #94 from c-jimenez/release/v1.0.0
Release/v1.0.0
2 parents 0c34e76 + 8516efa commit 57176a6

File tree

713 files changed

+68977
-7391
lines changed

Some content is hidden

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

713 files changed

+68977
-7391
lines changed

.github/workflows/install-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v2
16+
- name: Install dependencies
17+
run: sudo apt-get install -y libev-dev libuv1-dev
1618
- name: make gcc install
1719
run: make BUILD_TYPE=Release INSTALL_PREFIX=/tmp/install-gcc tests-install-gcc-native
1820
- name: make clang install

.vscode/launch.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,28 @@
77
{
88
"type": "gdb",
99
"request": "launch",
10-
"name": "x86 debug",
10+
"name": "x86 CP debug",
1111
"target": "${workspaceRoot}/bin/gcc_native/quick_start_chargepoint",
1212
"cwd": "${workspaceRoot}/bin/gcc_native/",
13-
"arguments": "",
13+
"arguments": "-r",
14+
"valuesFormatting": "parseText"
15+
},
16+
{
17+
"type": "gdb",
18+
"request": "launch",
19+
"name": "x86 CS debug",
20+
"target": "${workspaceRoot}/bin/gcc_native/quick_start_centralsystem",
21+
"cwd": "${workspaceRoot}/bin/gcc_native/",
22+
"arguments": "-r",
1423
"valuesFormatting": "parseText"
1524
},
1625
{
1726
"type": "gdb",
1827
"request": "launch",
1928
"name": "x86 test debug",
20-
"target": "${workspaceRoot}/build_gcc_native/tests/tools/test_logs",
29+
"target": "${workspaceRoot}/build_gcc_native/tests/chargepoint/smartcharging/test_smartcharging_setpoint",
2130
"cwd": "${workspaceRoot}",
2231
"valuesFormatting": "parseText"
2332
}
2433
]
25-
}
34+
}

3rdparty/libwebsockets/CMakeLists-implied-options.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if (LWS_PLAT_OPTEE)
4747
set(LWS_WITH_UDP 0)
4848
endif()
4949

50-
if (LWS_PLAT_FREERTOS)
50+
if (LWS_PLAT_FREERTOS OR (${CMAKE_SYSTEM_NAME} MATCHES "QNX"))
5151
message(STATUS "No LWS_WITH_DIR or LWS_WITH_LEJP_CONF")
5252
set(LWS_WITH_DIR OFF)
5353
set(LWS_WITH_LEJP_CONF OFF)
@@ -101,6 +101,8 @@ if(LWS_WITH_DISTRO_RECOMMENDED)
101101
set(LWS_WITH_PLUGINS_BUILTIN 1) # selfcontained
102102
set(LWS_ROLE_RAW_PROXY 1) # selfcontained
103103
set(LWS_WITH_GENCRYPTO 1) # selfcontained / tls
104+
set(LWS_WITH_CBOR 1) # selfcontained
105+
set(LWS_WITH_COSE 1) # selfcontained
104106
set(LWS_WITH_JOSE 1) # selfcontained
105107
set(LWS_WITH_STRUCT_JSON 1) # selfcontained
106108
set(LWS_WITH_STRUCT_SQLITE3 1) # sqlite3

3rdparty/libwebsockets/CMakeLists.txt

Lines changed: 83 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,39 @@ if (ESP_PLATFORM)
6363
endif()
6464

6565
# it's at this point any toolchain file is brought in
66-
project(libwebsockets C CXX)
66+
project(libwebsockets C)
67+
if (LWS_WITH_SECURE_STREAMS_CPP)
68+
enable_language(CXX)
69+
endif()
6770
include(CTest)
6871

6972
if (ESP_PLATFORM)
7073
include_directories(
71-
${IDF_PATH}/components/freertos/port/xtensa/include/
72-
${IDF_PATH}/components/hal/include
73-
${IDF_PATH}/components/soc/${CONFIG_IDF_TARGET}/include/
74-
${IDF_PATH}/components/soc/include/
75-
${IDF_PATH}/components/esp_hw_support/include
76-
${IDF_PATH}/components/hal/${CONFIG_IDF_TARGET}/include/
77-
)
74+
$ENV{IDF_PATH}/components/esp_hw_support/include/soc/
75+
$ENV{IDF_PATH}/components/freertos/include/
76+
$ENV{IDF_PATH}/components/freertos/esp_additions/include/
77+
$ENV{IDF_PATH}/components/freertos/esp_additions/include/freertos/
78+
$ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/
79+
$ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/portable/linux/include/
80+
$ENV{IDF_PATH}/components/xtensa/${CONFIG_IDF_TARGET}/include/
81+
$ENV{IDF_PATH}/components/freertos/include/esp_additions
82+
$ENV{IDF_PATH}/components/hal/include
83+
$ENV{IDF_PATH}/components/soc/${CONFIG_IDF_TARGET}/include/
84+
$ENV{IDF_PATH}/components/soc/include/
85+
$ENV{IDF_PATH}/components/esp_hw_support/include
86+
$ENV{IDF_PATH}/components/hal/${CONFIG_IDF_TARGET}/include/
87+
)
88+
89+
if (CONFIG_IDF_TARGET_ARCH_RISCV)
90+
include_directories(
91+
$ENV{IDF_PATH}/components/freertos/port/riscv/include
92+
$ENV{IDF_PATH}/components/riscv/include)
93+
else()
94+
include_directories(
95+
$ENV{IDF_PATH}/components/freertos/port/xtensa/include
96+
$ENV{IDF_PATH}/components/xtensa/include)
97+
endif()
98+
7899
endif()
79100

80101

@@ -139,6 +160,8 @@ option(LWS_WITH_SECURE_STREAMS_PROXY_API "Secure Streams support to work across
139160
option(LWS_WITH_SECURE_STREAMS_SYS_AUTH_API_AMAZON_COM "Auth support for api.amazon.com" OFF)
140161
option(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY "Secure Streams Policy is hardcoded only" OFF)
141162
option(LWS_WITH_SECURE_STREAMS_AUTH_SIGV4 "Secure Streams Auth support for AWS Sigv4" OFF)
163+
option(LWS_WITH_SECURE_STREAMS_BUFFER_DUMP "Secure Streams protocol buffer dump" OFF)
164+
option(LWS_WITH_SS_DIRECT_PROTOCOL_STR "Secure Streams directly set/get metadata w/o policy" OFF)
142165

143166
#
144167
# CTest options
@@ -159,11 +182,12 @@ option(LWS_WITH_SSL "Include SSL support (defaults to OpenSSL or similar, mbedTL
159182
option(LWS_WITH_MBEDTLS "Use mbedTLS (>=2.0) replacement for OpenSSL. When setting this, you also may need to specify LWS_MBEDTLS_LIBRARIES and LWS_MBEDTLS_INCLUDE_DIRS" OFF)
160183
option(LWS_WITH_BORINGSSL "Use BoringSSL replacement for OpenSSL" OFF)
161184
option(LWS_WITH_CYASSL "Use CyaSSL replacement for OpenSSL. When setting this, you also need to specify LWS_CYASSL_LIBRARIES and LWS_CYASSL_INCLUDE_DIRS" OFF)
162-
option(LWS_WITH_WOLFSSL "Use wolfSSL replacement for OpenSSL. When setting this, you also need to specify LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS" OFF)
185+
option(LWS_WITH_WOLFSSL "Use wolfSSL replacement for OpenSSL. When setting this, you also may need to specify LWS_WOLFSSL_LIBRARIES and LWS_WOLFSSL_INCLUDE_DIRS" OFF)
163186
option(LWS_SSL_CLIENT_USE_OS_CA_CERTS "SSL support should make use of the OS-installed CA root certs" ON)
164187
option(LWS_TLS_LOG_PLAINTEXT_RX "For debugging log the received plaintext as soon as decrypted" OFF)
165188
option(LWS_TLS_LOG_PLAINTEXT_TX "For debugging log the transmitted plaintext just before encryption" OFF)
166189
option(LWS_WITH_TLS_SESSIONS "Enable persistent, resumable TLS sessions" ON)
190+
option(LWS_WITH_TLS_JIT_TRUST "Enable dynamically computing which trusted TLS CA is needed to be instantiated" OFF)
167191

168192
#
169193
# Event library options (may select multiple, or none for default poll()
@@ -195,7 +219,7 @@ option(LWS_WITH_STATIC "Build the static version of the library" ON)
195219
option(LWS_WITH_SHARED "Build the shared version of the library" ON)
196220
option(LWS_LINK_TESTAPPS_DYNAMIC "Link the test apps to the shared version of the library. Default is to link statically" OFF)
197221
option(LWS_STATIC_PIC "Build the static version of the library with position-independent code" OFF)
198-
option(LWS_SUPPRESS_DEPRECATED_API_WARNINGS "Turn off complaints about, eg, openssl deprecated api usage" OFF)
222+
option(LWS_SUPPRESS_DEPRECATED_API_WARNINGS "Turn off complaints about, eg, openssl 3 deprecated api usage" ON)
199223

200224
#
201225
# Specific platforms
@@ -210,11 +234,11 @@ option(LWS_PLAT_ANDROID "Android flavour of unix platform" OFF)
210234
#
211235
option(LWS_WITHOUT_CLIENT "Don't build the client part of the library" OFF)
212236
option(LWS_WITHOUT_SERVER "Don't build the server part of the library" OFF)
213-
option(LWS_WITHOUT_TESTAPPS "Don't build the libwebsocket-test-apps" ON)
214-
option(LWS_WITHOUT_TEST_SERVER "Don't build the test server" ON)
215-
option(LWS_WITHOUT_TEST_SERVER_EXTPOLL "Don't build the test server version that uses external poll" ON)
216-
option(LWS_WITHOUT_TEST_PING "Don't build the ping test application" ON)
217-
option(LWS_WITHOUT_TEST_CLIENT "Don't build the client test application" ON)
237+
option(LWS_WITHOUT_TESTAPPS "Don't build the libwebsocket-test-apps" OFF)
238+
option(LWS_WITHOUT_TEST_SERVER "Don't build the test server" OFF)
239+
option(LWS_WITHOUT_TEST_SERVER_EXTPOLL "Don't build the test server version that uses external poll" OFF)
240+
option(LWS_WITHOUT_TEST_PING "Don't build the ping test application" OFF)
241+
option(LWS_WITHOUT_TEST_CLIENT "Don't build the client test application" OFF)
218242
#
219243
# Extensions (permessage-deflate)
220244
#
@@ -228,6 +252,8 @@ option(LWS_WITHOUT_BUILTIN_SHA1 "Don't build the lws sha-1 (eg, because openssl
228252
option(LWS_WITHOUT_DAEMONIZE "Don't build the daemonization api" ON)
229253
option(LWS_SSL_SERVER_WITH_ECDH_CERT "Include SSL server use ECDH certificate" OFF)
230254
option(LWS_WITH_LEJP "With the Lightweight JSON Parser" ON)
255+
option(LWS_WITH_CBOR "With the Lightweight LECP CBOR Parser" OFF)
256+
option(LWS_WITH_CBOR_FLOAT "Build floating point types if building CBOR LECP" ON)
231257
option(LWS_WITH_SQLITE3 "Require SQLITE3 support" OFF)
232258
option(LWS_WITH_STRUCT_JSON "Generic struct serialization to and from JSON" OFF)
233259
option(LWS_WITH_STRUCT_SQLITE3 "Generic struct serialization to and from SQLITE3" OFF)
@@ -246,7 +272,8 @@ set(LWS_LOGGING_BITFIELD_CLEAR 0 CACHE STRING "Bitfield describing which log lev
246272
option(LWS_LOGS_TIMESTAMP "Timestamp at start of logs" ON)
247273
option(LWS_LOG_TAG_LIFECYCLE "Log tagged object lifecycle as NOTICE" ON)
248274
option(LWS_AVOID_SIGPIPE_IGN "Android 7+ reportedly needs this" OFF)
249-
option(LWS_WITH_JOSE "JSON Web Signature / Encryption / Keys (RFC7515/6/) API" OFF)
275+
option(LWS_WITH_JOSE "JOSE JSON Web Signature / Encryption / Keys (RFC7515/6/) API" OFF)
276+
option(LWS_WITH_COSE "COSE CBOR Signature / Encryption / Keys (RFC8152) API" OFF)
250277
option(LWS_WITH_GENCRYPTO "Enable support for Generic Crypto apis independent of TLS backend" OFF)
251278
option(LWS_WITH_SELFTESTS "Selftests run at context creation" OFF)
252279
option(LWS_WITH_GCOV "Build with gcc gcov coverage instrumentation" OFF)
@@ -255,13 +282,12 @@ option(LWS_REPRODUCIBLE "Build libwebsockets reproducible. It removes the build
255282
option(LWS_WITH_MINIMAL_EXAMPLES "Also build the normally standalone minimal examples, for QA" OFF)
256283
option(LWS_WITH_LWSAC "lwsac Chunk Allocation api" ON)
257284
option(LWS_WITH_CUSTOM_HEADERS "Store and allow querying custom HTTP headers (H1 only)" ON)
258-
option(LWS_WITH_DISKCACHE "Hashed cache directory with lazy LRU deletion to size limit" OFF)
285+
option(LWS_WITH_DISKCACHE "Hashed cache directory with lazy LRU deletion to size limit (unrelated to lws_cache_ttl)" OFF)
259286
option(LWS_WITH_ASAN "Build with gcc runtime sanitizer options enabled (needs libasan)" OFF)
260287
option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" OFF)
261288
option(LWS_WITH_ZLIB "Include zlib support (required for extensions)" OFF)
262289
option(LWS_WITH_BUNDLED_ZLIB "Use bundled zlib version (Windows only)" ${LWS_WITH_BUNDLED_ZLIB_DEFAULT})
263290
option(LWS_WITH_MINIZ "Use miniz instead of zlib" OFF)
264-
option(LWS_WITH_DEPRECATED_THINGS "Temporary workaround for deprecated apis" OFF)
265291
option(LWS_WITH_SEQUENCER "lws_seq_t support" OFF)
266292
option(LWS_WITH_EXTERNAL_POLL "Support external POLL integration using callback messages (not recommended)" OFF)
267293
option(LWS_WITH_LWS_DSH "Support lws_dsh_t Disordered Shared Heap" OFF)
@@ -275,6 +301,12 @@ option(LWS_HTTP_HEADERS_ALL "Override header reduction optimization and include
275301
option(LWS_WITH_SUL_DEBUGGING "Enable zombie lws_sul checking on object deletion" OFF)
276302
option(LWS_WITH_PLUGINS_API "Build generic lws_plugins apis (see LWS_WITH_PLUGINS to also build protocol plugins)" OFF)
277303
option(LWS_WITH_CONMON "Collect introspectable connection latency stats on individual client connections" ON)
304+
option(LWS_WITHOUT_EVENTFD "Force using pipe instead of eventfd" OFF)
305+
if (UNIX OR WIN32)
306+
option(LWS_WITH_CACHE_NSCOOKIEJAR "Build file-backed lws-cache-ttl that uses netscape cookie jar format (linux-only)" ON)
307+
else()
308+
option(LWS_WITH_CACHE_NSCOOKIEJAR "Build file-backed lws-cache-ttl that uses netscape cookie jar format (linux-only)" OFF)
309+
endif()
278310

279311
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
280312
option(LWS_WITH_NETLINK "Monitor Netlink for Routing Table changes" ON)
@@ -369,12 +401,16 @@ if(GIT_EXECUTABLE)
369401
message("Git commit hash: ${LWS_BUILD_HASH}")
370402
endif()
371403

404+
if ("${LWS_BUILD_HASH}" STREQUAL "")
405+
set(LWS_BUILD_HASH "unknown")
406+
endif()
407+
372408
set(PACKAGE "libwebsockets")
373409
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
374410
set(CPACK_PACKAGE_NAME "${PACKAGE}")
375411
set(CPACK_PACKAGE_VERSION_MAJOR "4")
376-
set(CPACK_PACKAGE_VERSION_MINOR "2")
377-
set(CPACK_PACKAGE_VERSION_PATCH_NUMBER "0")
412+
set(CPACK_PACKAGE_VERSION_MINOR "3")
413+
set(CPACK_PACKAGE_VERSION_PATCH_NUMBER "2")
378414

379415
set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH_NUMBER}-${LWS_BUILD_HASH}")
380416
set(CPACK_PACKAGE_RELEASE 1)
@@ -383,7 +419,7 @@ set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSIO
383419
set(CPACK_PACKAGE_VENDOR "[email protected]")
384420
set(CPACK_PACKAGE_CONTACT "[email protected]")
385421
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE} ${CPACK_PACKAGE_VERSION}")
386-
set(SOVERSION "18")
422+
set(SOVERSION "19")
387423
if(NOT CPACK_GENERATOR)
388424
if(UNIX)
389425
set(CPACK_GENERATOR "TGZ")
@@ -553,7 +589,14 @@ CHECK_FUNCTION_EXISTS(getgrgid_r LWS_HAVE_GETGRGID_R)
553589
CHECK_FUNCTION_EXISTS(getgrnam_r LWS_HAVE_GETGRNAM_R)
554590
CHECK_FUNCTION_EXISTS(getpwuid_r LWS_HAVE_GETPWUID_R)
555591
CHECK_FUNCTION_EXISTS(getpwnam_r LWS_HAVE_GETPWNAM_R)
592+
CHECK_FUNCTION_EXISTS(timegm LWS_HAVE_TIMEGM)
556593

594+
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
595+
if(CMAKE_OSX_DEPLOYMENT_TARGET LESS "10.12")
596+
message("No clock_gettime found on macOS ${CMAKE_OSX_DEPLOYMENT_TARGET}. Disabling LWS_HAVE_CLOCK_GETTIME.")
597+
set(LWS_HAVE_CLOCK_GETTIME 0)
598+
endif()
599+
endif()
557600

558601
if (NOT LWS_HAVE_GETIFADDRS)
559602
if (LWS_WITHOUT_BUILTIN_GETIFADDRS)
@@ -754,11 +797,19 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
754797

755798
# always warn all and generate debug info
756799
if (UNIX AND NOT LWS_PLAT_FREERTOS)
757-
set(CMAKE_C_FLAGS "-Wall -Wconversion -Wsign-compare -Wstrict-aliasing ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}" )
800+
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wconversion -Wsign-compare -Wstrict-aliasing ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS} ${ASAN_FLAGS}" )
758801
else()
759802
set(CMAKE_C_FLAGS "-Wall -Wsign-compare ${VISIBILITY_FLAG} ${GCOV_FLAGS} ${CMAKE_C_FLAGS}" )
760803
endif()
761804

805+
if (PICO_SDK_PATH)
806+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wconversion -Wsign-compare -Wstrict-aliasing -Wundef -nolibc")
807+
endif()
808+
809+
if (ESP_PLATFORM AND (CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2 OR CONFIG_IDF_TARGET_ESP32S3))
810+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlongcalls")
811+
endif()
812+
762813
if ("${DISABLE_WERROR}" STREQUAL "OFF")
763814
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
764815
endif()
@@ -800,6 +851,12 @@ if (MSVC)
800851
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
801852
# Fail the build if any warnings
802853
add_compile_options(/W3 /WX)
854+
# Unbreak MSVC broken preprocessor __VA_ARGS__ behaviour
855+
if (MSVC_VERSION GREATER 1925)
856+
add_compile_options(/Zc:preprocessor /wd5105)
857+
else()
858+
add_compile_options(/experimental:preprocessor /wd5105)
859+
endif()
803860
endif(MSVC)
804861

805862
if (MINGW)
@@ -829,7 +886,7 @@ if (LWS_WITH_ZLIB)
829886
if (NOT ZLIB_FOUND)
830887
if (LWS_WITH_MINIZ)
831888
find_package(Miniz REQUIRED)
832-
set(ZLIB_INCLUDE_DIRS ${MINIZ_INCLUDE_DIRS})
889+
set(ZLIB_INCLUDE_DIRS ${MINIZ_INCLUDE_DIR})
833890
set(ZLIB_LIBRARIES ${MINIZ_LIBRARIES})
834891
else()
835892
find_package(ZLIB REQUIRED)
@@ -1017,6 +1074,9 @@ file(RELATIVE_PATH
10171074
if (DEFINED REL_INCLUDE_DIR)
10181075
set(LWS__INCLUDE_DIRS "\${LWS_CMAKE_DIR}/${REL_INCLUDE_DIR}")
10191076
endif()
1077+
if (DEFINED OPENSSL_INCLUDE_DIRS)
1078+
set(LWS__INCLUDE_DIRS "${LWS__INCLUDE_DIRS};${OPENSSL_INCLUDE_DIRS}")
1079+
endif()
10201080

10211081
configure_file(${PROJECT_SOURCE_DIR}/cmake/libwebsockets-config.cmake.in
10221082
${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/libwebsockets-config.cmake

0 commit comments

Comments
 (0)