From 22f5f5613085844f50b356a2e9142fe503a44244 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Sun, 19 Nov 2023 14:36:03 +0800 Subject: [PATCH] rtc fix sdp ufag should not contain _ + = - by spec (#2993) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rtc 中的sdp ufrag 只能有数字与字母组成,不能包含其他符号(根据RFC 5245),包含 _ + = - , 在chromium 项目中有人提出过,详情见( https://crbug.com/1053756 )。chrome 也能正常处理_ + = - 等符号,但是在日志中会有警告如下 `[WARNING:transport_description.cc(32)] '-', '=', '#' and '-' are not valid ice-char and thus not permitted in ufrag or pwd. This is a protocol violation that is permitted to allow upgrading but will be rejected in the future. See https://crbug.com/1053756` 因此修改 --- webrtc/WebRtcTransport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 9ac6251f..3f798358 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -90,7 +90,7 @@ const char* sockTypeStr(Session* session) { WebRtcTransport::WebRtcTransport(const EventPoller::Ptr &poller) { _poller = poller; - _identifier = "zlm_" + to_string(++s_key); + _identifier = "zlm" + to_string(++s_key); _packet_pool.setSize(64); }