From 39eac339d53ba61a8f10fe04073dd17da2c48366 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 26 Aug 2026 17:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dice=E5=BB=BA=E8=BF=9E?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=89=8D=E5=85=B3=E9=97=ADWebRtcTransport?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E5=A4=B1=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/WebRtcTransport.cpp | 4 ++++ webrtc/WebRtcTransport.h | 1 + 2 files changed, 5 insertions(+) diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 068989aa..d011df90 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -614,6 +614,7 @@ void WebRtcTransport::setOnShutdown(function cb) void WebRtcTransport::onShutdown(const SockException &ex) { TraceL << ex; + _ex = ex; if (_on_shutdown) { _on_shutdown(ex); } @@ -745,6 +746,9 @@ static bool isDtls(const char *buf) { } void WebRtcTransport::inputSockData(const char *buf, int len, const SocketHelper::Ptr& socket, struct sockaddr *addr, int addr_len) { + if (_ex) { + throw _ex; + } IceTransport::Pair::Ptr pair; if (addr != nullptr) { auto peer_host = SockUtil::inet_ntoa(addr); diff --git a/webrtc/WebRtcTransport.h b/webrtc/WebRtcTransport.h index 1d0c4d10..0aa9811a 100644 --- a/webrtc/WebRtcTransport.h +++ b/webrtc/WebRtcTransport.h @@ -257,6 +257,7 @@ private: std::shared_ptr _check_timer; std::function _on_start; std::function _on_shutdown; + toolkit::SockException _ex; #ifdef ENABLE_SCTP RTC::SctpAssociationImp::Ptr _sctp;