From 272d1a8bd960a771ce4310c939d152faccdad18d Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 23 Jan 2021 10:06:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E4=B8=80=E4=BA=9Brtmp?= =?UTF-8?q?=E6=8E=A8=E6=B5=81=E5=99=A8:=20#692?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpSession.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Rtmp/RtmpSession.cpp b/src/Rtmp/RtmpSession.cpp index 96584532..b2bc0134 100644 --- a/src/Rtmp/RtmpSession.cpp +++ b/src/Rtmp/RtmpSession.cpp @@ -87,6 +87,12 @@ void RtmpSession::onCmd_connect(AMFDecoder &dec) { if(_tc_url.empty()){ //defaultVhost:默认vhost _tc_url = string(RTMP_SCHEMA) + "://" + DEFAULT_VHOST + "/" + _media_info._app; + } else { + auto pos = _tc_url.rfind('?'); + if (pos != string::npos) { + //tc_url 中可能包含?以及参数,参见issue: #692 + _tc_url = _tc_url.substr(0, pos); + } } bool ok = true; //(app == APP_NAME); AMFValue version(AMF_OBJECT);