Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited51bd4

Browse files
committed
Use only addr_cur when reporting connection failures in libpq.
1 parent4f6deef commited51bd4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎src/interfaces/libpq/fe-connect.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -989,17 +989,16 @@ connectFailureMessage(PGconn *conn, int errorno)
989989
{
990990
charhost_addr[NI_MAXHOST];
991991
booldisplay_host_addr;
992-
structsockaddr_in*host_addr_struct= (structsockaddr_in*)
993-
&conn->raddr.addr;
994992

995993
/*
996994
*Optionally display the network address with the hostname.
997995
*This is useful to distinguish between IPv4 and IPv6 connections.
998996
*/
999997
if (conn->pghostaddr!=NULL)
1000998
strlcpy(host_addr,conn->pghostaddr,NI_MAXHOST);
1001-
elseif (inet_net_ntop(conn->addr_cur->ai_family,&host_addr_struct->sin_addr,
1002-
host_addr_struct->sin_family==AF_INET ?32 :128,
999+
elseif (inet_net_ntop(conn->addr_cur->ai_family,
1000+
&conn->addr_cur->ai_addr,
1001+
conn->addr_cur->ai_family==AF_INET ?32 :128,
10031002
host_addr,sizeof(host_addr))==NULL)
10041003
strcpy(host_addr,"???");
10051004

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp