From f8f3c5dd19e88e4c4763b6675cbd0c8d635573bb Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 29 May 2019 09:30:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=99=9A=E6=8B=9F=E4=B8=BB?= =?UTF-8?q?=E6=9C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/MediaSource.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Common/MediaSource.cpp b/src/Common/MediaSource.cpp index 4f263f18..5cd13ed2 100644 --- a/src/Common/MediaSource.cpp +++ b/src/Common/MediaSource.cpp @@ -232,17 +232,7 @@ void MediaInfo::parse(const string &url){ } GET_CONFIG(bool,enableVhost,General::kEnableVhost); - if(_vhost.empty()){ - //无效vhost - _vhost = DEFAULT_VHOST; - }else if(INADDR_NONE != inet_addr(_vhost.data())){ - //这是ip,未指定vhost;使用默认vhost - _vhost = DEFAULT_VHOST; - }else if(_vhost == "localhost"){ - //localhost也是默认vhost - _vhost = DEFAULT_VHOST; - }else if(!enableVhost){ - //关闭了虚拟主机 + if(!enableVhost || _vhost.empty() || _vhost == "localhost" || INADDR_NONE != inet_addr(_vhost.data())){ _vhost = DEFAULT_VHOST; } }