Skip to content

Commit 3258484

Browse files
committed
Add tv_sec change for connection timeout suggested by author.
1 parent 2177b6b commit 3258484

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.207 2002/10/11 04:12:14 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.208 2002/10/11 04:41:59 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1078,7 +1078,8 @@ connectDBComplete(PGconn *conn)
10781078
finish_time = time((time_t *) NULL) + remains.tv_sec;
10791079
}
10801080

1081-
while (rp == NULL || remains.tv_sec > 0 || remains.tv_usec > 0)
1081+
while (rp == NULL || remains.tv_sec > 0 ||
1082+
(remains.tv_sec == 0 && remains.tv_usec > 0))
10821083
{
10831084
/*
10841085
* Wait, if necessary. Note that the initial state (just after
@@ -1131,10 +1132,7 @@ connectDBComplete(PGconn *conn)
11311132
return 0;
11321133
}
11331134

1134-
if (finish_time > current_time)
1135-
remains.tv_sec = finish_time - current_time;
1136-
else
1137-
remains.tv_sec = 0;
1135+
remains.tv_sec = finish_time - current_time;
11381136
remains.tv_usec = 0;
11391137
}
11401138
}

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