mirror of https://gitee.com/bigwinds/arangodb
bugfix IPv6 endpoint
This commit is contained in:
parent
f89ff94944
commit
5c3e10de70
|
@ -196,11 +196,11 @@ Endpoint* Endpoint::factory (const Endpoint::EndpointType type,
|
||||||
if (copy[0] == '[') {
|
if (copy[0] == '[') {
|
||||||
// ipv6
|
// ipv6
|
||||||
found = copy.find("]:", 1);
|
found = copy.find("]:", 1);
|
||||||
if (found != string::npos && found + 2 < copy.size()) {
|
if (found != string::npos && found > 2 && found + 2 < copy.size()) {
|
||||||
// hostname and port (e.g. [address]:port)
|
// hostname and port (e.g. [address]:port)
|
||||||
uint16_t port = (uint16_t) StringUtils::uint32(copy.substr(found + 2));
|
uint16_t port = (uint16_t) StringUtils::uint32(copy.substr(found + 2));
|
||||||
|
|
||||||
return new EndpointIpV6(type, protocol, encryption, specification, listenBacklog, copy.substr(0, found + 1), port);
|
return new EndpointIpV6(type, protocol, encryption, specification, listenBacklog, copy.substr(1, found - 1), port);
|
||||||
}
|
}
|
||||||
|
|
||||||
found = copy.find("]", 1);
|
found = copy.find("]", 1);
|
||||||
|
|
Loading…
Reference in New Issue