forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1944cdc
committed
libpq: PQhost to return active connected host or hostaddr
Previously, PQhost didn't return the connected host details when theconnection type was CHT_HOST_ADDRESS (i.e., via hostaddr). Instead, itreturned the complete host connection parameter (which could containmultiple hosts) or the default host details, which was confusing andarguably incorrect.Change this to return the actually connected host or hostaddrirrespective of the connection type. When hostaddr but no host wasspecified, hostaddr is now returned. Never return the original hostconnection parameter, and document that PQhost cannot be relied onbefore the connection is established.PQport is similarly changed to always return the active connection portand never the original connection parameter.Author: Hari Babu <kommi.haribabu@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>1 parent44bd958 commit1944cdc
2 files changed
+59
-14
lines changedLines changed: 46 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1692 | 1692 |
| |
1693 | 1693 |
| |
1694 | 1694 |
| |
1695 |
| - | |
| 1695 | + | |
1696 | 1696 |
| |
1697 | 1697 |
| |
1698 | 1698 |
| |
| |||
1701 | 1701 |
| |
1702 | 1702 |
| |
1703 | 1703 |
| |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1704 | 1728 |
| |
1705 | 1729 |
| |
1706 | 1730 |
| |
| |||
1714 | 1738 |
| |
1715 | 1739 |
| |
1716 | 1740 |
| |
1717 |
| - | |
| 1741 | + | |
1718 | 1742 |
| |
1719 | 1743 |
| |
1720 | 1744 |
| |
1721 | 1745 |
| |
1722 | 1746 |
| |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
1723 | 1767 |
| |
1724 | 1768 |
| |
1725 | 1769 |
| |
|
Lines changed: 13 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6017 | 6017 |
| |
6018 | 6018 |
| |
6019 | 6019 |
| |
6020 |
| - | |
6021 |
| - | |
6022 |
| - | |
6023 |
| - | |
6024 |
| - | |
6025 |
| - | |
| 6020 | + | |
| 6021 | + | |
6026 | 6022 |
| |
6027 |
| - | |
6028 |
| - | |
6029 |
| - | |
6030 |
| - | |
6031 |
| - | |
| 6023 | + | |
| 6024 | + | |
| 6025 | + | |
| 6026 | + | |
| 6027 | + | |
| 6028 | + | |
6032 | 6029 |
| |
| 6030 | + | |
| 6031 | + | |
6033 | 6032 |
| |
6034 | 6033 |
| |
6035 | 6034 |
| |
6036 | 6035 |
| |
6037 | 6036 |
| |
6038 | 6037 |
| |
6039 | 6038 |
| |
| 6039 | + | |
6040 | 6040 |
| |
6041 | 6041 |
| |
6042 |
| - | |
| 6042 | + | |
| 6043 | + | |
6043 | 6044 |
| |
6044 | 6045 |
| |
6045 | 6046 |
| |
|
0 commit comments
Comments
(0)