summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-misc.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-08-04 17:25:14 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-08-04 17:25:14 +0000
commit39a9496d51e64f68cb7792c7014f4a388121ec89 (patch)
treeea2378dbc6b2b85d456baeec5cc6272984f8cb4c /src/interfaces/libpq/fe-misc.c
parent5c15cb4752303731abf54e2ed12cd741e90b5d5a (diff)
Fix some more problems with testing error returns from SSL.
Diffstat (limited to 'src/interfaces/libpq/fe-misc.c')
-rw-r--r--src/interfaces/libpq/fe-misc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c
index 2e27255fa06..cf668e10ba3 100644
--- a/src/interfaces/libpq/fe-misc.c
+++ b/src/interfaces/libpq/fe-misc.c
@@ -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.100 2003/08/04 02:40:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.101 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: