From 0ae42ca8ab8daa81b7fe87ebcbb9dfb96121a75f Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Fri, 22 Dec 2000 23:43:16 +0000 Subject: [PATCH] If we get EAGAIN returned from apr_sendfile, then we need to loop back and call it again. This change allows us to serve large files (such as apache_2.0a9.tar.gz) using Apache 2.0 on FreeBSD. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87514 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/http/http_core.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 7ebeb8f1f5..afdf085959 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0b1 + *) If we get EAGAIN returned from the call to apr_sendfile, then we + need to call sendfile again. This gets us serving large files + such as apache_2.0a9.tar.gz on FreeBSD again. [Ryan Bloom] + *) Get the support programs building cleanly again. [Cliff Woolley ] diff --git a/modules/http/http_core.c b/modules/http/http_core.c index d680ca7a67..e2d156c506 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -2605,7 +2605,7 @@ static apr_status_t sendfile_it_all(conn_rec *c, rv = apr_sendfile(c->client_socket, fd, hdtr, &file_offset, &tmplen, flags); total_bytes_left -= tmplen; - if (!total_bytes_left || rv != APR_SUCCESS) { + if (!total_bytes_left || (rv != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(rv))) { return rv; /* normal case & error exit */ } -- 2.50.1