From a454dbe3a868006eea075d2a3e5199516534aa3b Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Tue, 3 Oct 2023 12:47:22 -0700 Subject: [PATCH 01/21] Update lws version --- CMake/Dependencies/libwebsockets-CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index 90bec7d553..ed4ebed171 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -30,7 +30,7 @@ endif() ExternalProject_Add(project_libwebsockets GIT_REPOSITORY https://github.com/warmcat/libwebsockets.git - GIT_TAG v4.2.2 + GIT_TAG v4.3.2 PATCH_COMMAND ${PATCH_COMMAND} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build LIST_SEPARATOR | From a0d7913de3e3da512dc24099e9d88f11c38bf3a6 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Tue, 3 Oct 2023 12:54:47 -0700 Subject: [PATCH 02/21] Remove patch --- CMake/Dependencies/libwebsockets-CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index ed4ebed171..0791429078 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.6.3) project(libwebsocket-download NONE) -SET(PATCH_COMMAND git apply --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-leak-pipe-fix.patch) +#SET(PATCH_COMMAND git apply --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-leak-pipe-fix.patch) include(ExternalProject) if (BUILD_STATIC_LIBS) From 8f5bdc000ce541ee81242fa8f11ee3cabe3362ca Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Mon, 16 Oct 2023 12:35:44 -0700 Subject: [PATCH 03/21] Use old gcc patch --- CMake/Dependencies/libwebsockets-CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index 0791429078..17713235eb 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.6.3) project(libwebsocket-download NONE) -#SET(PATCH_COMMAND git apply --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-leak-pipe-fix.patch) +SET(PATCH_COMMAND git apply --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch) include(ExternalProject) if (BUILD_STATIC_LIBS) From e0c58f554202d9a7e29d697fd7e17be859cba61e Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Mon, 16 Oct 2023 13:44:23 -0700 Subject: [PATCH 04/21] Old gcc patch update --- ...ebsockets-old-gcc-fix-cast-cmakelists.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 61e25e8a35..3fba6fe118 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -39,3 +39,21 @@ index b214df75..06eaf255 100644 set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) endif() set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") +diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c +index d149d86752..b319d79f49 100644 +--- a/lib/core/lws_map.c ++++ b/lib/core/lws_map.c +@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { + lws_dll2_owner_t ho; + } lws_map_hashtable_t; + +-typedef struct lws_map { ++struct lws_map { + lws_map_info_t info; + + /* array of info.modulo x lws_map_hashtable_t overallocated */ +-} lws_map_t; ++}; + + typedef struct lws_map_item { + lws_dll2_t list; /* owned by hashtable */ From d3f1f7be42799c1b02a01f127c669e1fd5c447d7 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Mon, 16 Oct 2023 14:41:30 -0700 Subject: [PATCH 05/21] Fix windows patching failure --- .../libwebsockets-old-gcc-fix-cast-cmakelists.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 3fba6fe118..4bf52bb82b 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -40,20 +40,20 @@ index b214df75..06eaf255 100644 endif() set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c -index d149d86752..b319d79f49 100644 +index d149d8675..b319d79f4 100644 --- a/lib/core/lws_map.c +++ b/lib/core/lws_map.c @@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { - lws_dll2_owner_t ho; + lws_dll2_owner_t ho; } lws_map_hashtable_t; -typedef struct lws_map { +struct lws_map { - lws_map_info_t info; + lws_map_info_t info; - /* array of info.modulo x lws_map_hashtable_t overallocated */ + /* array of info.modulo x lws_map_hashtable_t overallocated */ -} lws_map_t; +}; typedef struct lws_map_item { - lws_dll2_t list; /* owned by hashtable */ + lws_dll2_t list; /* owned by hashtable */ From 1c209b945b02abb96447ac1d2bad3e3c9adc62c9 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Mon, 16 Oct 2023 15:29:21 -0700 Subject: [PATCH 06/21] Add verbose logging for patch failure --- CMake/Dependencies/libwebsockets-CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index 17713235eb..01e13ec66e 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.6.3) project(libwebsocket-download NONE) -SET(PATCH_COMMAND git apply --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch) +SET(PATCH_COMMAND git apply --verbose --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch) include(ExternalProject) if (BUILD_STATIC_LIBS) From f1544f9a96a8c387b22c08b4957411d5295f348e Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Mon, 23 Oct 2023 17:48:27 -0700 Subject: [PATCH 07/21] Remove newline in the patch file --- .../libwebsockets-old-gcc-fix-cast-cmakelists.patch | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 4bf52bb82b..47096b2ce9 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -46,14 +46,11 @@ index d149d8675..b319d79f4 100644 @@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { lws_dll2_owner_t ho; } lws_map_hashtable_t; - -typedef struct lws_map { +struct lws_map { lws_map_info_t info; - /* array of info.modulo x lws_map_hashtable_t overallocated */ -} lws_map_t; +}; - typedef struct lws_map_item { - lws_dll2_t list; /* owned by hashtable */ + lws_dll2_t list; /* owned by hashtable */ \ No newline at end of file From 7c67e04c741cabe051df23d3f7464e7ad22ba228 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Mon, 23 Oct 2023 17:56:08 -0700 Subject: [PATCH 08/21] Trying a windows friendly patch file --- ...bsockets-old-gcc-fix-cast-cmakelists.patch | 115 +++++++++--------- 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 47096b2ce9..243906bdf0 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -1,56 +1,59 @@ -diff --git a/lib/roles/h2/hpack.c b/lib/roles/h2/hpack.c -index 68629e6f..6ef628b8 100644 ---- a/lib/roles/h2/hpack.c -+++ b/lib/roles/h2/hpack.c -@@ -1110,7 +1110,7 @@ pre_data: - - for (n = 0; n < 8; n++) { - if (h2n->huff) { -- char b = (c >> 7) & 1; -+ char b = (char)((c >> 7) & 1); - prev = h2n->hpack_pos; - h2n->hpack_pos = (uint16_t)huftable_decode( - (int)h2n->hpack_pos, b); -diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt -index b214df75..06eaf255 100644 ---- a/lib/tls/CMakeLists.txt -+++ b/lib/tls/CMakeLists.txt -@@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL) - endif() - - if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS) -- if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") -+ if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") - else() - if (NOT LWS_PLAT_FREERTOS) -- set(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES}) -+ list(APPEND OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES} ${LWS_OPENSSL_SSL_LIBRARY} ${LWS_OPENSSL_CRYPTO_LIBRARY}) - endif() - set(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS}) - set(OPENSSL_FOUND 1) -@@ -248,7 +248,9 @@ if (LWS_WITH_SSL) - find_package(PkgConfig QUIET) - pkg_check_modules(PC_OPENSSL openssl QUIET) - find_package(OpenSSL REQUIRED) -- list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) -+ if (NOT LWS_WITH_STATIC) -+ list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) -+ endif() - set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) - endif() - set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") -diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c -index d149d8675..b319d79f4 100644 ---- a/lib/core/lws_map.c -+++ b/lib/core/lws_map.c -@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { - lws_dll2_owner_t ho; - } lws_map_hashtable_t; --typedef struct lws_map { -+struct lws_map { - lws_map_info_t info; - /* array of info.modulo x lws_map_hashtable_t overallocated */ --} lws_map_t; -+}; - typedef struct lws_map_item { - lws_dll2_t list; /* owned by hashtable */ \ No newline at end of file +diff --git a/lib/roles/h2/hpack.c b/lib/roles/h2/hpack.c +index 68629e6f..6ef628b8 100644 +--- a/lib/roles/h2/hpack.c ++++ b/lib/roles/h2/hpack.c +@@ -1110,7 +1110,7 @@ pre_data: + + for (n = 0; n < 8; n++) { + if (h2n->huff) { +- char b = (c >> 7) & 1; ++ char b = (char)((c >> 7) & 1); + prev = h2n->hpack_pos; + h2n->hpack_pos = (uint16_t)huftable_decode( + (int)h2n->hpack_pos, b); +diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt +index b214df75..06eaf255 100644 +--- a/lib/tls/CMakeLists.txt ++++ b/lib/tls/CMakeLists.txt +@@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL) + endif() + + if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS) +- if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") ++ if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") + else() + if (NOT LWS_PLAT_FREERTOS) +- set(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES}) ++ list(APPEND OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES} ${LWS_OPENSSL_SSL_LIBRARY} ${LWS_OPENSSL_CRYPTO_LIBRARY}) + endif() + set(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS}) + set(OPENSSL_FOUND 1) +@@ -248,7 +248,9 @@ if (LWS_WITH_SSL) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_OPENSSL openssl QUIET) + find_package(OpenSSL REQUIRED) +- list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) ++ if (NOT LWS_WITH_STATIC) ++ list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) ++ endif() + set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) + endif() + set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") +diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c +index d149d8675..b319d79f4 100644 +--- a/lib/core/lws_map.c ++++ b/lib/core/lws_map.c +@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { + lws_dll2_owner_t ho; + } lws_map_hashtable_t; + +-typedef struct lws_map { ++struct lws_map { + lws_map_info_t info; + + /* array of info.modulo x lws_map_hashtable_t overallocated */ +-} lws_map_t; ++}; + + typedef struct lws_map_item { + lws_dll2_t list; /* owned by hashtable */ From ae665002f32399826ec208d418b4c133cacd87dc Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Mon, 23 Oct 2023 18:20:43 -0700 Subject: [PATCH 09/21] Move to another patch file --- .../Dependencies/libwebsockets-CMakeLists.txt | 2 +- .../libwebsockets-lwsmap-fix.patch | 18 ++++++++++++++ ...bsockets-old-gcc-fix-cast-cmakelists.patch | 24 +++---------------- 3 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 CMake/Dependencies/libwebsockets-lwsmap-fix.patch diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index 01e13ec66e..8fb288e492 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.6.3) project(libwebsocket-download NONE) -SET(PATCH_COMMAND git apply --verbose --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch) +SET(PATCH_COMMAND git apply --verbose --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-lwsmap-fix.patch) include(ExternalProject) if (BUILD_STATIC_LIBS) diff --git a/CMake/Dependencies/libwebsockets-lwsmap-fix.patch b/CMake/Dependencies/libwebsockets-lwsmap-fix.patch new file mode 100644 index 0000000000..cdf14adf4e --- /dev/null +++ b/CMake/Dependencies/libwebsockets-lwsmap-fix.patch @@ -0,0 +1,18 @@ +diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c +index d149d86752..b319d79f49 100644 +--- a/lib/core/lws_map.c ++++ b/lib/core/lws_map.c +@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { + lws_dll2_owner_t ho; + } lws_map_hashtable_t; + +-typedef struct lws_map { ++struct lws_map { + lws_map_info_t info; + + /* array of info.modulo x lws_map_hashtable_t overallocated */ +-} lws_map_t; ++}; + + typedef struct lws_map_item { + lws_dll2_t list; /* owned by hashtable */ \ No newline at end of file diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 243906bdf0..93a65f3288 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -3,7 +3,7 @@ index 68629e6f..6ef628b8 100644 --- a/lib/roles/h2/hpack.c +++ b/lib/roles/h2/hpack.c @@ -1110,7 +1110,7 @@ pre_data: - + for (n = 0; n < 8; n++) { if (h2n->huff) { - char b = (c >> 7) & 1; @@ -17,7 +17,7 @@ index b214df75..06eaf255 100644 +++ b/lib/tls/CMakeLists.txt @@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL) endif() - + if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS) - if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") + if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") @@ -38,22 +38,4 @@ index b214df75..06eaf255 100644 + endif() set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) endif() - set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") -diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c -index d149d8675..b319d79f4 100644 ---- a/lib/core/lws_map.c -+++ b/lib/core/lws_map.c -@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { - lws_dll2_owner_t ho; - } lws_map_hashtable_t; - --typedef struct lws_map { -+struct lws_map { - lws_map_info_t info; - - /* array of info.modulo x lws_map_hashtable_t overallocated */ --} lws_map_t; -+}; - - typedef struct lws_map_item { - lws_dll2_t list; /* owned by hashtable */ + set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") \ No newline at end of file From 665fd881db347d3fc19c9d5892eb133fc4e9388e Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Tue, 24 Oct 2023 10:33:39 -0700 Subject: [PATCH 10/21] Revert "Move to another patch file" This reverts commit d94a3da44226e10164f03d99a26e7eb699459055. --- .../Dependencies/libwebsockets-CMakeLists.txt | 2 +- .../libwebsockets-lwsmap-fix.patch | 18 -------------- ...bsockets-old-gcc-fix-cast-cmakelists.patch | 24 ++++++++++++++++--- 3 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 CMake/Dependencies/libwebsockets-lwsmap-fix.patch diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index 8fb288e492..01e13ec66e 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.6.3) project(libwebsocket-download NONE) -SET(PATCH_COMMAND git apply --verbose --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-lwsmap-fix.patch) +SET(PATCH_COMMAND git apply --verbose --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch) include(ExternalProject) if (BUILD_STATIC_LIBS) diff --git a/CMake/Dependencies/libwebsockets-lwsmap-fix.patch b/CMake/Dependencies/libwebsockets-lwsmap-fix.patch deleted file mode 100644 index cdf14adf4e..0000000000 --- a/CMake/Dependencies/libwebsockets-lwsmap-fix.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c -index d149d86752..b319d79f49 100644 ---- a/lib/core/lws_map.c -+++ b/lib/core/lws_map.c -@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { - lws_dll2_owner_t ho; - } lws_map_hashtable_t; - --typedef struct lws_map { -+struct lws_map { - lws_map_info_t info; - - /* array of info.modulo x lws_map_hashtable_t overallocated */ --} lws_map_t; -+}; - - typedef struct lws_map_item { - lws_dll2_t list; /* owned by hashtable */ \ No newline at end of file diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 93a65f3288..243906bdf0 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -3,7 +3,7 @@ index 68629e6f..6ef628b8 100644 --- a/lib/roles/h2/hpack.c +++ b/lib/roles/h2/hpack.c @@ -1110,7 +1110,7 @@ pre_data: - + for (n = 0; n < 8; n++) { if (h2n->huff) { - char b = (c >> 7) & 1; @@ -17,7 +17,7 @@ index b214df75..06eaf255 100644 +++ b/lib/tls/CMakeLists.txt @@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL) endif() - + if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS) - if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") + if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") @@ -38,4 +38,22 @@ index b214df75..06eaf255 100644 + endif() set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) endif() - set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") \ No newline at end of file + set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") +diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c +index d149d8675..b319d79f4 100644 +--- a/lib/core/lws_map.c ++++ b/lib/core/lws_map.c +@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { + lws_dll2_owner_t ho; + } lws_map_hashtable_t; + +-typedef struct lws_map { ++struct lws_map { + lws_map_info_t info; + + /* array of info.modulo x lws_map_hashtable_t overallocated */ +-} lws_map_t; ++}; + + typedef struct lws_map_item { + lws_dll2_t list; /* owned by hashtable */ From 96e4b50b1045d2eb0cb90d39a1fe49693e9d65e9 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Tue, 24 Oct 2023 10:33:51 -0700 Subject: [PATCH 11/21] Revert "Trying a windows friendly patch file" This reverts commit a6c7de25bfbf756301b17db888ede803fbfd0a8a. --- ...bsockets-old-gcc-fix-cast-cmakelists.patch | 115 +++++++++--------- 1 file changed, 56 insertions(+), 59 deletions(-) diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 243906bdf0..47096b2ce9 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -1,59 +1,56 @@ -diff --git a/lib/roles/h2/hpack.c b/lib/roles/h2/hpack.c -index 68629e6f..6ef628b8 100644 ---- a/lib/roles/h2/hpack.c -+++ b/lib/roles/h2/hpack.c -@@ -1110,7 +1110,7 @@ pre_data: - - for (n = 0; n < 8; n++) { - if (h2n->huff) { -- char b = (c >> 7) & 1; -+ char b = (char)((c >> 7) & 1); - prev = h2n->hpack_pos; - h2n->hpack_pos = (uint16_t)huftable_decode( - (int)h2n->hpack_pos, b); -diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt -index b214df75..06eaf255 100644 ---- a/lib/tls/CMakeLists.txt -+++ b/lib/tls/CMakeLists.txt -@@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL) - endif() - - if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS) -- if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") -+ if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") - else() - if (NOT LWS_PLAT_FREERTOS) -- set(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES}) -+ list(APPEND OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES} ${LWS_OPENSSL_SSL_LIBRARY} ${LWS_OPENSSL_CRYPTO_LIBRARY}) - endif() - set(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS}) - set(OPENSSL_FOUND 1) -@@ -248,7 +248,9 @@ if (LWS_WITH_SSL) - find_package(PkgConfig QUIET) - pkg_check_modules(PC_OPENSSL openssl QUIET) - find_package(OpenSSL REQUIRED) -- list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) -+ if (NOT LWS_WITH_STATIC) -+ list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) -+ endif() - set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) - endif() - set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") -diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c -index d149d8675..b319d79f4 100644 ---- a/lib/core/lws_map.c -+++ b/lib/core/lws_map.c -@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { - lws_dll2_owner_t ho; - } lws_map_hashtable_t; - --typedef struct lws_map { -+struct lws_map { - lws_map_info_t info; - - /* array of info.modulo x lws_map_hashtable_t overallocated */ --} lws_map_t; -+}; - - typedef struct lws_map_item { - lws_dll2_t list; /* owned by hashtable */ +diff --git a/lib/roles/h2/hpack.c b/lib/roles/h2/hpack.c +index 68629e6f..6ef628b8 100644 +--- a/lib/roles/h2/hpack.c ++++ b/lib/roles/h2/hpack.c +@@ -1110,7 +1110,7 @@ pre_data: + + for (n = 0; n < 8; n++) { + if (h2n->huff) { +- char b = (c >> 7) & 1; ++ char b = (char)((c >> 7) & 1); + prev = h2n->hpack_pos; + h2n->hpack_pos = (uint16_t)huftable_decode( + (int)h2n->hpack_pos, b); +diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt +index b214df75..06eaf255 100644 +--- a/lib/tls/CMakeLists.txt ++++ b/lib/tls/CMakeLists.txt +@@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL) + endif() + + if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS) +- if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") ++ if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") + else() + if (NOT LWS_PLAT_FREERTOS) +- set(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES}) ++ list(APPEND OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES} ${LWS_OPENSSL_SSL_LIBRARY} ${LWS_OPENSSL_CRYPTO_LIBRARY}) + endif() + set(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS}) + set(OPENSSL_FOUND 1) +@@ -248,7 +248,9 @@ if (LWS_WITH_SSL) + find_package(PkgConfig QUIET) + pkg_check_modules(PC_OPENSSL openssl QUIET) + find_package(OpenSSL REQUIRED) +- list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) ++ if (NOT LWS_WITH_STATIC) ++ list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) ++ endif() + set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) + endif() + set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") +diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c +index d149d8675..b319d79f4 100644 +--- a/lib/core/lws_map.c ++++ b/lib/core/lws_map.c +@@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { + lws_dll2_owner_t ho; + } lws_map_hashtable_t; +-typedef struct lws_map { ++struct lws_map { + lws_map_info_t info; + /* array of info.modulo x lws_map_hashtable_t overallocated */ +-} lws_map_t; ++}; + typedef struct lws_map_item { + lws_dll2_t list; /* owned by hashtable */ \ No newline at end of file From 976bf554e1f76a07a9184c3f1c58ea1653c343ad Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Tue, 24 Oct 2023 10:34:09 -0700 Subject: [PATCH 12/21] Revert "Remove newline in the patch file" This reverts commit 9e5d47e463271626684b0e0a335d0e2bc00d6e0c. --- .../libwebsockets-old-gcc-fix-cast-cmakelists.patch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 47096b2ce9..4bf52bb82b 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -46,11 +46,14 @@ index d149d8675..b319d79f4 100644 @@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { lws_dll2_owner_t ho; } lws_map_hashtable_t; + -typedef struct lws_map { +struct lws_map { lws_map_info_t info; + /* array of info.modulo x lws_map_hashtable_t overallocated */ -} lws_map_t; +}; + typedef struct lws_map_item { - lws_dll2_t list; /* owned by hashtable */ \ No newline at end of file + lws_dll2_t list; /* owned by hashtable */ From fdd06820d1f92130bf2e124897ee6b5ae40574ad Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Wed, 1 Nov 2023 14:39:11 -0700 Subject: [PATCH 13/21] Windows patch fix --- .../libwebsockets-old-gcc-fix-cast-cmakelists.patch | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index 4bf52bb82b..e90a24662d 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -40,20 +40,21 @@ index b214df75..06eaf255 100644 endif() set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c -index d149d8675..b319d79f4 100644 +index d149d86752..b319d79f49 100644 --- a/lib/core/lws_map.c +++ b/lib/core/lws_map.c @@ -29,11 +29,11 @@ typedef struct lws_map_hashtable { lws_dll2_owner_t ho; } lws_map_hashtable_t; - + -typedef struct lws_map { +struct lws_map { lws_map_info_t info; - + /* array of info.modulo x lws_map_hashtable_t overallocated */ -} lws_map_t; +}; - + typedef struct lws_map_item { lws_dll2_t list; /* owned by hashtable */ + From 94c9b2a3807daf00dc01c083d561a34833b0997c Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Tue, 28 Nov 2023 12:21:21 -0800 Subject: [PATCH 14/21] Update to 4.3.3 --- CMake/Dependencies/libwebsockets-CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index 01e13ec66e..da8c120bc1 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.6.3) project(libwebsocket-download NONE) -SET(PATCH_COMMAND git apply --verbose --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch) - include(ExternalProject) if (BUILD_STATIC_LIBS) set(LWS_WITH_SHARED 0) @@ -30,7 +28,7 @@ endif() ExternalProject_Add(project_libwebsockets GIT_REPOSITORY https://github.com/warmcat/libwebsockets.git - GIT_TAG v4.3.2 + GIT_TAG v4.3.3 PATCH_COMMAND ${PATCH_COMMAND} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build LIST_SEPARATOR | From 3f4248b9f4476d6a40202d3e2894601df0512795 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Tue, 28 Nov 2023 12:38:37 -0800 Subject: [PATCH 15/21] Reintro gcc patch for lws_map --- .../Dependencies/libwebsockets-CMakeLists.txt | 2 ++ ...bsockets-old-gcc-fix-cast-cmakelists.patch | 28 ------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index da8c120bc1..6ce4f28fec 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.6.3) project(libwebsocket-download NONE) +SET(PATCH_COMMAND git apply --verbose --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/libwebsockets-old-gcc-fix-cast-cmakelists.patch) + include(ExternalProject) if (BUILD_STATIC_LIBS) set(LWS_WITH_SHARED 0) diff --git a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch index e90a24662d..6fd33a5bef 100644 --- a/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch +++ b/CMake/Dependencies/libwebsockets-old-gcc-fix-cast-cmakelists.patch @@ -11,34 +11,6 @@ index 68629e6f..6ef628b8 100644 prev = h2n->hpack_pos; h2n->hpack_pos = (uint16_t)huftable_decode( (int)h2n->hpack_pos, b); -diff --git a/lib/tls/CMakeLists.txt b/lib/tls/CMakeLists.txt -index b214df75..06eaf255 100644 ---- a/lib/tls/CMakeLists.txt -+++ b/lib/tls/CMakeLists.txt -@@ -57,10 +57,10 @@ if (LWS_WITH_BORINGSSL) - endif() - - if (LWS_WITH_SSL AND NOT LWS_WITH_WOLFSSL AND NOT LWS_WITH_MBEDTLS) -- if ("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") -+ if (("${LWS_OPENSSL_LIBRARIES}" STREQUAL "" AND ("${LWS_OPENSSL_SSL_LIBRARY}" STREQUAL "" OR "${LWS_OPENSSL_CRYPTO_LIBRARY}" STREQUAL "")) OR "${LWS_OPENSSL_INCLUDE_DIRS}" STREQUAL "") - else() - if (NOT LWS_PLAT_FREERTOS) -- set(OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES}) -+ list(APPEND OPENSSL_LIBRARIES ${LWS_OPENSSL_LIBRARIES} ${LWS_OPENSSL_SSL_LIBRARY} ${LWS_OPENSSL_CRYPTO_LIBRARY}) - endif() - set(OPENSSL_INCLUDE_DIRS ${LWS_OPENSSL_INCLUDE_DIRS}) - set(OPENSSL_FOUND 1) -@@ -248,7 +248,9 @@ if (LWS_WITH_SSL) - find_package(PkgConfig QUIET) - pkg_check_modules(PC_OPENSSL openssl QUIET) - find_package(OpenSSL REQUIRED) -- list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) -+ if (NOT LWS_WITH_STATIC) -+ list(APPEND OPENSSL_LIBRARIES ${PC_OPENSSL_LIBRARIES}) -+ endif() - set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} PARENT_SCOPE) - endif() - set(OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}") diff --git a/lib/core/lws_map.c b/lib/core/lws_map.c index d149d86752..b319d79f49 100644 --- a/lib/core/lws_map.c From 05bc797d14472590bb3692c77347d1df9b20ff86 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Fri, 15 Dec 2023 12:25:44 -0800 Subject: [PATCH 16/21] Rebase develop --- src/source/PeerConnection/Rtcp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/source/PeerConnection/Rtcp.c b/src/source/PeerConnection/Rtcp.c index bbf6e73927..00cb71263a 100644 --- a/src/source/PeerConnection/Rtcp.c +++ b/src/source/PeerConnection/Rtcp.c @@ -340,7 +340,6 @@ STATUS onRtcpPacket(PKvsPeerConnection pKvsPeerConnection, PBYTE pBuff, UINT32 b UINT32 currentOffset = 0; CHK(pKvsPeerConnection != NULL && pBuff != NULL, STATUS_NULL_ARG); - DLOGD("**rtcp**"); while (currentOffset < buffLen) { CHK_STATUS(setRtcpPacketFromBytes(pBuff + currentOffset, buffLen - currentOffset, &rtcpPacket)); From 9f8775f647e996c92d63a48d683adc0efec5b0ab Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Fri, 15 Dec 2023 12:46:27 -0800 Subject: [PATCH 17/21] DTLS API test --- tst/DtlsApiTest.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tst/DtlsApiTest.cpp b/tst/DtlsApiTest.cpp index 161e7608a0..eaf3722aa5 100644 --- a/tst/DtlsApiTest.cpp +++ b/tst/DtlsApiTest.cpp @@ -26,13 +26,14 @@ TEST_F(DtlsApiTest, createCertificateAndKey_Returns_Success) TEST_F(DtlsApiTest, dtlsSessionIsInitFinished_Null_Check) { - PDtlsSession pClient = NULL; + PDtlsSession pClient; BOOL isDtlsConnected = FALSE; DtlsSessionCallbacks callbacks; TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE; EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); - EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(pClient, &isDtlsConnected)); + EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(NULL, &isDtlsConnected)); EXPECT_EQ(FALSE, isDtlsConnected); + EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient)); EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(pClient, NULL)); freeDtlsSession(&pClient); @@ -44,7 +45,7 @@ TEST_F(DtlsApiTest, dtlsSessionIsInitFinished_Null_Check) TEST_F(DtlsApiTest, dtlsSessionCreated_RefCount) { DtlsSessionCallbacks callbacks; - PDtlsSession pClient = NULL; + PDtlsSession pClient; TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE; EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient)); @@ -57,10 +58,10 @@ TEST_F(DtlsApiTest, dtlsSessionCreated_RefCount) TEST_F(DtlsApiTest, dtlsProcessPacket_Api_Check) { DtlsSessionCallbacks callbacks; - PDtlsSession pClient = NULL; + PDtlsSession pClient; INT32 length; TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE; - EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(pClient, NULL, &length)); + EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(NULL, NULL, &length)); EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient)); EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(pClient, NULL, NULL)); From 76b9dcf90b361a8f03275679d8ba3b476e6b70d5 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Fri, 15 Dec 2023 13:17:45 -0800 Subject: [PATCH 18/21] Revert "DTLS API test" This reverts commit 83f104b2bc53305d35fc7ca3e8bfa9a08ebcc924. --- .github/workflows/ci.yml | 2 +- tst/DtlsApiTest.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55b77db60f..5f5cc30799 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -519,7 +519,7 @@ jobs: shell: powershell run: | $env:Path += ';C:\webrtc\open-source\bin;C:\tools\pthreads-w32-2-9-1-release\Pre-built.2\dll\x64;C:\webrtc\build' - & "C:\webrtc\build\tst\webrtc_client_test.exe" --gtest_filter="-DataChannelFunctionalityTest.*:IceApiTest.*:IceFunctionalityTest.*:PeerConnectionFunctionalityTest.*:SignalingApiFunctionalityTest.*:TurnConnectionFunctionalityTest.*:RtpFunctionalityTest.marshallUnmarshallH264Data:RtpFunctionalityTest.packingUnpackingVerifySameH264Frame:RtcpFunctionalityTest.onRtcpPacketCompound:RtcpFunctionalityTest.twcc3" + & "C:\webrtc\build\tst\webrtc_client_test.exe" --gtest_filter="-DataChannelFunctionalityTest.*:DtlsApiTest.dtlsSessionIsInitFinished_Null_Check:IceApiTest.*:IceFunctionalityTest.*:PeerConnectionFunctionalityTest.*:SignalingApiFunctionalityTest.*:TurnConnectionFunctionalityTest.*:RtpFunctionalityTest.marshallUnmarshallH264Data:RtpFunctionalityTest.packingUnpackingVerifySameH264Frame:RtcpFunctionalityTest.onRtcpPacketCompound:RtcpFunctionalityTest.twcc3" # windows-msvc-mbedtls: # runs-on: windows-2022 # env: diff --git a/tst/DtlsApiTest.cpp b/tst/DtlsApiTest.cpp index eaf3722aa5..161e7608a0 100644 --- a/tst/DtlsApiTest.cpp +++ b/tst/DtlsApiTest.cpp @@ -26,14 +26,13 @@ TEST_F(DtlsApiTest, createCertificateAndKey_Returns_Success) TEST_F(DtlsApiTest, dtlsSessionIsInitFinished_Null_Check) { - PDtlsSession pClient; + PDtlsSession pClient = NULL; BOOL isDtlsConnected = FALSE; DtlsSessionCallbacks callbacks; TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE; EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); - EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(NULL, &isDtlsConnected)); + EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(pClient, &isDtlsConnected)); EXPECT_EQ(FALSE, isDtlsConnected); - EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient)); EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionIsInitFinished(pClient, NULL)); freeDtlsSession(&pClient); @@ -45,7 +44,7 @@ TEST_F(DtlsApiTest, dtlsSessionIsInitFinished_Null_Check) TEST_F(DtlsApiTest, dtlsSessionCreated_RefCount) { DtlsSessionCallbacks callbacks; - PDtlsSession pClient; + PDtlsSession pClient = NULL; TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE; EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient)); @@ -58,10 +57,10 @@ TEST_F(DtlsApiTest, dtlsSessionCreated_RefCount) TEST_F(DtlsApiTest, dtlsProcessPacket_Api_Check) { DtlsSessionCallbacks callbacks; - PDtlsSession pClient; + PDtlsSession pClient = NULL; INT32 length; TIMER_QUEUE_HANDLE timerQueueHandle = INVALID_TIMER_QUEUE_HANDLE_VALUE; - EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(NULL, NULL, &length)); + EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(pClient, NULL, &length)); EXPECT_EQ(STATUS_SUCCESS, timerQueueCreate(&timerQueueHandle)); EXPECT_EQ(STATUS_SUCCESS, createDtlsSession(&callbacks, timerQueueHandle, 0, FALSE, NULL, &pClient)); EXPECT_EQ(STATUS_NULL_ARG, dtlsSessionProcessPacket(pClient, NULL, NULL)); From 8ad76abf5d370b74fa7b450a6a40ae72082d36d1 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Fri, 15 Dec 2023 16:10:28 -0800 Subject: [PATCH 19/21] WINDOW_UPDATE failure on mbedtls, enable an option --- .github/workflows/ci.yml | 2 +- src/source/Signaling/Signaling.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f5cc30799..04e5d01d0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -519,7 +519,7 @@ jobs: shell: powershell run: | $env:Path += ';C:\webrtc\open-source\bin;C:\tools\pthreads-w32-2-9-1-release\Pre-built.2\dll\x64;C:\webrtc\build' - & "C:\webrtc\build\tst\webrtc_client_test.exe" --gtest_filter="-DataChannelFunctionalityTest.*:DtlsApiTest.dtlsSessionIsInitFinished_Null_Check:IceApiTest.*:IceFunctionalityTest.*:PeerConnectionFunctionalityTest.*:SignalingApiFunctionalityTest.*:TurnConnectionFunctionalityTest.*:RtpFunctionalityTest.marshallUnmarshallH264Data:RtpFunctionalityTest.packingUnpackingVerifySameH264Frame:RtcpFunctionalityTest.onRtcpPacketCompound:RtcpFunctionalityTest.twcc3" + & "C:\webrtc\build\tst\webrtc_client_test.exe" --gtest_filter="-DataChannelFunctionalityTest.*:DtlsApiTest.*:IceApiTest.*:IceFunctionalityTest.*:PeerConnectionFunctionalityTest.*:SignalingApiFunctionalityTest.*:TurnConnectionFunctionalityTest.*:RtpFunctionalityTest.marshallUnmarshallH264Data:RtpFunctionalityTest.packingUnpackingVerifySameH264Frame:RtcpFunctionalityTest.onRtcpPacketCompound:RtcpFunctionalityTest.twcc3" # windows-msvc-mbedtls: # runs-on: windows-2022 # env: diff --git a/src/source/Signaling/Signaling.c b/src/source/Signaling/Signaling.c index 07165bd288..adfe0532f6 100644 --- a/src/source/Signaling/Signaling.c +++ b/src/source/Signaling/Signaling.c @@ -105,7 +105,7 @@ STATUS createSignalingSync(PSignalingClientInfoInternal pClientInfo, PChannelInf pSignalingClient->currentWsi[PROTOCOL_INDEX_WSS] = NULL; MEMSET(&creationInfo, 0x00, SIZEOF(struct lws_context_creation_info)); - creationInfo.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; + creationInfo.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT | LWS_SERVER_OPTION_H2_JUST_FIX_WINDOW_UPDATE_OVERFLOW; creationInfo.port = CONTEXT_PORT_NO_LISTEN; creationInfo.protocols = pSignalingClient->signalingProtocols; creationInfo.timeout_secs = SIGNALING_SERVICE_API_CALL_TIMEOUT_IN_SECONDS; From eed0b22b1291cf09208d5e23e83415bc8e104778 Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Fri, 15 Dec 2023 16:37:11 -0800 Subject: [PATCH 20/21] Revert to 4.3.2 to check if mbedtls passes there --- CMake/Dependencies/libwebsockets-CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index 6ce4f28fec..01e13ec66e 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -30,7 +30,7 @@ endif() ExternalProject_Add(project_libwebsockets GIT_REPOSITORY https://github.com/warmcat/libwebsockets.git - GIT_TAG v4.3.3 + GIT_TAG v4.3.2 PATCH_COMMAND ${PATCH_COMMAND} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build LIST_SEPARATOR | From 6867374bc4a6b221affe83a1099b48f94a00fd1e Mon Sep 17 00:00:00 2001 From: Divya Sampath Kumar Date: Fri, 15 Dec 2023 18:39:34 -0800 Subject: [PATCH 21/21] Disable alpn --- CMake/Dependencies/libwebsockets-CMakeLists.txt | 2 +- configs/config_mbedtls.h | 2 ++ src/source/Signaling/Signaling.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMake/Dependencies/libwebsockets-CMakeLists.txt b/CMake/Dependencies/libwebsockets-CMakeLists.txt index 01e13ec66e..6ce4f28fec 100644 --- a/CMake/Dependencies/libwebsockets-CMakeLists.txt +++ b/CMake/Dependencies/libwebsockets-CMakeLists.txt @@ -30,7 +30,7 @@ endif() ExternalProject_Add(project_libwebsockets GIT_REPOSITORY https://github.com/warmcat/libwebsockets.git - GIT_TAG v4.3.2 + GIT_TAG v4.3.3 PATCH_COMMAND ${PATCH_COMMAND} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build LIST_SEPARATOR | diff --git a/configs/config_mbedtls.h b/configs/config_mbedtls.h index 52cc0ab10f..a642be21dc 100644 --- a/configs/config_mbedtls.h +++ b/configs/config_mbedtls.h @@ -19,6 +19,8 @@ extern "C" { #undef MBEDTLS_ECP_DP_SECP224K1_ENABLED #undef MBEDTLS_ECP_DP_SECP256K1_ENABLED +#undef MBEDTLS_SSL_ALPN + /** * \def MBEDTLS_ENTROPY_HARDWARE_ALT * diff --git a/src/source/Signaling/Signaling.c b/src/source/Signaling/Signaling.c index adfe0532f6..07165bd288 100644 --- a/src/source/Signaling/Signaling.c +++ b/src/source/Signaling/Signaling.c @@ -105,7 +105,7 @@ STATUS createSignalingSync(PSignalingClientInfoInternal pClientInfo, PChannelInf pSignalingClient->currentWsi[PROTOCOL_INDEX_WSS] = NULL; MEMSET(&creationInfo, 0x00, SIZEOF(struct lws_context_creation_info)); - creationInfo.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT | LWS_SERVER_OPTION_H2_JUST_FIX_WINDOW_UPDATE_OVERFLOW; + creationInfo.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; creationInfo.port = CONTEXT_PORT_NO_LISTEN; creationInfo.protocols = pSignalingClient->signalingProtocols; creationInfo.timeout_secs = SIGNALING_SERVICE_API_CALL_TIMEOUT_IN_SECONDS;