/pgpatches/libpq_ipv6

text/x-diff

Filename: /pgpatches/libpq_ipv6
Type: text/x-diff
Part: 0
Message: Re: duplicate connection failure messages

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/interfaces/libpq/fe-connect.c 0 0
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 8f318a1..bf85b49 100644
*** a/src/interfaces/libpq/fe-connect.c
--- b/src/interfaces/libpq/fe-connect.c
*************** connectFailureMessage(PGconn *conn, int 
*** 962,968 ****
  	{
  		appendPQExpBuffer(&conn->errorMessage,
  						  libpq_gettext("could not connect to server: %s\n"
! 					 "\tIs the server running on host \"%s\" and accepting\n"
  										"\tTCP/IP connections on port %s?\n"),
  						  SOCK_STRERROR(errorno, sebuf, sizeof(sebuf)),
  						  conn->pghostaddr
--- 962,968 ----
  	{
  		appendPQExpBuffer(&conn->errorMessage,
  						  libpq_gettext("could not connect to server: %s\n"
! 					 "\tIs the server running on host \"%s\" (%s) and accepting\n"
  										"\tTCP/IP connections on port %s?\n"),
  						  SOCK_STRERROR(errorno, sebuf, sizeof(sebuf)),
  						  conn->pghostaddr
*************** connectFailureMessage(PGconn *conn, int 
*** 970,975 ****
--- 970,980 ----
  						  : (conn->pghost
  							 ? conn->pghost
  							 : "???"),
+ 						  (conn->addr_cur->ai_family == AF_INET) ? "IPv4" :
+ #ifdef HAVE_IPV6
+ 						  (conn->addr_cur->ai_family == AF_INET6) ? "IPv6" :
+ #endif
+ 						  "???",
  						  conn->pgport);
  	}
  }