mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 20:15:58 +08:00
完善ipv6支持
This commit is contained in:
@@ -506,15 +506,9 @@ void MediaInfo::parse(const string &url_in){
|
||||
}
|
||||
auto split_vec = split(url.substr(schema_pos + 3), "/");
|
||||
if (split_vec.size() > 0) {
|
||||
auto vhost = split_vec[0];
|
||||
auto pos = vhost.find(":");
|
||||
if (pos != string::npos) {
|
||||
_host = _vhost = vhost.substr(0, pos);
|
||||
_port = vhost.substr(pos + 1);
|
||||
} else {
|
||||
_host = _vhost = vhost;
|
||||
}
|
||||
if (_vhost == "localhost" || isIP(_vhost.data())) {
|
||||
splitUrl(split_vec[0], _host, _port);
|
||||
_vhost = _host;
|
||||
if (_vhost == "localhost" || isIP(_vhost.data())) {
|
||||
//如果访问的是localhost或ip,那么则为默认虚拟主机
|
||||
_vhost = DEFAULT_VHOST;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user