优化虚拟主机相关

This commit is contained in:
xiongziliang 2019-05-29 09:26:16 +08:00
parent c1b6df7bc7
commit a109d966c8

View File

@ -230,6 +230,8 @@ void MediaInfo::parse(const string &url){
_streamid = steamid;
}
}
GET_CONFIG(bool,enableVhost,General::kEnableVhost);
if(_vhost.empty()){
//无效vhost
_vhost = DEFAULT_VHOST;
@ -237,17 +239,15 @@ void MediaInfo::parse(const string &url){
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){
//关闭了虚拟主机
_vhost = DEFAULT_VHOST;
}
}
if(_vhost == "localhost"){
_vhost = DEFAULT_VHOST;
}
GET_CONFIG(bool,enableVhost,General::kEnableVhost);
if(!enableVhost){
_vhost = DEFAULT_VHOST;
}
}