From: William A. Rowe Jr Date: Thu, 21 Feb 2002 02:19:39 +0000 (+0000) Subject: Fix the close-on-sendfile bug where Win32 would transmit a single X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1694b625d930af2760be7d2726bb6a52035aef9;p=apache Fix the close-on-sendfile bug where Win32 would transmit a single sendfile bucket and then lose it's socket, and fix a comment. Submitted by: Ryan Morgan git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93524 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/httpd.h b/include/httpd.h index 254277f984..c6f6d1da8f 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -324,9 +324,9 @@ extern "C" { * APR_HAS_LARGE_FILES introduces the problem of spliting sendfile into * mutiple buckets, no greater than MAX(apr_size_t), and more granular * than that in case the brigade code/filters attempt to read it directly. - * ### 4mb is an invention, no idea if it is reasonable. + * ### 16mb is an invention, no idea if it is reasonable. */ -#define AP_MAX_SENDFILE 16777216 +#define AP_MAX_SENDFILE 16777216 /* 2^24 */ /** * Special Apache error codes. These are basically used diff --git a/server/core.c b/server/core.c index dd019be49f..435030b9ba 100644 --- a/server/core.c +++ b/server/core.c @@ -3633,7 +3633,7 @@ static apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b) hdtr.trailers = vec_trailers; } #if APR_HAS_SENDFILE - if (!c->keepalive) { + if (!c->keepalive && APR_BUCKET_IS_EOS(last_e)) { /* Prepare the socket to be reused */ flags |= APR_SENDFILE_DISCONNECT_SOCKET; }