mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
[ Backpatch to 7.3.X.]
SSL_read/write can error needing ERROR_WANT_READ or ERROR_WANT_WRITE.
This commit is contained in:
parent
0184db50a0
commit
bf7ca0a769
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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)
|
* Since the server static private key ($DataDir/server.key)
|
||||||
* will normally be stored unencrypted so that the database
|
* 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:
|
case SSL_ERROR_WANT_READ:
|
||||||
n = secure_read(port, ptr, len);
|
n = secure_read(port, ptr, len);
|
||||||
break;
|
break;
|
||||||
|
case SSL_ERROR_WANT_WRITE:
|
||||||
|
n = secure_write(port, ptr, len);
|
||||||
|
break;
|
||||||
case SSL_ERROR_SYSCALL:
|
case SSL_ERROR_SYSCALL:
|
||||||
if (n == -1)
|
if (n == -1)
|
||||||
elog(COMMERROR, "SSL SYSCALL error: %s", strerror(errno));
|
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:
|
case SSL_ERROR_NONE:
|
||||||
port->count += n;
|
port->count += n;
|
||||||
break;
|
break;
|
||||||
|
case SSL_ERROR_WANT_READ:
|
||||||
|
n = secure_read(port, ptr, len);
|
||||||
|
break;
|
||||||
case SSL_ERROR_WANT_WRITE:
|
case SSL_ERROR_WANT_WRITE:
|
||||||
n = secure_write(port, ptr, len);
|
n = secure_write(port, ptr, len);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user