mirror of
https://github.com/postgres/postgres.git
synced 2026-04-14 21:47:31 -04:00
libpq: Fix inadvertent change in PQhost() behavior.
Commit274bb2b385caused PQhost() to return the value of the hostaddr parameter rather than the relevant host when the latter parameter was specified. That's wrong. Commit9a1d0af4adthen amplified the damage by using PQhost() in more places, so that the SSL test suite started failing. Report by Andreas Karlsson; patch by me.
This commit is contained in:
parent
a01a5013d9
commit
11003eb556
1 changed files with 2 additions and 1 deletions
|
|
@ -5736,7 +5736,8 @@ PQhost(const PGconn *conn)
|
|||
{
|
||||
if (!conn)
|
||||
return NULL;
|
||||
if (conn->connhost != NULL)
|
||||
if (conn->connhost != NULL &&
|
||||
conn->connhost[conn->whichhost].type != CHT_HOST_ADDRESS)
|
||||
return conn->connhost[conn->whichhost].host;
|
||||
else if (conn->pghost != NULL && conn->pghost[0] != '\0')
|
||||
return conn->pghost;
|
||||
|
|
|
|||
Loading…
Reference in a new issue