mirror of
https://github.com/postgres/postgres.git
synced 2025-06-08 22:02:03 +03:00
Treat clean shutdown of an SSL connection same as the non-SSL case.
If the client closes an SSL connection, treat it the same as EOF on a non-SSL connection. In particular, don't write a message in the log about that. Michael Paquier. Discussion: https://www.postgresql.org/message-id/CAB7nPqSfyVV42Q2acFo%3DvrvF2gxoZAMJLAPq3S3KkjhZAYi7aw@mail.gmail.com
This commit is contained in:
parent
5aa8db0148
commit
fb63a0aa33
@ -298,11 +298,13 @@ rloop:
|
|||||||
ereport(COMMERROR,
|
ereport(COMMERROR,
|
||||||
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
||||||
errmsg("SSL error: %s", SSLerrmessage(ecode))));
|
errmsg("SSL error: %s", SSLerrmessage(ecode))));
|
||||||
/* fall through */
|
|
||||||
case SSL_ERROR_ZERO_RETURN:
|
|
||||||
errno = ECONNRESET;
|
errno = ECONNRESET;
|
||||||
n = -1;
|
n = -1;
|
||||||
break;
|
break;
|
||||||
|
case SSL_ERROR_ZERO_RETURN:
|
||||||
|
/* connection was cleanly shut down by peer */
|
||||||
|
n = 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ereport(COMMERROR,
|
ereport(COMMERROR,
|
||||||
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
||||||
@ -423,8 +425,14 @@ wloop:
|
|||||||
ereport(COMMERROR,
|
ereport(COMMERROR,
|
||||||
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
||||||
errmsg("SSL error: %s", SSLerrmessage(ecode))));
|
errmsg("SSL error: %s", SSLerrmessage(ecode))));
|
||||||
/* fall through */
|
errno = ECONNRESET;
|
||||||
|
n = -1;
|
||||||
|
break;
|
||||||
case SSL_ERROR_ZERO_RETURN:
|
case SSL_ERROR_ZERO_RETURN:
|
||||||
|
/*
|
||||||
|
* the SSL connnection was closed, leave it to the caller
|
||||||
|
* to ereport it
|
||||||
|
*/
|
||||||
errno = ECONNRESET;
|
errno = ECONNRESET;
|
||||||
n = -1;
|
n = -1;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user