Re: Nonblocking libpq + openssl = ? - Mailing list pgsql-general

From Nikolai Zhubr
Subject Re: Nonblocking libpq + openssl = ?
Date
Msg-id 57DD41BD.6020805@yandex.ru
Whole thread Raw
In response to Re: Nonblocking libpq + openssl = ?  (Andres Freund <andres@anarazel.de>)
List pgsql-general
17.09.2016 3:27, Andres Freund:
[...]
> 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.

I think this is actually not entirely correct.
PQisBusy is fine, I do not see a need to touch it at all.
Rather, the return value of PQConsumeInput could be extended (in fact
has just been extended by me here) as follows:

Old spec:
0 == error
1 == no error

New spec:
0 == error
1 == no error
2 == no error but can't proceed until pending write finished.

Agreed, this is still an incompatible API change, but not excessively
destructive and it should be fairly easy to make adjustments for such
change (unless the usage has already been hopelessly broken).


Thank you,
Regards,
Nikolai

>
> Greetings,
>
> Andres Freund
>
>



pgsql-general by date:

Previous
From: Deven Phillips
Date:
Subject: Re: Verifying LISTEN subscriptions?
Next
From: Melvin Davidson
Date:
Subject: Re: question on error during COPY FROM