Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb93827c

Browse files
committed
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 anon-SSL connection. In particular, don't write a message in the log aboutthat.Michael Paquier.Discussion:https://www.postgresql.org/message-id/CAB7nPqSfyVV42Q2acFo%3DvrvF2gxoZAMJLAPq3S3KkjhZAYi7aw@mail.gmail.com
1 parentbf723a2 commitb93827c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎src/backend/libpq/be-secure-openssl.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,13 @@ be_tls_read(Port *port, void *ptr, size_t len, int *waitfor)
688688
ereport(COMMERROR,
689689
(errcode(ERRCODE_PROTOCOL_VIOLATION),
690690
errmsg("SSL error: %s",SSLerrmessage(ecode))));
691-
/* fall through */
692-
caseSSL_ERROR_ZERO_RETURN:
693691
errno=ECONNRESET;
694692
n=-1;
695693
break;
694+
caseSSL_ERROR_ZERO_RETURN:
695+
/* connection was cleanly shut down by peer */
696+
n=0;
697+
break;
696698
default:
697699
ereport(COMMERROR,
698700
(errcode(ERRCODE_PROTOCOL_VIOLATION),
@@ -748,8 +750,14 @@ be_tls_write(Port *port, void *ptr, size_t len, int *waitfor)
748750
ereport(COMMERROR,
749751
(errcode(ERRCODE_PROTOCOL_VIOLATION),
750752
errmsg("SSL error: %s",SSLerrmessage(ecode))));
751-
/* fall through */
753+
errno=ECONNRESET;
754+
n=-1;
755+
break;
752756
caseSSL_ERROR_ZERO_RETURN:
757+
/*
758+
* the SSL connnection was closed, leave it to the caller
759+
* to ereport it
760+
*/
753761
errno=ECONNRESET;
754762
n=-1;
755763
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp