Skip to content
Snippets Groups Projects
Commit 183ecb2e authored by Steve Lhomme's avatar Steve Lhomme Committed by Hugo Beauzée-Luyssen
Browse files

contrib: srt: replace MSG_TRUNC with upstream fix

It can be removed once we update to the next release.

The previous patch potentially hides an error handling.
parent 60b079bb
No related branches found
No related tags found
No related merge requests found
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
From 82a65778b2445d3b310c7fa870cfb6410307d31b Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 2 Sep 2022 09:12:03 +0200
Subject: [PATCH] [core] remove MSG_TRUNC logging
The code does not compile on platforms/SDKs where MSG_TRUNC doesn't exist
(mingw-w64/windows).
---
srtcore/channel.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/srtcore/channel.cpp b/srtcore/channel.cpp
index 6d51487..30fd987 100644
--- a/srtcore/channel.cpp
+++ b/srtcore/channel.cpp
@@ -878,7 +878,7 @@ srt::EReadStatus srt::CChannel::recvfrom(sockaddr_any& w_addr, CPacket& w_packet
{
HLOGC(krlog.Debug,
log << CONID() << "NET ERROR: packet size=" << recv_size << " msg_flags=0x" << hex << msg_flags
- << ", possibly MSG_TRUNC (0x" << hex << int(MSG_TRUNC) << ")");
+ << ", possibly MSG_TRUNC)");
status = RST_AGAIN;
goto Return_error;
}
--
2.27.0.windows.1
......@@ -24,7 +24,7 @@ $(TARBALLS)/srt-$(SRT_VERSION).tar.gz:
srt: srt-$(SRT_VERSION).tar.gz .sum-srt
$(UNPACK)
$(APPLY) $(SRC)/srt/0001-core-ifdef-MSG_TRUNC-nixes-fix.patch
$(APPLY) $(SRC)/srt/0001-core-remove-MSG_TRUNC-logging.patch
$(call pkg_static,"scripts/srt.pc.in")
mv srt-$(SRT_VERSION) $@ && touch $@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment