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

Commit2a6e1a5

Browse files
committed
Clear retry flags properly in replacement OpenSSL sock_write function.
Current OpenSSL code includes a BIO_clear_retry_flags() step in thesock_write() function. Either we failed to copy the code correctly, orthey added this since we copied it. In any case, lack of the clear stepappears to be the cause of the server lockup after connection loss reportedin bug #8647 from Valentine Gogichashvili. Assume that this is correctcoding for all OpenSSL versions, and hence back-patch to all supportedbranches.Diagnosis and patch by Alexander Kukushkin.
1 parentc6cd27e commit2a6e1a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,10 @@ secure_write(Port *port, void *ptr, size_t len)
411411
* non-reentrant libc facilities. We also need to call send() and recv()
412412
* directly so it gets passed through the socket/signals layer on Win32.
413413
*
414-
* They are closely modelled on the original socket implementations in OpenSSL.
414+
* These functions are closely modelled on the standard socket BIO in OpenSSL;
415+
* see sock_read() and sock_write() in OpenSSL's crypto/bio/bss_sock.c.
416+
* XXX OpenSSL 1.0.1e considers many more errcodes than just EINTR as reasons
417+
* to retry; do we need to adopt their logic for that?
415418
*/
416419

417420
staticboolmy_bio_initialized= false;
@@ -449,6 +452,7 @@ my_sock_write(BIO *h, const char *buf, int size)
449452
intres=0;
450453

451454
res=send(h->num,buf,size,0);
455+
BIO_clear_retry_flags(h);
452456
if (res <=0)
453457
{
454458
if (errno==EINTR)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp