1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-30 06:01:21 +03:00

Check SSL_get_error() value SSL_ERROR_SYSCALL to see if SSL_read()

returned -1, per SSL_get_error() documentation.

Nathan Mueller
This commit is contained in:
Bruce Momjian
2002-12-12 22:42:39 +00:00
parent 5587f077ab
commit 482ed836f7
2 changed files with 14 additions and 6 deletions

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-secure.c,v 1.16 2002/11/07 18:45:51 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/be-secure.c,v 1.17 2002/12/12 22:42:39 momjian Exp $
*
* Since the server static private key ($DataDir/server.key)
* will normally be stored unencrypted so that the database
@@ -288,7 +288,10 @@ secure_read(Port *port, void *ptr, size_t len)
case SSL_ERROR_WANT_READ:
break;
case SSL_ERROR_SYSCALL:
elog(ERROR, "SSL SYSCALL error: %s", strerror(errno));
if (n == -1)
elog(ERROR, "SSL SYSCALL error: %s", strerror(errno));
else
strerror(errno));
break;
case SSL_ERROR_SSL:
elog(ERROR, "SSL error: %s", SSLerrmessage());
@@ -337,7 +340,10 @@ secure_write(Port *port, const void *ptr, size_t len)
case SSL_ERROR_WANT_WRITE:
break;
case SSL_ERROR_SYSCALL:
elog(ERROR, "SSL SYSCALL error: %s", strerror(errno));
if (n == -1)
elog(ERROR, "SSL SYSCALL error: %s", strerror(errno));
else
strerror(errno));
break;
case SSL_ERROR_SSL:
elog(ERROR, "SSL error: %s", SSLerrmessage());