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

Commitf733828

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 parente9d4aa5 commitf733828

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
@@ -582,11 +582,13 @@ be_tls_read(Port *port, void *ptr, size_t len, int *waitfor)
582582
ereport(COMMERROR,
583583
(errcode(ERRCODE_PROTOCOL_VIOLATION),
584584
errmsg("SSL error: %s",SSLerrmessage(ecode))));
585-
/* fall through */
586-
caseSSL_ERROR_ZERO_RETURN:
587585
errno=ECONNRESET;
588586
n=-1;
589587
break;
588+
caseSSL_ERROR_ZERO_RETURN:
589+
/* connection was cleanly shut down by peer */
590+
n=0;
591+
break;
590592
default:
591593
ereport(COMMERROR,
592594
(errcode(ERRCODE_PROTOCOL_VIOLATION),
@@ -642,8 +644,14 @@ be_tls_write(Port *port, void *ptr, size_t len, int *waitfor)
642644
ereport(COMMERROR,
643645
(errcode(ERRCODE_PROTOCOL_VIOLATION),
644646
errmsg("SSL error: %s",SSLerrmessage(ecode))));
645-
/* fall through */
647+
errno=ECONNRESET;
648+
n=-1;
649+
break;
646650
caseSSL_ERROR_ZERO_RETURN:
651+
/*
652+
* the SSL connnection was closed, leave it to the caller
653+
* to ereport it
654+
*/
647655
errno=ECONNRESET;
648656
n=-1;
649657
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp