aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_freebsd_sendfile_chain.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-10-21 16:49:56 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-10-21 16:49:56 +0000
commit419f9aceb4d994c2f7f51400f59fb2da0ed666d4 (patch)
treee32162d1d3833491fc1a95780880099f2ef6857f /src/os/unix/ngx_freebsd_sendfile_chain.c
parent9760a1336f0eb4057b6e2ccdd4b0145087102b17 (diff)
downloadnginx-419f9aceb4d994c2f7f51400f59fb2da0ed666d4.tar.gz
nginx-419f9aceb4d994c2f7f51400f59fb2da0ed666d4.zip
nginx-0.0.1-2003-10-21-20:49:56 import
Diffstat (limited to 'src/os/unix/ngx_freebsd_sendfile_chain.c')
-rw-r--r--src/os/unix/ngx_freebsd_sendfile_chain.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c
index 1633b2fb8..1632424ce 100644
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c
@@ -154,6 +154,11 @@ ngx_log_debug(c->log, "NOPUSH");
hdtr.trailers = (struct iovec *) trailer.elts;
hdtr.trl_cnt = trailer.nelts;
+ /*
+ * the old sendfile() "nbytes bug":
+ * http://www.freebsd.org/cgi/query-pr.cgi?pr=33771
+ */
+
if (ngx_freebsd_sendfile_nbytes_bug == 0) {
hsize = 0;
}
@@ -194,7 +199,6 @@ ngx_log_debug(c->log, "NOPUSH");
if (rc == -1) {
err = ngx_errno;
if (err == NGX_EAGAIN) {
- eagain = 1;
ngx_log_error(NGX_LOG_INFO, c->log, err, "writev() EAGAIN");
} else if (err == NGX_EINTR) {
@@ -256,6 +260,11 @@ ngx_log_debug(c->log, "NOPUSH");
in = ce;
if (eagain) {
+ /*
+ * sendfile() can return EAGAIN even if it has sent
+ * a whole file part and successive sendfile() would
+ * return EAGAIN right away and would not send anything.
+ */
c->write->ready = 0;
break;
}