mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
新增url判空逻辑
This commit is contained in:
@@ -212,6 +212,7 @@ static void inline checkHost(std::string &host) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void splitUrl(const std::string &url, std::string &host, uint16_t &port) {
|
void splitUrl(const std::string &url, std::string &host, uint16_t &port) {
|
||||||
|
CHECK(!url.empty(), "empty url");
|
||||||
auto pos = url.rfind(':');
|
auto pos = url.rfind(':');
|
||||||
if (pos == string::npos || url.back() == ']') {
|
if (pos == string::npos || url.back() == ']') {
|
||||||
//没有冒号,未指定端口;或者是纯粹的ipv6地址
|
//没有冒号,未指定端口;或者是纯粹的ipv6地址
|
||||||
|
|||||||
Reference in New Issue
Block a user