Commit ea6ef277 by xiongziliang

新增url判空逻辑

parent 4f05aef2
......@@ -212,6 +212,7 @@ static void inline checkHost(std::string &host) {
}
void splitUrl(const std::string &url, std::string &host, uint16_t &port) {
CHECK(!url.empty(), "empty url");
auto pos = url.rfind(':');
if (pos == string::npos || url.back() == ']') {
//没有冒号,未指定端口;或者是纯粹的ipv6地址
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论