mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-25 03:02:22 +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;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public:
|
||||
std::string _full_url;
|
||||
std::string _schema;
|
||||
std::string _host;
|
||||
std::string _port;
|
||||
uint16_t _port = 0;
|
||||
std::string _vhost;
|
||||
std::string _app;
|
||||
std::string _streamid;
|
||||
|
||||
Reference in New Issue
Block a user