完善ipv6支持

This commit is contained in:
xiongziliang 2022-05-08 09:25:47 +08:00
parent c14bf7d8b1
commit a95bf960e0

View File

@ -514,7 +514,7 @@ void MediaInfo::parse(const string &url_in){
} else {
_host = _vhost = vhost;
}
if (_vhost == "localhost" || INADDR_NONE != inet_addr(_vhost.data())) {
if (_vhost == "localhost" || isIP(_vhost.data())) {
//如果访问的是localhost或ip那么则为默认虚拟主机
_vhost = DEFAULT_VHOST;
}