Enclose host in [] if host is IPv6 literal address.
This commit is contained in:
parent
bfc3b4b95b
commit
8069575838
|
@ -161,7 +161,14 @@ int communicate(const std::string& host, uint16_t port,
|
||||||
pollfd pollfds[1];
|
pollfd pollfds[1];
|
||||||
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << host << ":" << port;
|
if(reqvec[0].us.ipv6LiteralAddress) {
|
||||||
|
ss << "[";
|
||||||
|
}
|
||||||
|
ss << host;
|
||||||
|
if(reqvec[0].us.ipv6LiteralAddress) {
|
||||||
|
ss << "]";
|
||||||
|
}
|
||||||
|
ss << ":" << port;
|
||||||
std::string hostport = ss.str();
|
std::string hostport = ss.str();
|
||||||
|
|
||||||
for(int i = 0, n = reqvec.size(); i < n; ++i) {
|
for(int i = 0, n = reqvec.size(); i < n; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue