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
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