Skip to content

Commit ba19a6b

Browse files
committed
Fix error reporting of connect_timeout in libpq for value parsing
The logic was correctly detecting a parsing failure, but the parsing error did not get reported back to the client properly. Reported-by: Ed Morley Author: Lars Kanis Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/a9b4cbd7-4ecb-06b2-ebd7-1739bbff3217@greiz-reinsdorf.de Backpatch-through: 12
1 parent 4f4061b commit ba19a6b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,11 @@ connectDBComplete(PGconn *conn)
20252025
{
20262026
if (!parse_int_param(conn->connect_timeout, &timeout, conn,
20272027
"connect_timeout"))
2028+
{
2029+
/* mark the connection as bad to report the parsing failure */
2030+
conn->status = CONNECTION_BAD;
20282031
return 0;
2032+
}
20292033

20302034
if (timeout > 0)
20312035
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy