From 200c2762afdb9a89d87501b9177b284f6066f654 Mon Sep 17 00:00:00 2001 From: Tom Sanfilippo Date: Mon, 8 Mar 2021 16:25:00 -0500 Subject: [PATCH 01/16] deps/json update for compat with qt vs2017 builds --- deps/json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/json b/deps/json index 973c52dd4..e220ab89e 160000 --- a/deps/json +++ b/deps/json @@ -1 +1 @@ -Subproject commit 973c52dd4a9e92ede5ca4afe8b3d01ef677dc57f +Subproject commit e220ab89e5119f12e5aa25b85f4f55123db5aeeb From bd918eaf67e5e4c121faae5c1cd0c5be3b7721bd Mon Sep 17 00:00:00 2001 From: Tom Sanfilippo Date: Mon, 8 Mar 2021 17:30:48 -0500 Subject: [PATCH 02/16] add websocket support for custom headers --- include/rtc/websocket.hpp | 1 + src/websocket.cpp | 1 + src/wstransport.cpp | 14 +++++++++++--- src/wstransport.hpp | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/rtc/websocket.hpp b/include/rtc/websocket.hpp index 328bafd64..311f04324 100644 --- a/include/rtc/websocket.hpp +++ b/include/rtc/websocket.hpp @@ -51,6 +51,7 @@ class RTC_CPP_EXPORT WebSocket final : public Channel, struct Configuration { bool disableTlsVerification = false; // if true, don't verify the TLS certificate std::vector protocols; + std::vector headers; }; WebSocket(std::optional config = nullopt); diff --git a/src/websocket.cpp b/src/websocket.cpp index 454a2b9c7..8a8c89755 100644 --- a/src/websocket.cpp +++ b/src/websocket.cpp @@ -296,6 +296,7 @@ shared_ptr WebSocket::initWsTransport() { wsConfig.host = mHost; wsConfig.path = mPath; wsConfig.protocols = mConfig.protocols; + wsConfig.headers = mConfig.headers; auto transport = std::make_shared( lower, wsConfig, weak_bind(&WebSocket::incoming, this, _1), diff --git a/src/wstransport.cpp b/src/wstransport.cpp index 527dee994..263a3a16f 100644 --- a/src/wstransport.cpp +++ b/src/wstransport.cpp @@ -165,9 +165,9 @@ bool WsTransport::sendHttpRequest() { auto k = reinterpret_cast(key.data()); std::generate(k, k + key.size(), [&]() { return uint8_t(generator()); }); - string appendHeader = ""; + string appendHeaders = ""; if (mConfig.protocols.size() > 0) { - appendHeader += + appendHeaders += "Sec-WebSocket-Protocol: " + std::accumulate(mConfig.protocols.begin(), mConfig.protocols.end(), string(), [](const string &a, const string &b) -> string { @@ -175,6 +175,14 @@ bool WsTransport::sendHttpRequest() { }) + "\r\n"; } + if (mConfig.headers.size() > 0) { + appendHeaders += + std::accumulate(mConfig.headers.begin(), mConfig.headers.end(), string(), + [](const string &a, const string &b) -> string { + return a + (a.length() > 0 ? "\r\n" : "") + b; + }) + + "\r\n"; + } const string request = "GET " + mConfig.path + " HTTP/1.1\r\n" @@ -185,7 +193,7 @@ bool WsTransport::sendHttpRequest() { "Upgrade: websocket\r\n" "Sec-WebSocket-Version: 13\r\n" "Sec-WebSocket-Key: " + - to_base64(key) + "\r\n" + std::move(appendHeader) + "\r\n"; + to_base64(key) + "\r\n" + std::move(appendHeaders) + "\r\n"; auto data = reinterpret_cast(request.data()); auto size = request.size(); diff --git a/src/wstransport.hpp b/src/wstransport.hpp index 0f80dee52..b9ac944b4 100644 --- a/src/wstransport.hpp +++ b/src/wstransport.hpp @@ -35,6 +35,7 @@ class WsTransport : public Transport { string host; string path = "/"; std::vector protocols; + std::vector headers; }; WsTransport(std::shared_ptr lower, Configuration config, From 2433d0edec83a2b4f082bcd692103429a05d9822 Mon Sep 17 00:00:00 2001 From: Tom Sanfilippo Date: Mon, 8 Mar 2021 19:08:16 -0500 Subject: [PATCH 03/16] add SSLKEYLOGFILE env var support --- src/dtlstransport.cpp | 28 ++++++++++++++++++++++++++++ src/tlstransport.cpp | 3 +++ 2 files changed, 31 insertions(+) diff --git a/src/dtlstransport.cpp b/src/dtlstransport.cpp index d11322f35..940530c97 100644 --- a/src/dtlstransport.cpp +++ b/src/dtlstransport.cpp @@ -313,6 +313,33 @@ void DtlsTransport::Cleanup() { // Nothing to do } +#define FIRSTLINE "# SSL key logfile generated by libdatachannel\n" +#define FIRSTLINE_LEN (sizeof(FIRSTLINE) - 1) + +static int keylog_file_fd = -1; + +static void init_keylog_file(void) { + if (keylog_file_fd >= 0) + return; + + const char *filename = getenv("SSLKEYLOGFILE"); + if (filename) { + keylog_file_fd = _open(filename, O_WRONLY | O_APPEND | O_CREAT, 0644); + if (keylog_file_fd >= 0 && _lseek(keylog_file_fd, 0, SEEK_END) == 0) { + /* file is opened successfully and there is no data (pos == 0) */ + _write(keylog_file_fd, FIRSTLINE, FIRSTLINE_LEN); + } + } +} + +void keylog_callback(const SSL *ssl, const char *line) { + init_keylog_file(); + if (keylog_file_fd >= 0) { + _write(keylog_file_fd, line, static_cast(strlen(line))); + _write(keylog_file_fd, "\n", 1); + } +} + DtlsTransport::DtlsTransport(shared_ptr lower, shared_ptr certificate, verifier_callback verifierCallback, state_callback stateChangeCallback) : Transport(lower, std::move(stateChangeCallback)), mCertificate(certificate), @@ -325,6 +352,7 @@ DtlsTransport::DtlsTransport(shared_ptr lower, shared_ptr lower, string host, state_callback callback) : Transport(lower, std::move(callback)), mHost(std::move(host)) { @@ -267,6 +269,7 @@ TlsTransport::TlsTransport(shared_ptr lower, string host, state_ca if (!(mCtx = SSL_CTX_new(SSLv23_method()))) // version-flexible throw std::runtime_error("Failed to create SSL context"); + SSL_CTX_set_keylog_callback(mCtx, keylog_callback); openssl::check(SSL_CTX_set_cipher_list(mCtx, "ALL:!LOW:!EXP:!RC4:!MD5:@STRENGTH"), "Failed to set SSL priorities"); From fed94fca41233d5471aa129e2906ced253ca3bbc Mon Sep 17 00:00:00 2001 From: Tom Sanfilippo Date: Mon, 8 Mar 2021 19:53:28 -0500 Subject: [PATCH 04/16] add scripts for copy to qt-shared --- scripts/copy_build_win_to_qt-shared.bat | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/copy_build_win_to_qt-shared.bat diff --git a/scripts/copy_build_win_to_qt-shared.bat b/scripts/copy_build_win_to_qt-shared.bat new file mode 100644 index 000000000..a6a8b51ad --- /dev/null +++ b/scripts/copy_build_win_to_qt-shared.bat @@ -0,0 +1,13 @@ +rem run from scripts dir +if "%PS_QT%"=="" set PS_QT=C:\PS_QT +xcopy /s /y ..\include %PS_QT%\qt-shared\libs\libdatachannel\include\ +xcopy /s /y ..\deps\json\single_include %PS_QT%\qt-shared\libs\libdatachannel\deps\json\single_include\ +xcopy /s /y ..\deps\plog\include %PS_QT%\qt-shared\libs\libdatachannel\deps\plog\include\ + +xcopy /y ..\..\libdatachannel_build_debug_static_openssl_debug\datachannel.dll %PS_QT%\qt-shared\libs\libdatachannel\build\win\debug\ +xcopy /y ..\..\libdatachannel_build_debug_static_openssl_debug\datachannel.lib %PS_QT%\qt-shared\libs\libdatachannel\build\win\debug\ +xcopy /y ..\..\libdatachannel_build_debug_static_openssl_debug\datachannel.pdb %PS_QT%\qt-shared\libs\libdatachannel\build\win\debug\ +. +xcopy /y ..\..\libdatachannel_build_relsym_static_openssl\datachannel.dll %PS_QT%\qt-shared\libs\libdatachannel\build\win\release\ +xcopy /y ..\..\libdatachannel_build_relsym_static_openssl\datachannel.lib %PS_QT%\qt-shared\libs\libdatachannel\build\win\release\ +xcopy /y ..\..\libdatachannel_build_relsym_static_openssl\datachannel.pdb %PS_QT%\qt-shared\libs\libdatachannel\build\win\release\ From 14436309f2366e286f11a9c60ef84d47f05edf6f Mon Sep 17 00:00:00 2001 From: Tom Sanfilippo Date: Mon, 8 Mar 2021 22:11:17 -0500 Subject: [PATCH 05/16] fix portability issues --- src/dtlstransport.cpp | 17 +++++++++++++++-- src/tlstransport.cpp | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/dtlstransport.cpp b/src/dtlstransport.cpp index 940530c97..a5fe69468 100644 --- a/src/dtlstransport.cpp +++ b/src/dtlstransport.cpp @@ -324,19 +324,32 @@ static void init_keylog_file(void) { const char *filename = getenv("SSLKEYLOGFILE"); if (filename) { +#ifdef _WIN32 keylog_file_fd = _open(filename, O_WRONLY | O_APPEND | O_CREAT, 0644); if (keylog_file_fd >= 0 && _lseek(keylog_file_fd, 0, SEEK_END) == 0) { /* file is opened successfully and there is no data (pos == 0) */ _write(keylog_file_fd, FIRSTLINE, FIRSTLINE_LEN); } +#else + keylog_file_fd = open(filename, O_WRONLY | O_APPEND | O_CREAT, 0644); + if (keylog_file_fd >= 0 && lseek(keylog_file_fd, 0, SEEK_END) == 0) { + /* file is opened successfully and there is no data (pos == 0) */ + write(keylog_file_fd, FIRSTLINE, FIRSTLINE_LEN); + } +#endif } } -void keylog_callback(const SSL *ssl, const char *line) { +void keylog_callback(const SSL *, const char *line) { init_keylog_file(); if (keylog_file_fd >= 0) { +#ifdef _WIN32 _write(keylog_file_fd, line, static_cast(strlen(line))); _write(keylog_file_fd, "\n", 1); +#else + write(keylog_file_fd, line, static_cast(strlen(line))); + write(keylog_file_fd, "\n", 1); +#endif } } @@ -352,7 +365,7 @@ DtlsTransport::DtlsTransport(shared_ptr lower, shared_ptr lower, string host, state_callback callback) : Transport(lower, std::move(callback)), mHost(std::move(host)) { @@ -269,7 +269,7 @@ TlsTransport::TlsTransport(shared_ptr lower, string host, state_ca if (!(mCtx = SSL_CTX_new(SSLv23_method()))) // version-flexible throw std::runtime_error("Failed to create SSL context"); - SSL_CTX_set_keylog_callback(mCtx, keylog_callback); + SSL_CTX_set_keylog_callback(mCtx, keylog_callback); openssl::check(SSL_CTX_set_cipher_list(mCtx, "ALL:!LOW:!EXP:!RC4:!MD5:@STRENGTH"), "Failed to set SSL priorities"); From 41a3552e2606b8fd53793ba448f886e35fd812ad Mon Sep 17 00:00:00 2001 From: Tom Sanfilippo Date: Mon, 8 Mar 2021 22:12:00 -0500 Subject: [PATCH 06/16] script for copy of linux build to qt-shared --- scripts/copy_build_linux_to_qt-shared.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 scripts/copy_build_linux_to_qt-shared.sh diff --git a/scripts/copy_build_linux_to_qt-shared.sh b/scripts/copy_build_linux_to_qt-shared.sh new file mode 100755 index 000000000..4867adfe5 --- /dev/null +++ b/scripts/copy_build_linux_to_qt-shared.sh @@ -0,0 +1,10 @@ +#/usr/bin/env bash +PS_QT=/mnt/c/ps +mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release +cp ../../libdatachannel_build_linux_relsym_with_static_openssl/libdatachannel.so.0.11.4 ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release/ +rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release/libdatachannel.so +ln -rs ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release/libdatachannel.so.0.11.4 ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release/libdatachannel.so +mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/debug +cp ../../libdatachannel_build_linux_debug_with_static_openssl/libdatachannel.so.0.11.4 ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/debug/ +rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/debug/libdatachannel.so +ln -rs ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/debug/libdatachannel.so.0.11.4 ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/debug/libdatachannel.so From a7444c1cadb44ffb53bb144aa8f85a61c3c806ad Mon Sep 17 00:00:00 2001 From: Tom Sanfilippo Date: Mon, 8 Mar 2021 23:08:43 -0500 Subject: [PATCH 07/16] add build script for linux, allow override of copy path --- scripts/build_linux.sh | 21 +++++++++++++++++++++ scripts/copy_build_linux_to_qt-shared.sh | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 scripts/build_linux.sh diff --git a/scripts/build_linux.sh b/scripts/build_linux.sh new file mode 100755 index 000000000..32e78c048 --- /dev/null +++ b/scripts/build_linux.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -e + +# in libdatachannel/scripts directory + +cd ../../libdatachannel +cmake -B ../libdatachannel_build_linux_debug_with_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug +cd ../libdatachannel_build_linux_debug_with_static_openssl +make +./tests + +cd ../libdatachannel +cmake -B ../libdatachannel_build_linux_relsym_with_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=RelWithDebInfo +cd ../libdatachannel_build_linux_relsym_with_static_openssl/ +make +./tests + +cd ../libdatachannel/scripts + +# copy builds to qt-shared +#./copy_build_linux_to_qt-shared.sh diff --git a/scripts/copy_build_linux_to_qt-shared.sh b/scripts/copy_build_linux_to_qt-shared.sh index 4867adfe5..314618aaf 100755 --- a/scripts/copy_build_linux_to_qt-shared.sh +++ b/scripts/copy_build_linux_to_qt-shared.sh @@ -1,5 +1,5 @@ #/usr/bin/env bash -PS_QT=/mnt/c/ps +PS_QT="${PS_QT:-/mnt/c/ps}" mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release cp ../../libdatachannel_build_linux_relsym_with_static_openssl/libdatachannel.so.0.11.4 ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release/ rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release/libdatachannel.so From c5a5b07b22a1ef3b46694195a76d29f3ce00ab64 Mon Sep 17 00:00:00 2001 From: Tom Sanfilippo Date: Tue, 9 Mar 2021 00:06:20 -0500 Subject: [PATCH 08/16] add win build script, add override for qt-shared path --- .gitignore | 2 +- scripts/build_win.bat | 44 +++++++++++++++++++++++++ scripts/copy_build_win_to_qt-shared.bat | 4 +-- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 scripts/build_win.bat diff --git a/.gitignore b/.gitignore index 2ecbab1ef..083a9fac6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ compile_commands.json /tests .DS_Store .idea - +.vs diff --git a/scripts/build_win.bat b/scripts/build_win.bat new file mode 100644 index 000000000..def1ba74a --- /dev/null +++ b/scripts/build_win.bat @@ -0,0 +1,44 @@ +rem run from libdatachannel scripts dir + +rem NOTE: REQUIRES OPENSSL 1.1.1i debug and release builds and install locations + +set SAVED_PATH=%PATH% +set SAVED_OPENSSL_ROOT_DIR=%OPENSSL_ROOT_DIR% + +rem build debug with openssl static debug + +pushd ..\..\libdatachannel + +set OPENSSL_ROOT_DIR=C:\openssl\openssl_1.1.1i-debug +set PATH=C:\openssl\openssl_1.1.1i-debug\bin;%SAVED_PATH% + +rem checks: +rem dir C:\openssl\openssl_1.1.1i-debug\lib\libssl_static.lib +rem dir C:\openssl\openssl_1.1.1i-debug\lib\libcrypto_static.lib + +cmake -B ..\libdatachannel_build_debug_static_openssl_debug -G "NMake Makefiles" -D OPENSSL_USE_STATIC_LIBS=TRUE -D CMAKE_BUILD_TYPE=Debug +pushd ..\libdatachannel_build_debug_static_openssl_debug +nmake +tests + +rem build relsym with openssl static + +popd + +set OPENSSL_ROOT_DIR=C:\Program^ Files\OpenSSL +set PATH=C:\Program^ Files\OpenSSL\bin;%SAVED_PATH% + +rem checks: +rem dir C:\Program^ Files\OpenSSL\lib\libssl_static.lib +rem dir C:\Program^ Files\OpenSSL\lib\libcrypto_static.lib + +cmake -B ..\libdatachannel_build_relsym_static_openssl -G "NMake Makefiles" -D OPENSSL_USE_STATIC_LIBS=TRUE -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /O2 /Ob2 /DNDEBUG /Zi /Gy" -D CMAKE_SHARED_LINKER_FLAGS="/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF" +pushd ..\libdatachannel_build_relsym_static_openssl +nmake +tests + +set PATH=%SAVED_PATH% +set OPENSSL_ROOT_DIR=%SAVED_OPENSSL_ROOT_DIR% + +popd +popd diff --git a/scripts/copy_build_win_to_qt-shared.bat b/scripts/copy_build_win_to_qt-shared.bat index a6a8b51ad..8025824f3 100644 --- a/scripts/copy_build_win_to_qt-shared.bat +++ b/scripts/copy_build_win_to_qt-shared.bat @@ -1,5 +1,5 @@ rem run from scripts dir -if "%PS_QT%"=="" set PS_QT=C:\PS_QT +if "%PS_QT%"=="" set PS_QT=C:\ps xcopy /s /y ..\include %PS_QT%\qt-shared\libs\libdatachannel\include\ xcopy /s /y ..\deps\json\single_include %PS_QT%\qt-shared\libs\libdatachannel\deps\json\single_include\ xcopy /s /y ..\deps\plog\include %PS_QT%\qt-shared\libs\libdatachannel\deps\plog\include\ @@ -7,7 +7,7 @@ xcopy /s /y ..\deps\plog\include %PS_QT%\qt-shared\libs\libdatachannel\deps\plog xcopy /y ..\..\libdatachannel_build_debug_static_openssl_debug\datachannel.dll %PS_QT%\qt-shared\libs\libdatachannel\build\win\debug\ xcopy /y ..\..\libdatachannel_build_debug_static_openssl_debug\datachannel.lib %PS_QT%\qt-shared\libs\libdatachannel\build\win\debug\ xcopy /y ..\..\libdatachannel_build_debug_static_openssl_debug\datachannel.pdb %PS_QT%\qt-shared\libs\libdatachannel\build\win\debug\ -. + xcopy /y ..\..\libdatachannel_build_relsym_static_openssl\datachannel.dll %PS_QT%\qt-shared\libs\libdatachannel\build\win\release\ xcopy /y ..\..\libdatachannel_build_relsym_static_openssl\datachannel.lib %PS_QT%\qt-shared\libs\libdatachannel\build\win\release\ xcopy /y ..\..\libdatachannel_build_relsym_static_openssl\datachannel.pdb %PS_QT%\qt-shared\libs\libdatachannel\build\win\release\ From f19202009f1699f6c3029ce9a520f743dbb53d09 Mon Sep 17 00:00:00 2001 From: sanfilip Date: Tue, 9 Mar 2021 03:07:28 -0500 Subject: [PATCH 09/16] add mac build and copy scripts --- scripts/build_mac.sh | 23 +++++++++++++++++++++++ scripts/copy_build_mac_to_qt-shared.sh | 14 ++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 scripts/build_mac.sh create mode 100755 scripts/copy_build_mac_to_qt-shared.sh diff --git a/scripts/build_mac.sh b/scripts/build_mac.sh new file mode 100755 index 000000000..53a80d265 --- /dev/null +++ b/scripts/build_mac.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -e + +# in libdatachannel/scripts directory + +cd ../../libdatachannel + +cmake -B ../libdatachannel_build_mac_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -G Xcode -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl@1.1/1.1.1h/ + +cd ../libdatachannel_build_mac_static_openssl + +# requires xcode 11.7 + +xcodebuild -scheme ALL_BUILD -configuration Debug +./Debug/tests + +xcodebuild -scheme ALL_BUILD -configuration RelWithDebInfo +./RelWithDebInfo/tests + +cd ../libdatachannel/scripts + +# copy build to qt-shared +#./copy_build_mac_to_qt-shared.sh diff --git a/scripts/copy_build_mac_to_qt-shared.sh b/scripts/copy_build_mac_to_qt-shared.sh new file mode 100755 index 000000000..9b76ffc71 --- /dev/null +++ b/scripts/copy_build_mac_to_qt-shared.sh @@ -0,0 +1,14 @@ +#/usr/bin/env bash +set -e + +PS_QT="${PS_QT:-$(pwd)/../../PS_QTNativeApp}" + +mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release +rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release/*.dylib +cp -a ../../libdatachannel_build_mac_static_openssl/RelWithDebInfo/*.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release/ +install_name_tool -id @rpath/libdatachannel.0.11.4.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release/libdatachannel.0.11.4.dylib + +mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug +rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/debug/*.dylib +cp -a ../../libdatachannel_build_mac_static_openssl/Debug/*.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug/ +install_name_tool -id @rpath/libdatachannel.0.11.4.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug/libdatachannel.0.11.4.dylib From d2d7096bffcd02ecf27876831ff10085b3b07767 Mon Sep 17 00:00:00 2001 From: benjamin Date: Thu, 22 Apr 2021 15:37:56 -0400 Subject: [PATCH 10/16] linux build scripts --- scripts/build_linux_debug.sh | 11 +++++++++++ scripts/build_linux_release.sh | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100755 scripts/build_linux_debug.sh create mode 100755 scripts/build_linux_release.sh diff --git a/scripts/build_linux_debug.sh b/scripts/build_linux_debug.sh new file mode 100755 index 000000000..aef8d982e --- /dev/null +++ b/scripts/build_linux_debug.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e + +# in libdatachannel/scripts directory + +cd .. +OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18/ cmake -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug +make + + + diff --git a/scripts/build_linux_release.sh b/scripts/build_linux_release.sh new file mode 100755 index 000000000..3f55305d4 --- /dev/null +++ b/scripts/build_linux_release.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -e + +# in libdatachannel/scripts directory + + +cd .. +OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18/ cmake -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=RelWithDebInfo +make + From 22f2340bfc5a9ff148be2289e614991f690ae8b5 Mon Sep 17 00:00:00 2001 From: benjamin Date: Wed, 28 Apr 2021 11:11:06 -0400 Subject: [PATCH 11/16] static build changes for linux --- CMakeLists.txt | 2 +- scripts/build_linux_debug.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f4a5b99d..0bb79a0be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,7 +352,7 @@ if(NOT NO_TESTS) CXX_STANDARD 17) set_target_properties(datachannel-tests PROPERTIES OUTPUT_NAME tests) target_include_directories(datachannel-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) - target_link_libraries(datachannel-tests datachannel) + target_link_libraries(datachannel-tests datachannel-static) # Benchmark if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") diff --git a/scripts/build_linux_debug.sh b/scripts/build_linux_debug.sh index aef8d982e..c2415c42f 100755 --- a/scripts/build_linux_debug.sh +++ b/scripts/build_linux_debug.sh @@ -4,8 +4,9 @@ set -e # in libdatachannel/scripts directory cd .. -OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18/ cmake -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug -make +OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18d/ cmake -B ../libdatachannel_build_linux_debug_with_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug +cd ../libdatachannel_build_linux_debug_with_static_openssl +make From 98f651a9ce2771c2f39c7897ee7dcbf5eeecff43 Mon Sep 17 00:00:00 2001 From: benjamin Date: Wed, 28 Apr 2021 12:18:41 -0400 Subject: [PATCH 12/16] build script changes --- scripts/build_linux_debug.sh | 2 +- scripts/build_linux_release.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/build_linux_debug.sh b/scripts/build_linux_debug.sh index c2415c42f..dfc39f8f7 100755 --- a/scripts/build_linux_debug.sh +++ b/scripts/build_linux_debug.sh @@ -5,7 +5,7 @@ set -e cd .. -OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18d/ cmake -B ../libdatachannel_build_linux_debug_with_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug +OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18/ cmake -B ../libdatachannel_build_linux_debug_with_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug cd ../libdatachannel_build_linux_debug_with_static_openssl make diff --git a/scripts/build_linux_release.sh b/scripts/build_linux_release.sh index 3f55305d4..9ce4b1afe 100755 --- a/scripts/build_linux_release.sh +++ b/scripts/build_linux_release.sh @@ -4,7 +4,12 @@ set -e # in libdatachannel/scripts directory + + cd .. -OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18/ cmake -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=RelWithDebInfo + +OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18/ cmake -B ../libdatachannel_build_linux_relsym_with_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=RelWithDebInfo + +cd ../libdatachannel_build_linux_relsym_with_static_openssl make From bdddb0a9a7c67ed3240117e492247cf5a41c2d6f Mon Sep 17 00:00:00 2001 From: sanfilip Date: Fri, 7 May 2021 17:08:03 -0400 Subject: [PATCH 13/16] fix up mac build scripts for openssl build included in PS_OPENSSL --- scripts/build_mac.sh | 19 ++++++++++------ scripts/build_mac_xcode.sh | 23 ++++++++++++++++++++ scripts/copy_build_mac_to_qt-shared.sh | 10 ++++----- scripts/copy_build_mac_to_qtdatachan.sh | 14 ++++++++++++ scripts/copy_build_mac_xcode_to_qt-shared.sh | 14 ++++++++++++ scripts/copy_includes_to_qt-shared.sh | 15 +++++++++++++ scripts/copy_includes_to_qtdatachan.sh | 15 +++++++++++++ 7 files changed, 98 insertions(+), 12 deletions(-) create mode 100755 scripts/build_mac_xcode.sh create mode 100755 scripts/copy_build_mac_to_qtdatachan.sh create mode 100755 scripts/copy_build_mac_xcode_to_qt-shared.sh create mode 100755 scripts/copy_includes_to_qt-shared.sh create mode 100755 scripts/copy_includes_to_qtdatachan.sh diff --git a/scripts/build_mac.sh b/scripts/build_mac.sh index 53a80d265..47e7daaa1 100755 --- a/scripts/build_mac.sh +++ b/scripts/build_mac.sh @@ -5,17 +5,22 @@ set -e cd ../../libdatachannel -cmake -B ../libdatachannel_build_mac_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -G Xcode -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl@1.1/1.1.1h/ +cmake -B ../libdatachannel_build_mac_debug_static_openssl_debug -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_ROOT_DIR=~/github/PS_OPENSSL/debug/mac111 -DCMAKE_BUILD_TYPE=Debug -cd ../libdatachannel_build_mac_static_openssl +cd ../libdatachannel_build_mac_debug_static_openssl_debug -# requires xcode 11.7 +make +./tests -xcodebuild -scheme ALL_BUILD -configuration Debug -./Debug/tests +cd ../libdatachannel/scripts + +cd ../../libdatachannel + +cmake -B ../libdatachannel_build_mac_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_ROOT_DIR=~/github/PS_OPENSSL/release/mac111 -DCMAKE_BUILD_TYPE=RelWithDebInfo -xcodebuild -scheme ALL_BUILD -configuration RelWithDebInfo -./RelWithDebInfo/tests +cd ../libdatachannel_build_mac_static_openssl/ +make +./tests cd ../libdatachannel/scripts diff --git a/scripts/build_mac_xcode.sh b/scripts/build_mac_xcode.sh new file mode 100755 index 000000000..dec0136fc --- /dev/null +++ b/scripts/build_mac_xcode.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -e + +# in libdatachannel/scripts directory + +cd ../../libdatachannel + +cmake -B ../libdatachannel_build_mac_xcode_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -G Xcode -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_ROOT_DIR=~/github/PS_OPENSSL/release/mac111 + +cd ../libdatachannel_build_mac_xcode_static_openssl + +# requires xcode 11.7 + +xcodebuild -scheme ALL_BUILD -configuration Debug +./Debug/tests + +xcodebuild -scheme ALL_BUILD -configuration RelWithDebInfo +./RelWithDebInfo/tests + +cd ../libdatachannel/scripts + +# copy build to qt-shared +#./copy_build_mac_xcode_to_qt-shared.sh diff --git a/scripts/copy_build_mac_to_qt-shared.sh b/scripts/copy_build_mac_to_qt-shared.sh index 9b76ffc71..65b6b9b28 100755 --- a/scripts/copy_build_mac_to_qt-shared.sh +++ b/scripts/copy_build_mac_to_qt-shared.sh @@ -1,14 +1,14 @@ #/usr/bin/env bash set -e -PS_QT="${PS_QT:-$(pwd)/../../PS_QTNativeApp}" +PS_QT="$(cd ${PS_QT:-$(pwd)/../../PS_QTNativeApp}; pwd)" mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release -rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/release/*.dylib -cp -a ../../libdatachannel_build_mac_static_openssl/RelWithDebInfo/*.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release/ +rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release/*.dylib +cp -a ../../libdatachannel_build_mac_static_openssl/*.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release/ install_name_tool -id @rpath/libdatachannel.0.11.4.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release/libdatachannel.0.11.4.dylib mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug -rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/linux/debug/*.dylib -cp -a ../../libdatachannel_build_mac_static_openssl/Debug/*.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug/ +rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug/*.dylib +cp -a ../../libdatachannel_build_mac_debug_static_openssl_debug/*.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug/ install_name_tool -id @rpath/libdatachannel.0.11.4.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug/libdatachannel.0.11.4.dylib diff --git a/scripts/copy_build_mac_to_qtdatachan.sh b/scripts/copy_build_mac_to_qtdatachan.sh new file mode 100755 index 000000000..6902b865b --- /dev/null +++ b/scripts/copy_build_mac_to_qtdatachan.sh @@ -0,0 +1,14 @@ +#/usr/bin/env bash +set -e + +PS_QT="$(cd ${PS_QT:-$(pwd)/../../qtdatachan}; pwd)" + +mkdir -p ${PS_QT}/libdatachannel/build/mac/release +rm -f ${PS_QT}/libdatachannel/build/mac/release/*.dylib +cp -a ../../libdatachannel_build_mac_static_openssl/*.dylib ${PS_QT}/libdatachannel/build/mac/release/ +install_name_tool -id @rpath/libdatachannel.0.11.4.dylib ${PS_QT}/libdatachannel/build/mac/release/libdatachannel.0.11.4.dylib + +mkdir -p ${PS_QT}/libdatachannel/build/mac/debug +rm -f ${PS_QT}/libdatachannel/build/mac/debug/*.dylib +cp -a ../../libdatachannel_build_mac_debug_static_openssl_debug/*.dylib ${PS_QT}/libdatachannel/build/mac/debug/ +install_name_tool -id @rpath/libdatachannel.0.11.4.dylib ${PS_QT}/libdatachannel/build/mac/debug/libdatachannel.0.11.4.dylib diff --git a/scripts/copy_build_mac_xcode_to_qt-shared.sh b/scripts/copy_build_mac_xcode_to_qt-shared.sh new file mode 100755 index 000000000..9ad20128f --- /dev/null +++ b/scripts/copy_build_mac_xcode_to_qt-shared.sh @@ -0,0 +1,14 @@ +#/usr/bin/env bash +set -e + +PS_QT="$(cd ${PS_QT:-$(pwd)/../../PS_QTNativeApp}; pwd)" + +mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release_xcode +rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release_xcode/*.dylib +cp -a ../../libdatachannel_build_mac_xcode_static_openssl/RelWithDebInfo/*.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release_xcode/ +install_name_tool -id @rpath/libdatachannel.0.11.4.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/release_xcode/libdatachannel.0.11.4.dylib + +mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug_xcode +rm -f ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug_xcode/*.dylib +cp -a ../../libdatachannel_build_mac_xcode_static_openssl/Debug/*.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug_xcode/ +install_name_tool -id @rpath/libdatachannel.0.11.4.dylib ${PS_QT}/qt-shared/libs/libdatachannel/build/mac/debug_xcode/libdatachannel.0.11.4.dylib diff --git a/scripts/copy_includes_to_qt-shared.sh b/scripts/copy_includes_to_qt-shared.sh new file mode 100755 index 000000000..61b7ca765 --- /dev/null +++ b/scripts/copy_includes_to_qt-shared.sh @@ -0,0 +1,15 @@ +#/usr/bin/env bash +set -e + +PS_QT="$(cd ${PS_QT:-$(pwd)/../../PS_QTNativeApp}; pwd)" + +rm -rf ${PS_QT}/qt-shared/libs/libdatachannel/include +rm -rf ${PS_QT}/qt-shared/libs/libdatachannel/deps + +cp -R ../../libdatachannel/include ${PS_QT}/qt-shared/libs/libdatachannel/. + +mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/deps/json +cp -R ../../libdatachannel/deps/json/single_include ${PS_QT}/qt-shared/libs/libdatachannel/deps/json/. + +mkdir -p ${PS_QT}/qt-shared/libs/libdatachannel/deps/plog +cp -R ../../libdatachannel/deps/plog/include ${PS_QT}/qt-shared/libs/libdatachannel/deps/plog/. diff --git a/scripts/copy_includes_to_qtdatachan.sh b/scripts/copy_includes_to_qtdatachan.sh new file mode 100755 index 000000000..6a4490e02 --- /dev/null +++ b/scripts/copy_includes_to_qtdatachan.sh @@ -0,0 +1,15 @@ +#/usr/bin/env bash +set -e + +PS_QT="$(cd ${PS_QT:-$(pwd)/../../qtdatachan}; pwd)" + +rm -rf ${PS_QT}/libdatachannel/include +rm -rf ${PS_QT}/libdatachannel/deps + +cp -R ../../libdatachannel/include ${PS_QT}/libdatachannel/. + +mkdir -p ${PS_QT}/libdatachannel/deps/json +cp -R ../../libdatachannel/deps/json/single_include ${PS_QT}/libdatachannel/deps/json/. + +mkdir -p ${PS_QT}/libdatachannel/deps/plog +cp -R ../../libdatachannel/deps/plog/include ${PS_QT}/libdatachannel/deps/plog/. From 8fba4dd6fe75599e14dd1f7389f7d2f44ae25c31 Mon Sep 17 00:00:00 2001 From: benjmain Date: Tue, 10 Aug 2021 09:46:42 -0700 Subject: [PATCH 14/16] backporting thread pool cleanup skip + build script change --- scripts/build_win.bat | 12 ++++++------ src/threadpool.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/build_win.bat b/scripts/build_win.bat index def1ba74a..1daa53792 100644 --- a/scripts/build_win.bat +++ b/scripts/build_win.bat @@ -9,14 +9,14 @@ rem build debug with openssl static debug pushd ..\..\libdatachannel -set OPENSSL_ROOT_DIR=C:\openssl\openssl_1.1.1i-debug -set PATH=C:\openssl\openssl_1.1.1i-debug\bin;%SAVED_PATH% +set OPENSSL_ROOT_DIR=C:\openssl +set PATH=C:\openssl\bin;%SAVED_PATH% rem checks: rem dir C:\openssl\openssl_1.1.1i-debug\lib\libssl_static.lib rem dir C:\openssl\openssl_1.1.1i-debug\lib\libcrypto_static.lib -cmake -B ..\libdatachannel_build_debug_static_openssl_debug -G "NMake Makefiles" -D OPENSSL_USE_STATIC_LIBS=TRUE -D CMAKE_BUILD_TYPE=Debug +cmake -B ..\libdatachannel_build_debug_static_openssl_debug -G "NMake Makefiles" -D OPENSSL_USE_STATIC_LIBS=TRUE -D CMAKE_BUILD_TYPE=Debug -D CMAKE_SHARED_LINKER_FLAGS="crypt32.lib" pushd ..\libdatachannel_build_debug_static_openssl_debug nmake tests @@ -25,14 +25,14 @@ rem build relsym with openssl static popd -set OPENSSL_ROOT_DIR=C:\Program^ Files\OpenSSL -set PATH=C:\Program^ Files\OpenSSL\bin;%SAVED_PATH% +set OPENSSL_ROOT_DIR=C:\openssl +set PATH=C:\openssl\bin;%SAVED_PATH% rem checks: rem dir C:\Program^ Files\OpenSSL\lib\libssl_static.lib rem dir C:\Program^ Files\OpenSSL\lib\libcrypto_static.lib -cmake -B ..\libdatachannel_build_relsym_static_openssl -G "NMake Makefiles" -D OPENSSL_USE_STATIC_LIBS=TRUE -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /O2 /Ob2 /DNDEBUG /Zi /Gy" -D CMAKE_SHARED_LINKER_FLAGS="/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF" +cmake -B ..\libdatachannel_build_relsym_static_openssl -G "NMake Makefiles" -D OPENSSL_USE_STATIC_LIBS=TRUE -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_SHARED_LINKER_FLAGS="crypt32.lib" pushd ..\libdatachannel_build_relsym_static_openssl nmake tests diff --git a/src/threadpool.cpp b/src/threadpool.cpp index 42f3693c0..a3fc70670 100644 --- a/src/threadpool.cpp +++ b/src/threadpool.cpp @@ -33,7 +33,7 @@ ThreadPool &ThreadPool::Instance() { return *instance; } -ThreadPool::ThreadPool() { std::atexit(joinThreadPoolInstance); } +ThreadPool::ThreadPool() { /*std::atexit(joinThreadPoolInstance);*/ } ThreadPool::~ThreadPool() {} From d3fd025b01591f2cda94ef0efa4bc281f2c86ab2 Mon Sep 17 00:00:00 2001 From: benjamin Date: Fri, 15 Oct 2021 09:15:33 -0400 Subject: [PATCH 15/16] linux buildscript --- scripts/build_linux_release.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/build_linux_release.sh b/scripts/build_linux_release.sh index 9ce4b1afe..30e2e2e2e 100755 --- a/scripts/build_linux_release.sh +++ b/scripts/build_linux_release.sh @@ -1,12 +1,8 @@ #!/usr/bin/env bash set -e -# in libdatachannel/scripts directory - - - -cd .. +cd libdatachannel OPENSSL_ROOT_DIR=/home/paperspace/projects/PS_OPENSSL/release/linux111u18/ cmake -B ../libdatachannel_build_linux_relsym_with_static_openssl -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DCMAKE_BUILD_TYPE=RelWithDebInfo From be5db55e0ed37500aa8ee0346485fa9ce003af4d Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 13 Sep 2023 08:27:28 -0400 Subject: [PATCH 16/16] universal build of libdatachannel a universal build script along with changes to accommodate more restrictions in latest xcode-shipped clang --- scripts/build_mac_universal.sh | 6 ++++++ src/peerconnection.cpp | 9 --------- test/main.cpp | 3 +++ 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 scripts/build_mac_universal.sh diff --git a/scripts/build_mac_universal.sh b/scripts/build_mac_universal.sh new file mode 100644 index 000000000..85857a7b8 --- /dev/null +++ b/scripts/build_mac_universal.sh @@ -0,0 +1,6 @@ +set -euxo pipefail + +cmake -B build -DCMAKE_INSTALL_PREFIX=./release -DUSE_GNUTLS=0 -DUSE_NICE=0 -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_ROOT_DIR=~/code/ps_openssl/release/v3.0.10/mac-universal-static -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWARNINGS_AS_ERRORS=OFF -Dsctp_werror=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" +cmake --build build --parallel +./build/tests +cmake --install build diff --git a/src/peerconnection.cpp b/src/peerconnection.cpp index 4ced150a1..9662f30c2 100644 --- a/src/peerconnection.cpp +++ b/src/peerconnection.cpp @@ -37,16 +37,7 @@ #include #include -#if __clang__ && defined(__APPLE__) -namespace { -template -inline std::shared_ptr reinterpret_pointer_cast(std::shared_ptr const &ptr) noexcept { - return std::shared_ptr(ptr, reinterpret_cast(ptr.get())); -} -} // namespace -#else using std::reinterpret_pointer_cast; -#endif static rtc::LogCounter COUNTER_MEDIA_TRUNCATED(plog::warning, "Number of RTP packets truncated over past second"); diff --git a/test/main.cpp b/test/main.cpp index 1a619b52b..a078537b2 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -52,6 +52,8 @@ int main(int argc, char **argv) { return -1; } this_thread::sleep_for(1s); + // open relay turn server is unreliable + /* try { cout << endl << "*** Running WebRTC TURN connectivity test..." << endl; test_turn_connectivity(); @@ -61,6 +63,7 @@ int main(int argc, char **argv) { return -1; } this_thread::sleep_for(1s); + */ try { cout << endl << "*** Running WebRTC C API connectivity test..." << endl; test_capi_connectivity();