clang-format

This commit is contained in:
zhangxiaoyu.york 2024-09-04 22:37:11 +08:00
parent 8655c394b5
commit 0a190c7644
1 changed files with 3 additions and 2 deletions

View File

@ -113,10 +113,11 @@ static bool dns_resolve(std::string const& target,
return false; return false;
} }
std::string host(target.substr(0,rindex)); std::string host(target.substr(0, rindex));
// host format is [ipv6] // host format is [ipv6]
if(!ipv4 && !host.empty() && host[0] == '[' && host[host.size()-1] == ']') { if (!ipv4 && !host.empty() && host[0] == '[' &&
host[host.size() - 1] == ']') {
host = target.substr(1, rindex - 2); host = target.substr(1, rindex - 2);
ipv6_url = true; ipv6_url = true;
} }