Problem Summary:
Now the etcd client address do not support host format such as
http://[ipv6]:port.
and [RFC
3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2)
```
A host identified by an Internet Protocol literal address, version 6
[[RFC3513](https://datatracker.ietf.org/doc/html/rfc3513)] or later, is distinguished by enclosing the IP literal
within square brackets ("[" and "]"). This is the only place where
square bracket characters are allowed in the URI syntax. In
anticipation of future, as-yet-undefined IP literal address formats,
an implementation may use an optional version flag to indicate such a
format explicitly rather than rely on heuristic determination.
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
```
the ipv6 address is distinguished by enclosing the IP literal within
square brackets ("[" and "]").
What is changed and how it works:
if we find the host part of a URL starts with a "[" and ends with a "]".
it will be specifically judged whether it is a valid IPv6 address. If it
is a valid address, it can be returned directly without call the
`getaddrinfo` interface.
When I [Update](https://github.com/microsoft/vcpkg/pull/32747)
etcd-cpp-apiv3 version from 0.14.2 to 0.15.2, I get two build error:
````
fatal error LNK1107: invalid or corrupt file: cannot read at 0x330
````
````
error: use of undeclared identifier 'IPPROTO_TCP'
````
The first error was because the target `etcd-cpp-api-core-objects`
linked the wrong `libprotobufd.dll` file instead of the .lib file, I
used the usage provided by vcpkg to link the correct .lib file to fix
this error.
Another error was because `IPPROTO_TCP` was missing declaration
`"<netinet/in.h>"`, I added it to fix this error.
---------
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
Co-authored-by: Zhao Liu <v-zhli17@microsoft.com>
Co-authored-by: Tao He <linzhu.ht@alibaba-inc.com>
* Enable keys() to list elements without fetching values from server
* Add concurrency control and cancel to CI workflows
Signed-off-by: Tao He <sighingnow@gmail.com>
* Add more variants for etcd::Watcher's constructor.
* Use ASAN for testing on CI.
* Revert "Use ASAN for testing on CI."
This reverts commit 6ccc2161da.
* Make Response::index() 64 bit
* make compact_revision 64 bit
* Make input revision params 64 bit
* make Transaction mod revision 64 bit
* Make Value created and modified index 64 bit
* Fix tests