deal with evbuffer_read() returning -1 on EINTR|EAGAIN; from Adam Langley

svn:r906
This commit is contained in:
Niels Provos 2008-07-12 01:50:11 +00:00
parent dfa53321e3
commit 4a13b22f00
2 changed files with 8 additions and 2 deletions

View File

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

5
http.c
View File

@ -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) {
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 */