Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9eada510
Commit
9eada510
authored
Oct 14, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libpq connection_timeout doesn't do subsecond timing, so make the code
clear on that point.
parent
8f2a289d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
14 deletions
+10
-14
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+3
-5
src/interfaces/libpq/fe-misc.c
src/interfaces/libpq/fe-misc.c
+5
-7
src/interfaces/libpq/libpq-int.h
src/interfaces/libpq/libpq-int.h
+2
-2
No files found.
src/interfaces/libpq/fe-connect.c
View file @
9eada510
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.20
8 2002/10/11 04:41:59
momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.20
9 2002/10/14 17:15:11
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1071,15 +1071,14 @@ connectDBComplete(PGconn *conn)
conn
->
status
=
CONNECTION_BAD
;
return
0
;
}
remains
.
tv_usec
=
0
;
remains
.
tv_usec
=
0
;
/* We don't use subsecond timing */
rp
=
&
remains
;
/* calculate the finish time based on start + timeout */
finish_time
=
time
((
time_t
*
)
NULL
)
+
remains
.
tv_sec
;
}
while
(
rp
==
NULL
||
remains
.
tv_sec
>
0
||
(
remains
.
tv_sec
==
0
&&
remains
.
tv_usec
>
0
))
while
(
rp
==
NULL
||
remains
.
tv_sec
>
0
)
{
/*
* Wait, if necessary. Note that the initial state (just after
...
...
@@ -1133,7 +1132,6 @@ connectDBComplete(PGconn *conn)
}
remains
.
tv_sec
=
finish_time
-
current_time
;
remains
.
tv_usec
=
0
;
}
}
conn
->
status
=
CONNECTION_BAD
;
...
...
src/interfaces/libpq/fe-misc.c
View file @
9eada510
...
...
@@ -25,7 +25,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.8
0 2002/10/03 17:09:42
momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.8
1 2002/10/14 17:15:11
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -783,14 +783,13 @@ pqWait(int forRead, int forWrite, PGconn *conn)
}
int
pqWaitTimed
(
int
forRead
,
int
forWrite
,
PGconn
*
conn
,
const
struct
timeval
*
timeout
)
pqWaitTimed
(
int
forRead
,
int
forWrite
,
PGconn
*
conn
,
const
struct
timeval
*
timeout
)
{
fd_set
input_mask
;
fd_set
output_mask
;
fd_set
except_mask
;
struct
timeval
tmp_timeout
;
struct
timeval
*
ptmp_timeout
=
NULL
;
if
(
conn
->
sock
<
0
)
{
...
...
@@ -823,14 +822,13 @@ retry5:
if
(
NULL
!=
timeout
)
{
/*
*
select may modify timeout argument on some platforms use
* copy
*
select() may modify timeout argument on some platforms so
*
use
copy
*/
tmp_timeout
=
*
timeout
;
ptmp_timeout
=
&
tmp_timeout
;
}
if
(
select
(
conn
->
sock
+
1
,
&
input_mask
,
&
output_mask
,
&
except_mask
,
p
tmp_timeout
)
<
0
)
&
except_mask
,
&
tmp_timeout
)
<
0
)
{
if
(
SOCK_ERRNO
==
EINTR
)
goto
retry5
;
...
...
src/interfaces/libpq/libpq-int.h
View file @
9eada510
...
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: libpq-int.h,v 1.5
8 2002/10/03 17:09:42
momjian Exp $
* $Id: libpq-int.h,v 1.5
9 2002/10/14 17:15:11
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -340,7 +340,7 @@ extern int pqReadData(PGconn *conn);
extern
int
pqFlush
(
PGconn
*
conn
);
extern
int
pqSendSome
(
PGconn
*
conn
);
extern
int
pqWait
(
int
forRead
,
int
forWrite
,
PGconn
*
conn
);
extern
int
pqWaitTimed
(
int
forRead
,
int
forWrite
,
PGconn
*
conn
,
const
struct
timeval
*
timeout
);
extern
int
pqWaitTimed
(
int
forRead
,
int
forWrite
,
PGconn
*
conn
,
const
struct
timeval
*
timeout
);
extern
int
pqReadReady
(
PGconn
*
conn
);
extern
int
pqWriteReady
(
PGconn
*
conn
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment