mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-11-24 00:47:21 +08:00
修复udp单端口模式下rtp鉴权失败后无法关闭流的问题(#2985)
如果rtp推流鉴权失败,在udp模式下延时断开连接,等待超时自动关闭,防止频繁创建销毁RtpSession对象, tcp模式则立即断开链接。
This commit is contained in:
@@ -139,8 +139,15 @@ void RtpSession::onRtpPacket(const char *data, size_t len) {
|
||||
} else {
|
||||
throw;
|
||||
}
|
||||
} catch (...) {
|
||||
throw;
|
||||
} catch (std::exception &ex) {
|
||||
if (!_is_udp) {
|
||||
// tcp情况下立即断开连接
|
||||
throw;
|
||||
}
|
||||
// udp情况下延时断开连接(等待超时自动关闭),防止频繁创建销毁RtpSession对象
|
||||
WarnP(this) << ex.what();
|
||||
_delay_close = true;
|
||||
return;
|
||||
}
|
||||
_ticker.resetTime();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user