Browse Source
fixes crashes
removes now unused patches
(cherry picked from commit 0e7afc72a2)
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
pull/135/head
committed by
Hugo Beauzée-Luyssen
9 changed files with 35 additions and 199 deletions
@ -1,44 +0,0 @@ |
|||
From 1658479fe1f113a02a7af48f53da6baeea5df482 Mon Sep 17 00:00:00 2001 |
|||
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> |
|||
Date: Mon, 9 Jul 2018 17:51:27 -0400 |
|||
Subject: [PATCH 1/3] api: Don't use inet_ntop |
|||
|
|||
It's not defined on Windows. Instead use getnameinfo with |
|||
the numeric request. |
|||
---
|
|||
srtcore/api.h | 15 ++++++--------- |
|||
1 file changed, 6 insertions(+), 9 deletions(-) |
|||
|
|||
diff --git a/srtcore/api.h b/srtcore/api.h
|
|||
index e6e9d3f..de3b4f0 100644
|
|||
--- a/srtcore/api.h
|
|||
+++ b/srtcore/api.h
|
|||
@@ -270,19 +270,16 @@ inline std::string SockaddrToString(const sockaddr* sadr)
|
|||
|
|||
std::ostringstream output; |
|||
char hostbuf[1024]; |
|||
+ int flags;
|
|||
|
|||
#if ENABLE_GETNAMEINFO |
|||
- if (!getnameinfo(sadr, sizeof(*sadr), hostbuf, 1024, NULL, 0, NI_NAMEREQD))
|
|||
- {
|
|||
- output << hostbuf;
|
|||
- }
|
|||
- else
|
|||
+ flags = NI_NAMEREQD;
|
|||
+#else
|
|||
+ flags = NI_NUMERICHOST | NI_NUMERICSERV;
|
|||
#endif |
|||
+
|
|||
+ if (!getnameinfo(sadr, sizeof(*sadr), hostbuf, 1024, NULL, 0, flags))
|
|||
{ |
|||
- if (inet_ntop(sadr->sa_family, addr, hostbuf, 1024) == NULL)
|
|||
- {
|
|||
- strcpy(hostbuf, "unknown");
|
|||
- }
|
|||
output << hostbuf; |
|||
} |
|||
|
|||
--
|
|||
2.17.1 |
|||
|
|||
@ -0,0 +1,32 @@ |
|||
From b159a783ac11cb6c2c8ec035deaeb3d8a73e0e2f Mon Sep 17 00:00:00 2001 |
|||
From: Francois Cartegnie <fcvlcdev@free.fr> |
|||
Date: Mon, 9 Nov 2020 20:54:14 +0100 |
|||
Subject: [PATCH] core: ifdef MSG_TRUNC nixes fix |
|||
|
|||
---
|
|||
srtcore/channel.cpp | 2 ++ |
|||
1 file changed, 2 insertions(+) |
|||
|
|||
diff --git a/srtcore/channel.cpp b/srtcore/channel.cpp
|
|||
index 3473e75..3af852e 100644
|
|||
--- a/srtcore/channel.cpp
|
|||
+++ b/srtcore/channel.cpp
|
|||
@@ -801,6 +801,7 @@ EReadStatus CChannel::recvfrom(sockaddr_any& w_addr, CPacket& w_packet) const
|
|||
goto Return_error; |
|||
} |
|||
|
|||
+#ifndef _WIN32
|
|||
// Fix for an issue with Linux Kernel found during tests at Tencent. |
|||
// |
|||
// There was a bug in older Linux Kernel which caused that when the internal |
|||
@@ -825,6 +826,7 @@ EReadStatus CChannel::recvfrom(sockaddr_any& w_addr, CPacket& w_packet) const
|
|||
status = RST_AGAIN; |
|||
goto Return_error; |
|||
} |
|||
+#endif
|
|||
|
|||
w_packet.setLength(recv_size - CPacket::HDR_SIZE); |
|||
|
|||
--
|
|||
2.26.2 |
|||
|
|||
@ -1,27 +0,0 @@ |
|||
From e4d6b4d7f26d8d839889ae8508856d5a108cc258 Mon Sep 17 00:00:00 2001 |
|||
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> |
|||
Date: Mon, 9 Jul 2018 18:04:44 -0400 |
|||
Subject: [PATCH 2/3] win32: Only include inttypes.h with MSVC |
|||
|
|||
---
|
|||
srtcore/platform_sys.h | 2 +- |
|||
1 file changed, 1 insertion(+), 1 deletion(-) |
|||
|
|||
diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h
|
|||
index 33c4d9b..ce546d2 100644
|
|||
--- a/srtcore/platform_sys.h
|
|||
+++ b/srtcore/platform_sys.h
|
|||
@@ -15,9 +15,9 @@
|
|||
#include <ws2tcpip.h> |
|||
#include <ws2ipdef.h> |
|||
#include <windows.h> |
|||
- #include <inttypes.h>
|
|||
#include <stdint.h> |
|||
#if defined(_MSC_VER) |
|||
+ #include <inttypes.h>
|
|||
#pragma warning(disable:4251) |
|||
#endif |
|||
#else |
|||
--
|
|||
2.17.1 |
|||
|
|||
@ -1,41 +0,0 @@ |
|||
From cfc7871bad28737e5b0480c90643e7d09bf6f5cb Mon Sep 17 00:00:00 2001 |
|||
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> |
|||
Date: Mon, 9 Jul 2018 18:16:28 -0400 |
|||
Subject: [PATCH 3/3] cmake: Only install Windows headers in win subdir |
|||
|
|||
---
|
|||
CMakeLists.txt | 1 - |
|||
srtcore/platform_sys.h | 4 ++-- |
|||
2 files changed, 2 insertions(+), 3 deletions(-) |
|||
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|||
index daec198..b197c19 100644
|
|||
--- a/CMakeLists.txt
|
|||
+++ b/CMakeLists.txt
|
|||
@@ -450,7 +450,6 @@ endif()
|
|||
# will now apply to the dependent library. |
|||
#list(APPEND SOURCES_srt ${SOURCES_haicrypt}) |
|||
set (VIRTUAL_srt $<TARGET_OBJECTS:srt_virtual> $<TARGET_OBJECTS:haicrypt_virtual>) |
|||
-set (HEADERS_srt ${HEADERS_srt} ${HEADERS_srt_win32})
|
|||
|
|||
if (srt_libspec_shared) |
|||
add_library(${TARGET_srt}_shared SHARED ${VIRTUAL_srt}) |
|||
diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h
|
|||
index ce546d2..e8e6927 100644
|
|||
--- a/srtcore/platform_sys.h
|
|||
+++ b/srtcore/platform_sys.h
|
|||
@@ -15,9 +15,9 @@
|
|||
#include <ws2tcpip.h> |
|||
#include <ws2ipdef.h> |
|||
#include <windows.h> |
|||
- #include <stdint.h>
|
|||
#if defined(_MSC_VER) |
|||
- #include <inttypes.h>
|
|||
+ #include <win/stdint.h>
|
|||
+ #include <win/inttypes.h>
|
|||
#pragma warning(disable:4251) |
|||
#endif |
|||
#else |
|||
--
|
|||
2.17.1 |
|||
|
|||
@ -1,11 +0,0 @@ |
|||
--- srt/CMakeLists.txt.old 2018-07-11 22:41:30.169381997 +0200
|
|||
+++ srt/CMakeLists.txt 2018-07-11 22:41:40.324958847 +0200
|
|||
@@ -338,7 +338,7 @@
|
|||
endif() |
|||
|
|||
if (MINGW) |
|||
- set (PTHREAD_LIBRARY -lpthreadGC2)
|
|||
+ set (PTHREAD_LIBRARY -lpthread)
|
|||
# XXX CONSIDER THIS. It came from a merged previous master version |
|||
# and was under an if(NOT MINGW)...elseif(THREADS_FOUND) condition. |
|||
# Might be that the current form still suffices; resolve this and remove comment. |
|||
@ -1,26 +0,0 @@ |
|||
From 60af57d2e045ba80174aa0bb0a89807040be6d3f Mon Sep 17 00:00:00 2001 |
|||
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> |
|||
Date: Tue, 17 Jul 2018 11:24:39 -0400 |
|||
Subject: [PATCH 5/5] cmake: Prefer -lpthread for now because clang++ and VLC |
|||
|
|||
It seems that clang doesn't support -pthread at the linking stage, but |
|||
only at the compilation, so putting it into the .pc file causes issues. |
|||
---
|
|||
CMakeLists.txt | 1 - |
|||
1 file changed, 1 deletion(-) |
|||
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|||
index 34c8c87..74edd20 100644
|
|||
--- a/CMakeLists.txt
|
|||
+++ b/CMakeLists.txt
|
|||
@@ -358,7 +358,6 @@ elseif (WIN32)
|
|||
message(FATAL_ERROR "Failed to find pthread library. Specify PTHREAD_LIBRARY.") |
|||
endif() |
|||
else () |
|||
- set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|||
find_package(Threads REQUIRED) |
|||
set(PTHREAD_LIBRARY ${CMAKE_THREAD_LIBS_INIT}) |
|||
endif() |
|||
--
|
|||
2.17.1 |
|||
|
|||
@ -1,42 +0,0 @@ |
|||
From bd7beffef507a2162d22d2735f5aec2d67f81e27 Mon Sep 17 00:00:00 2001 |
|||
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> |
|||
Date: Tue, 17 Jul 2018 17:07:46 -0400 |
|||
Subject: [PATCH 6/6] cmake: Don't confuse libs and requires |
|||
|
|||
---
|
|||
CMakeLists.txt | 9 +++++++-- |
|||
1 file changed, 7 insertions(+), 2 deletions(-) |
|||
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|||
index 74edd20..9cfc475 100644
|
|||
--- a/CMakeLists.txt
|
|||
+++ b/CMakeLists.txt
|
|||
@@ -165,10 +165,12 @@ if ( USE_GNUTLS )
|
|||
) |
|||
message(STATUS "SSL Dependency: using GNUTLS with Nettle, as requested") |
|||
else() |
|||
- set (SSL_REQUIRED_MODULES "openssl libcrypto zlib")
|
|||
|
|||
if (USE_OPENSSL_PC) |
|||
|
|||
+ # Only use the .pc files if we actually try to find them
|
|||
+ set (SSL_REQUIRED_MODULES "openssl libcrypto zlib")
|
|||
+
|
|||
pkg_check_modules(SSL REQUIRED ${SSL_REQUIRED_MODULES}) |
|||
|
|||
# We have some cases when pkg-config is improperly configured |
|||
@@ -492,7 +494,10 @@ endif()
|
|||
|
|||
target_include_directories(haicrypt_virtual PRIVATE ${SSL_INCLUDE_DIRS}) |
|||
|
|||
-set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES})
|
|||
+# Only set the libraries directly if they're in the Requires.private
|
|||
+if (NOT SSL_REQUIRED_MODULES)
|
|||
+ set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES})
|
|||
+endif()
|
|||
|
|||
if (MICROSOFT) |
|||
set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ws2_32.lib) |
|||
--
|
|||
2.17.1 |
|||
|
|||
@ -1 +1 @@ |
|||
1f8fdfc0e1d92bc8c477651982c23afeacb65e2293a7225227927e1b6f71a01355a3311600097d77b3df638503e4856acbcb52ed270b650480f20b98c1be5ec2 srt-1.3.1.tar.gz |
|||
4c978e3898737e566f47222a0095df1b49591d79927850cc94c838b7eaccf401faf1c5d038fa45b6fd30c85f980e7c212a79c07ed6f9008430e8a5a594a31ffe srt-1.4.2.tar.gz |
|||
|
|||
Loading…
Reference in new issue