diff options
| author | Daniel Gustafsson | 2023-03-29 19:41:27 +0000 |
|---|---|---|
| committer | Daniel Gustafsson | 2023-03-29 19:41:27 +0000 |
| commit | 44d85ba5a3361dea371d23bd91777ef4c0c4e506 (patch) | |
| tree | ffca9c50ac49b1d3adb0597d202a4766d1d6fec0 /src/include | |
| parent | 8e5eef50c5b41fd39ad60365c9c1b46782f881ca (diff) | |
Copy and store addrinfo in libpq-owned private memory
This refactors libpq to copy addrinfos returned by getaddrinfo to
memory owned by libpq such that future improvements can alter for
example the order of entries.
As a nice side effect of this refactor the mechanism for iteration
over addresses in PQconnectPoll is now identical to its iteration
over hosts.
Author: Jelte Fennema <postgres@jeltef.nl>
Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>
Reviewed-by: Michael Banck <mbanck@gmx.net>
Reviewed-by: Andrey Borodin <amborodin86@gmail.com>
Discussion: https://postgr.es/m/PR3PR83MB04768E2FF04818EEB2179949F7A69@PR3PR83MB0476.EURPRD83.prod.outlook.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/libpq/pqcomm.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h index bff7dd18a2..c85090259d 100644 --- a/src/include/libpq/pqcomm.h +++ b/src/include/libpq/pqcomm.h @@ -27,6 +27,12 @@ typedef struct socklen_t salen; } SockAddr; +typedef struct +{ + int family; + SockAddr addr; +} AddrInfo; + /* Configure the UNIX socket location for the well known port. */ #define UNIXSOCK_PATH(path, port, sockdir) \ |
