Re: libpq SSL with non-blocking sockets

Steve Singer <ssinger_pg@sympatico.ca>

From: Steve Singer <ssinger_pg@sympatico.ca>
To: Martin Pihlak <martin.pihlak@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2011-06-30T13:25:14Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Improve libpq's error reporting for SSL failures.

  2. Use OpenSSL's SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag.

On 11-06-28 02:14 PM, Martin Pihlak wrote:
>
> Hmm, I thought I thought about that. There was a check in the original
> patch: "if (conn->sslRetryBytes || (conn->outCount - remaining)>  0)"
> So if the SSL retry buffer was emptied it would return 1 if there was
> something left in the regular output buffer. Or did I miss something
> there?
>

The issue I saw in the original patch was that at that point in the 
function, sslRetryBytes could be zero (if the data was sent) but  
conn->outCount - remaining would be an incorrect value since "remaining" 
is the number of bytes left to send from sslRetryBuf NOT 
conn->outBuffer.   This is no longer an issue in the updated patch.
I will try to take a closer look at your updated patch in the next few days.