From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix poor errno handling in libpq's version of our custom OpenSSL |
Date: | 2015-09-28 22:02:50 |
Message-ID: | E1ZggVW-0005kx-PJ@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix poor errno handling in libpq's version of our custom OpenSSL BIO.
Thom Brown reported that SSL connections didn't seem to work on Windows in
9.5. Asif Naeem figured out that the cause was my_sock_read() looking at
"errno" when it needs to look at "SOCK_ERRNO". This mistake was introduced
in commit 680513ab79c7e12e402a2aad7921b95a25a4bcc8, which cloned the
backend's custom SSL BIO code into libpq, and didn't translate the errno
handling properly. Moreover, it introduced unnecessary errno save/restore
logic, which was particularly confusing because it was incomplete; and it
failed to check for all three of EINTR, EAGAIN, and EWOULDBLOCK in
my_sock_write. (That might not be necessary; but since we're copying
well-tested backend code that does do that, it seems prudent to copy it
faithfully.)
Branch
------
REL9_5_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/b67c9c1939f10e94186d2736039ff623dbb2ce3f
Modified Files
--------------
src/interfaces/libpq/fe-secure-openssl.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2015-09-28 22:20:05 | pgsql: Fix "sesssion" typo |
Previous Message | Tom Lane | 2015-09-28 20:34:34 | Re: Rename withCheckOptions to insertedCheckClauses |