httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject svn commit: r746541 - in /httpd/httpd/trunk: ./ docs/manual/mod/ modules/cache/
Date Sat, 21 Feb 2009 17:07:02 GMT
Author: lars
Date: Sat Feb 21 17:07:01 2009
New Revision: 746541

URL: http://svn.apache.org/viewvc?rev=746541&view=rev
Log:
fix mod_disk_cache to support EnableSendfile.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/core.html.de
    httpd/httpd/trunk/docs/manual/mod/core.html.en
    httpd/httpd/trunk/docs/manual/mod/core.xml
    httpd/httpd/trunk/docs/manual/mod/core.xml.de
    httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.html.en
    httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.xml
    httpd/httpd/trunk/modules/cache/mod_disk_cache.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=746541&r1=746540&r2=746541&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Feb 21 17:07:01 2009
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.3.2
 
+  *) mod_disk_cache: The module now turns off sendfile support if
+     'EnableSendfile off' is defined globally. [Lars Eilebrecht]
+
   *) mod_deflate: Adjust content metadata before bailing out on 304
      responses so that the metadata does not differ from 200 response.
      [Roy T. Fielding]

Modified: httpd/httpd/trunk/docs/manual/mod/core.html.de
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.html.de?rev=746541&r1=746540&r2=746541&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.html.de (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.html.de Sat Feb 21 17:07:01 2009
@@ -978,6 +978,12 @@
       </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├╝tzt 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>

Modified: httpd/httpd/trunk/docs/manual/mod/core.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.html.en?rev=746541&r1=746540&r2=746541&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.html.en Sat Feb 21 17:07:01 2009
@@ -939,6 +939,12 @@
       </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>

Modified: httpd/httpd/trunk/docs/manual/mod/core.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.xml?rev=746541&r1=746540&r2=746541&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.xml Sat Feb 21 17:07:01 2009
@@ -900,6 +900,12 @@
       </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>
 

Modified: httpd/httpd/trunk/docs/manual/mod/core.xml.de
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.xml.de?rev=746541&r1=746540&r2=746541&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.xml.de (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.xml.de Sat Feb 21 17:07:01 2009
@@ -925,6 +925,12 @@
       </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>
 

Modified: httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.html.en?rev=746541&r1=746540&r2=746541&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.html.en Sat Feb 21 17:07:01 2009
@@ -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
@@ -45,6 +45,16 @@
       <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">

Modified: httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.xml?rev=746541&r1=746540&r2=746541&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_disk_cache.xml Sat Feb 21 17:07:01 2009
@@ -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
@@ -43,6 +43,16 @@
       <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>

Modified: httpd/httpd/trunk/modules/cache/mod_disk_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_disk_cache.c?rev=746541&r1=746540&r2=746541&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_disk_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_disk_cache.c Sat Feb 21 17:07:01 2009
@@ -376,6 +376,10 @@
     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;
@@ -471,7 +475,12 @@
     /* 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) {



Mime
View raw message