fix regression from recent refactor that causes infinite loop on unexpected disconnect

This commit is contained in:
Anthony Minessale 2013-11-22 04:53:34 +05:00
parent c07a6b6b9e
commit ca8f121977
1 changed files with 3 additions and 2 deletions

View File

@ -1231,8 +1231,9 @@ static esl_ssize_t handle_recv(esl_handle_t *handle, void *data, esl_size_t data
if ((activity & ESL_POLL_ERROR)) {
activity = -1;
} else if ((activity & ESL_POLL_READ)) {
activity = recv(handle->sock, data, datalen, 0);
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) {
if (!(activity = recv(handle->sock, data, datalen, 0))) {
activity = -1;
} else if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) {
activity = 0;
}
}