]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_disk_cache now turns off sendfile support if 'EnableSendfile off'
authorLars Eilebrecht <lars@apache.org>
Sat, 21 Feb 2009 17:38:33 +0000 (17:38 +0000)
committerLars Eilebrecht <lars@apache.org>
Sat, 21 Feb 2009 17:38:33 +0000 (17:38 +0000)
is defined globally.

Reviewed by: Ruediger Pluem, Issac Goldstand, Niklas Edmundsson

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@746552 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/core.html.de
docs/manual/mod/core.html.en
docs/manual/mod/core.xml
docs/manual/mod/core.xml.de
docs/manual/mod/mod_disk_cache.html.en
docs/manual/mod/mod_disk_cache.xml
modules/cache/mod_disk_cache.c

diff --git a/CHANGES b/CHANGES
index 0e6c679693381ba35071abb22ebe86bbd7830a68..be07d0b61f2c69c654500e438ca2428e85b5e61a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.12
   
+  *) mod_disk_cache: The module now turns off sendfile support if
+     'EnableSendfile off' is defined globally. PR 41218.
+     [Lars Eilebrecht, Issac Goldstand]
+
  *) prefork: Fix child process hang during graceful restart/stop in
     configurations with multiple listening sockets.  PR 42829.  [Joe Orton,
     Jeff Trawick]
index 0fe9e2343d789bf80718f7ac933efb4b41e97d0b..b36e08274b0fcdc9c5485d546e6c5b59d575b4ac 100644 (file)
@@ -978,6 +978,12 @@ Dateien an den Client auszuliefern</td></tr>
       </span>
       &lt;/Directory&gt;
     </code></p></div>
+    <p>Beachten Sie bitte, dass die verzeichnisbasierte und
+       .htaccess-Konfiguration von <code class="directive">EnableSendfile</code>
+       nicht vom <code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code>-Modul unterst\ufffdtzt wird.
+       Nur die globale Konfiguration von <code class="directive">EnableSendfile</code>
+       wird vom Modul beachtet.
+    </p>
 
 </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
index a55eb5fbbfe0b63498c3f74f3cdc6912c04d63ba..6cee5ce34668e548d0868a6ac4c39034d8f82cf2 100644 (file)
@@ -939,6 +939,12 @@ Locations</a></li>
       </span>
       &lt;/Directory&gt;
     </code></p></div>
+    <p>Please note that the per-directory and .htaccess configuration
+       of <code class="directive">EnableSendfile</code> is not supported by
+       <code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code>.
+       Only global definition of <code class="directive">EnableSendfile</code>
+       is taken into account by the module.
+    </p>
 
 </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
index fa7b9045dccdbf7ef32006b7af2b593866a18bfc..51226b920263f55e966346406f9a33163f88c686 100644 (file)
@@ -903,6 +903,12 @@ Locations</a></seealso>
       </indent>
       &lt;/Directory&gt;
     </example>
+    <p>Please note that the per-directory and .htaccess configuration
+       of <directive>EnableSendfile</directive> is not supported by
+       <module>mod_disk_cache</module>.
+       Only global definition of <directive>EnableSendfile</directive>
+       is taken into account by the module.
+    </p>
 </usage>
 </directivesynopsis>
 
index 431bdf03f0394674f8b2edd28df9563ce6e295b5..3e453096de5c27706c6798c8f1bf1b9496c47428 100644 (file)
@@ -925,6 +925,12 @@ Dateien an den Client auszuliefern</description>
       </indent>
       &lt;/Directory&gt;
     </example>
+    <p>Beachten Sie bitte, dass die verzeichnisbasierte und
+       .htaccess-Konfiguration von <directive>EnableSendfile</directive>
+       nicht vom <module>mod_disk_cache</module>-Modul unterst&uuml;tzt wird.
+       Nur die globale Konfiguration von <directive>EnableSendfile</directive>
+       wird vom Modul beachtet.
+    </p>
 </usage>
 </directivesynopsis>
 
index e29839f16f747b00160c28c3bd5776a82bbdb495..b2ea343777b2fb9dbf4e2afcd6c5ffdd3c4bf06e 100644 (file)
@@ -32,7 +32,7 @@
 <h3>Summary</h3>
 
     <p><code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code> implements a disk based storage
-    manager. It is primarily of use in conjunction
+    manager. It is primarily of use in conjunction with
     <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>.</p>
 
     <p>Content is stored in and retrieved from the cache using URI based
       <p><code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code> requires the services of
       <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code>.</p>
     </div>
+    <div class="note"><h3>Note:</h3>
+      <p><code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code> uses the sendfile feature to
+      serve files from the cache when supported by the platform, and
+      when enabled with <code class="directive"><a href="../mod/core.html#enablesendfile">EnableSendfile</a></code>.
+      However, per-directory and .htaccess configuration of
+      <code class="directive"><a href="../mod/core.html#enablesendfile">EnableSendfile</a></code> are ignored my
+      <code class="module"><a href="../mod/mod_disk_cache.html">mod_disk_cache</a></code> as the corresponding settings are not
+      available to the module when a request is being served from the
+      cache.</p>
+    </div>
 </div>
 <div id="quickview"><h3 class="directives">Directives</h3>
 <ul id="toc">
index 806fe0bb65d683750376c6ef7edfcc4d608571fc..ff2b86a18405e4509420427688ac76adbb2f3d4f 100644 (file)
@@ -30,7 +30,7 @@
 
 <summary>
     <p><module>mod_disk_cache</module> implements a disk based storage
-    manager. It is primarily of use in conjunction
+    manager. It is primarily of use in conjunction with
     <module>mod_cache</module>.</p>
 
     <p>Content is stored in and retrieved from the cache using URI based
       <p><module>mod_disk_cache</module> requires the services of
       <module>mod_cache</module>.</p>
     </note>
+    <note><title>Note:</title>
+      <p><module>mod_disk_cache</module> uses the sendfile feature to
+      serve files from the cache when supported by the platform, and
+      when enabled with <directive module="core">EnableSendfile</directive>.
+      However, per-directory and .htaccess configuration of
+      <directive module="core">EnableSendfile</directive> are ignored my
+      <module>mod_disk_cache</module> as the corresponding settings are not
+      available to the module when a request is being served from the
+      cache.</p>
+    </note>
 </summary>
 
 <directivesynopsis>
index fd7cc6c893bb05555c91018ca8adb0376a2dc587..12dd841e032567e13472b1f6ee391bd3cd58c26a 100644 (file)
@@ -357,6 +357,10 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
     static int error_logged = 0;
     disk_cache_conf *conf = ap_get_module_config(r->server->module_config,
                                                  &disk_cache_module);
+#ifdef APR_SENDFILE_ENABLED
+    core_dir_config *coreconf = ap_get_module_config(r->per_dir_config,
+                                                     &core_module);
+#endif
     apr_finfo_t finfo;
     cache_object_t *obj;
     cache_info *info;
@@ -452,7 +456,12 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
     /* Open the data file */
     flags = APR_READ|APR_BINARY;
 #ifdef APR_SENDFILE_ENABLED
-    flags |= APR_SENDFILE_ENABLED;
+    /* When we are in the quick handler we don't have the per-directory
+     * configuration, so this check only takes the globel setting of
+     * the EnableSendFile directive into account.
+     */
+    flags |= ((coreconf->enable_sendfile == ENABLE_SENDFILE_OFF)
+              ? 0 : APR_SENDFILE_ENABLED);
 #endif
     rc = apr_file_open(&dobj->fd, dobj->datafile, flags, 0, r->pool);
     if (rc != APR_SUCCESS) {