mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-11-24 00:47:21 +08:00
修复ice建连成功前关闭WebRtcTransport对象失败的bug
This commit is contained in:
@@ -614,6 +614,7 @@ void WebRtcTransport::setOnShutdown(function<void(const SockException &ex)> 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);
|
||||
|
||||
@@ -257,6 +257,7 @@ private:
|
||||
std::shared_ptr<toolkit::Timer> _check_timer;
|
||||
std::function<void()> _on_start;
|
||||
std::function<void(const toolkit::SockException &ex)> _on_shutdown;
|
||||
toolkit::SockException _ex;
|
||||
|
||||
#ifdef ENABLE_SCTP
|
||||
RTC::SctpAssociationImp::Ptr _sctp;
|
||||
|
||||
Reference in New Issue
Block a user