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
39a9496d
Commit
39a9496d
authored
Aug 04, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some more problems with testing error returns from SSL.
parent
5c15cb47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
+23
-4
src/interfaces/libpq/fe-misc.c
src/interfaces/libpq/fe-misc.c
+12
-1
src/interfaces/libpq/fe-secure.c
src/interfaces/libpq/fe-secure.c
+11
-3
No files found.
src/interfaces/libpq/fe-misc.c
View file @
39a9496d
...
...
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.10
0 2003/08/04 02:40:17 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.10
1 2003/08/04 17:25:14 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -648,7 +648,18 @@ retry3:
* file is ready. Grumble. Fortunately, we don't expect this path to
* be taken much, since in normal practice we should not be trying to
* read data unless the file selected for reading already.
*
* In SSL mode it's even worse: SSL_read() could say WANT_READ and then
* data could arrive before we make the pqReadReady() test. So we must
* play dumb and assume there is more data, relying on the SSL layer to
* detect true EOF.
*/
#ifdef USE_SSL
if
(
conn
->
ssl
)
return
0
;
#endif
switch
(
pqReadReady
(
conn
))
{
case
0
:
...
...
src/interfaces/libpq/fe-secure.c
View file @
39a9496d
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v 1.2
8 2003/08/04 02:40:20 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v 1.2
9 2003/08/04 17:25:14 tgl
Exp $
*
* NOTES
* The client *requires* a valid server certificate. Since
...
...
@@ -308,9 +308,13 @@ rloop:
libpq_gettext
(
"SSL SYSCALL error: %s
\n
"
),
SOCK_STRERROR
(
SOCK_ERRNO
,
sebuf
,
sizeof
(
sebuf
)));
else
{
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"SSL SYSCALL error: EOF detected
\n
"
));
SOCK_ERRNO
=
ECONNRESET
;
n
=
-
1
;
}
break
;
}
case
SSL_ERROR_SSL
:
...
...
@@ -318,13 +322,13 @@ rloop:
libpq_gettext
(
"SSL error: %s
\n
"
),
SSLerrmessage
());
/* fall through */
case
SSL_ERROR_ZERO_RETURN
:
pqsecure_close
(
conn
);
SOCK_ERRNO
=
ECONNRESET
;
n
=
-
1
;
break
;
default:
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"Unknown SSL error code
\n
"
));
n
=
-
1
;
break
;
}
}
...
...
@@ -376,8 +380,12 @@ pqsecure_write(PGconn *conn, const void *ptr, size_t len)
libpq_gettext
(
"SSL SYSCALL error: %s
\n
"
),
SOCK_STRERROR
(
SOCK_ERRNO
,
sebuf
,
sizeof
(
sebuf
)));
else
{
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"SSL SYSCALL error: EOF detected
\n
"
));
SOCK_ERRNO
=
ECONNRESET
;
n
=
-
1
;
}
break
;
}
case
SSL_ERROR_SSL
:
...
...
@@ -385,13 +393,13 @@ pqsecure_write(PGconn *conn, const void *ptr, size_t len)
libpq_gettext
(
"SSL error: %s
\n
"
),
SSLerrmessage
());
/* fall through */
case
SSL_ERROR_ZERO_RETURN
:
pqsecure_close
(
conn
);
SOCK_ERRNO
=
ECONNRESET
;
n
=
-
1
;
break
;
default:
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"Unknown SSL error code
\n
"
));
n
=
-
1
;
break
;
}
}
...
...
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