]> granicus.if.org Git - apache/commitdiff
Fix the close-on-sendfile bug where Win32 would transmit a single
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 21 Feb 2002 02:19:39 +0000 (02:19 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 21 Feb 2002 02:19:39 +0000 (02:19 +0000)
  sendfile bucket and then lose it's socket, and fix a comment.

Submitted by:  Ryan Morgan <rmorgan@covalent.net>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93524 13f79535-47bb-0310-9956-ffa450edef68

include/httpd.h
server/core.c

index 254277f98460603cd54bd9a1530e51ec5b8a3179..c6f6d1da8f0622f988b3b499cdc72a1467569f88 100644 (file)
@@ -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
index dd019be49f0af0728405430edcffbc2dca19eda0..435030b9bab15f020c64099ce3217dbd3a54ea31 100644 (file)
@@ -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;
             }