Clear retry flags properly in replacement OpenSSL sock_write function.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 2a6e1a55454bababea78af2db2f95c6eb7dd8ed5
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2013-12-05T17:48:31Z
Releases: 9.3.3
Clear retry flags properly in replacement OpenSSL sock_write function.

Current OpenSSL code includes a BIO_clear_retry_flags() step in the
sock_write() function.  Either we failed to copy the code correctly, or
they added this since we copied it.  In any case, lack of the clear step
appears to be the cause of the server lockup after connection loss reported
in bug #8647 from Valentine Gogichashvili.  Assume that this is correct
coding for all OpenSSL versions, and hence back-patch to all supported
branches.

Diagnosis and patch by Alexander Kukushkin.

Files

PathChange+/−
src/backend/libpq/be-secure.c modified +5 −1