diff --git a/ChangeLog b/ChangeLog index 75688e0e..8cbdc118 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ Changes in 1.4.6-stable: o Detect CLOCK_MONOTONIC at runtime for evdns; anonymous bug report o Fix a bug where deleting signals with the kqueue backend would cause subsequent adds to fail o Support multiple events listening on the same signal; make signals regular events that go on the same event queue; problem report by Alexander Drozdov. + o Deal with evbuffer_read() returning -1 on EINTR|EAGAIN; from Adam Langley. Changes in 1.4.5-stable: o Fix connection keep-alive behavior for HTTP/1.0 diff --git a/http.c b/http.c index f4d4a4aa..5c938d0a 100644 --- a/http.c +++ b/http.c @@ -926,8 +926,13 @@ evhttp_read(int fd, short what, void *arg) event_debug(("%s: got %d on %d\n", __func__, n, fd)); if (n == -1) { - event_debug(("%s: evbuffer_read", __func__)); - evhttp_connection_fail(evcon, EVCON_HTTP_EOF); + if (errno != EINTR && errno != EAGAIN) { + event_debug(("%s: evbuffer_read", __func__)); + evhttp_connection_fail(evcon, EVCON_HTTP_EOF); + } else { + evhttp_add_event(&evcon->ev, evcon->timeout, + HTTP_READ_TIMEOUT); + } return; } else if (n == 0) { /* Connection closed */