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

Commit543e00b

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 parentcc154d9 commit543e00b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,13 @@ secure_read(Port *port, void *ptr, size_t len)
289289
ereport(COMMERROR,
290290
(errcode(ERRCODE_PROTOCOL_VIOLATION),
291291
errmsg("SSL error: %s",SSLerrmessage(ecode))));
292-
/* fall through */
293-
caseSSL_ERROR_ZERO_RETURN:
294292
errno=ECONNRESET;
295293
n=-1;
296294
break;
295+
caseSSL_ERROR_ZERO_RETURN:
296+
/* connection was cleanly shut down by peer */
297+
n=0;
298+
break;
297299
default:
298300
ereport(COMMERROR,
299301
(errcode(ERRCODE_PROTOCOL_VIOLATION),
@@ -414,8 +416,14 @@ secure_write(Port *port, void *ptr, size_t len)
414416
ereport(COMMERROR,
415417
(errcode(ERRCODE_PROTOCOL_VIOLATION),
416418
errmsg("SSL error: %s",SSLerrmessage(ecode))));
417-
/* fall through */
419+
errno=ECONNRESET;
420+
n=-1;
421+
break;
418422
caseSSL_ERROR_ZERO_RETURN:
423+
/*
424+
* the SSL connnection was closed, leave it to the caller
425+
* to ereport it
426+
*/
419427
errno=ECONNRESET;
420428
n=-1;
421429
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp