Andres Freund <andres@anarazel.de> writes:
> There goes that theory. Amongst others. The aforementioned problem with
> waitfor doesn't seem to be actually armed because waitfor is only used
> if errno == EWOULDBLOCK || errno == EAGAIN.
Mumble. It is clearly possible that we'd reach the Assert failure if
SSL_read were to return -1 and set errno to EWOULDBLOCK or EAGAIN.
I doubt that is what is happening here, because those errnos don't
seem sensible for an EOF condition, but I'd still feel more comfortable
if be_tls_read/be_tls_write handled SSL_ERROR_SYSCALL like this:
if (n != -1) { errno = ECONNRESET; n = -1; }
+ else
+ {
+ /* just in case errno is EWOULDBLOCK/EAGAIN */
+ *waitfor = WL_SOCKET_READABLE | WL_SOCKET_WRITEABLE;
+ }
regards, tom lane