From c1662bcf8a44714f83968515817aeb563497ebbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Thu, 31 Jul 2008 10:28:20 +0000 Subject: [PATCH] Handle EAGAIN and EINTR for freebsd sendfile (#1675) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2256 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/network_freebsd_sendfile.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 1027340d..5e5fe9a9 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,7 @@ NEWS * case insensitive match for secdownload md5 token (#1710) * Handle only HEAD, GET and POST in mod_dirlisting (same as in staticfile) (#1687) * fixed mod_secdownload problem with unsigned time_t (#1688) + * handle EAGAIN and EINTR for freebsd sendfile (#1675) - 1.4.19 - 2008-03-10 diff --git a/src/network_freebsd_sendfile.c b/src/network_freebsd_sendfile.c index 61508343..a54a4754 100644 --- a/src/network_freebsd_sendfile.c +++ b/src/network_freebsd_sendfile.c @@ -166,6 +166,7 @@ int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int f if (-1 == sendfile(c->file.fd, fd, offset, toSend, NULL, &r, 0)) { switch(errno) { case EAGAIN: + case EINTR: break; case ENOTCONN: return -2; @@ -175,7 +176,7 @@ int network_write_chunkqueue_freebsdsendfile(server *srv, connection *con, int f } } - if (r == 0) { + if (r == 0 && (errno != EAGAIN && errno != EINTR)) { int oerrno = errno; /* We got an event to write but we wrote nothing *