Re: Nonblocking libpq + openssl = ?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Nikolai Zhubr <n-a-zhubr(at)yandex(dot)ru>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Nonblocking libpq + openssl = ?
Date: 2016-09-17 00:27:51
Message-ID: 20160917002751.dkouyyveefyvbjfq@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2016-09-17 03:12:53 +0300, Nikolai Zhubr wrote:
> 17.09.2016 2:05, Andres Freund:
> [...]
> > Well, it's not pretty. I quite dislike this bit, and I've complained
> > about it before. But it is noteworthy that it's nearly impossible to
> > hit these days, due to ssl-renegotiation support having been ripped out.
> > That's what could trigger openssl to require writes upon reads.
>
> Looks like it _usually_ happens so that such interdependent reads and writes
> are unnecessary in the absence of renegotiations. But still [1] instructs to
> always check for both SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE in all
> cases. Supposedly it is for a reason. The way it is implemented in
> fe-secure-openssl.c looks just somewhat unfinished.
> I'm wondering is there really something that prevents doing it properly?

The relevant user-level API of libpq (PQisBusy) doesn't have a way to
return "waiting for write". So we'd have to break API compatibility.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nikolai Zhubr 2016-09-17 08:15:12 Re: Nonblocking libpq + openssl = ?
Previous Message Nikolai Zhubr 2016-09-17 00:12:53 Re: Nonblocking libpq + openssl = ?