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

Commit74242c2

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 parent07aeb1f commit74242c2

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
@@ -464,7 +464,10 @@ secure_write(Port *port, void *ptr, size_t len)
464464
* non-reentrant libc facilities. We also need to call send() and recv()
465465
* directly so it gets passed through the socket/signals layer on Win32.
466466
*
467-
* They are closely modelled on the original socket implementations in OpenSSL.
467+
* These functions are closely modelled on the standard socket BIO in OpenSSL;
468+
* see sock_read() and sock_write() in OpenSSL's crypto/bio/bss_sock.c.
469+
* XXX OpenSSL 1.0.1e considers many more errcodes than just EINTR as reasons
470+
* to retry; do we need to adopt their logic for that?
468471
*/
469472

470473
staticboolmy_bio_initialized= false;
@@ -502,6 +505,7 @@ my_sock_write(BIO *h, const char *buf, int size)
502505
intres=0;
503506

504507
res=send(h->num,buf,size,0);
508+
BIO_clear_retry_flags(h);
505509
if (res <=0)
506510
{
507511
if (errno==EINTR)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp