Commit bf7ca0a7 authored by Bruce Momjian's avatar Bruce Momjian

[ Backpatch to 7.3.X.]

SSL_read/write can error needing ERROR_WANT_READ or ERROR_WANT_WRITE.
parent 0184db50
......@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-secure.c,v 1.27 2003/03/29 03:56:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/be-secure.c,v 1.28 2003/03/29 05:00:15 momjian Exp $
*
* Since the server static private key ($DataDir/server.key)
* will normally be stored unencrypted so that the database
......@@ -285,6 +285,9 @@ secure_read(Port *port, void *ptr, size_t len)
case SSL_ERROR_WANT_READ:
n = secure_read(port, ptr, len);
break;
case SSL_ERROR_WANT_WRITE:
n = secure_write(port, ptr, len);
break;
case SSL_ERROR_SYSCALL:
if (n == -1)
elog(COMMERROR, "SSL SYSCALL error: %s", strerror(errno));
......@@ -337,6 +340,9 @@ secure_write(Port *port, void *ptr, size_t len)
case SSL_ERROR_NONE:
port->count += n;
break;
case SSL_ERROR_WANT_READ:
n = secure_read(port, ptr, len);
break;
case SSL_ERROR_WANT_WRITE:
n = secure_write(port, ptr, len);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment