mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
新增url判空逻辑
This commit is contained in:
parent
4f05aef245
commit
ea6ef2779e
@ -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地址
|
||||||
|
Loading…
Reference in New Issue
Block a user