Commit 209397bd authored by Shijin Kong's avatar Shijin Kong Committed by facebook-github-bot-1

return read error on non EAGAIN errno

Summary: Tested over weekend with D2571554. There was no EXC_RESOURCE/CPU crash when read errrors were returned on ENOTCONN. EAGAIN seems innocent as the spin detector was disabled on testing group.

Patch folly. I can add #ifdef __APPLE__ around the errno checking code but this should be good practice for non apple code as well.

I will remove debugging code in fbios master in another diff.

Reviewed By: djwatson

Differential Revision: D2580819

fb-gh-sync-id: 9162a3deba01af8b07cd2b336d7da3da040c67a9
parent 6b17defc
......@@ -1164,7 +1164,11 @@ AsyncSSLSocket::performRead(void** buf, size_t* buflen, size_t* offset) {
int error = SSL_get_error(ssl_, bytes);
if (error == SSL_ERROR_WANT_READ) {
// The caller will register for read event if not already.
return READ_BLOCKING;
if (errno == EWOULDBLOCK || errno == EAGAIN) {
return READ_BLOCKING;
} else {
return READ_ERROR;
}
} else if (error == SSL_ERROR_WANT_WRITE) {
// TODO: Even though we are attempting to read data, SSL_read() may
// need to write data if renegotiation is being performed. We currently
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment