]> granicus.if.org Git - apache/commitdiff
* modules/experimental/mod_disk_cache.c (open_entity): Allow the data file to
authorJustin Erenkrantz <jerenkrantz@apache.org>
Mon, 2 Aug 2004 18:39:09 +0000 (18:39 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Mon, 2 Aug 2004 18:39:09 +0000 (18:39 +0000)
  be sent via sendfile() and allow the header file to be buffered.

Reviewed by: Bill Stoddard

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

modules/experimental/mod_disk_cache.c

index 92ae5e15459ae24ae353ac13326f69513ebef854..3797667f15744d47a8b79638031f56c54c20ce9f 100644 (file)
@@ -370,6 +370,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *type, cons
     cache_object_t *obj;
     cache_info *info;
     disk_cache_object_t *dobj;
+    int flags;
 
     h->cache_obj = NULL;
 
@@ -393,14 +394,19 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *type, cons
                           conf->cache_root, key);
 
     /* Open the data file */
-    rc = apr_file_open(&fd, data, APR_READ|APR_BINARY, 0, r->pool);
+    flags = APR_READ|APR_BINARY;
+#ifdef APR_SENDFILE_ENABLED
+    flags |= APR_SENDFILE_ENABLED;
+#endif
+    rc = apr_file_open(&fd, data, flags, 0, r->pool);
     if (rc != APR_SUCCESS) {
         /* XXX: Log message */
         return DECLINED;
     }
 
     /* Open the headers file */
-    rc = apr_file_open(&hfd, headers, APR_READ|APR_BINARY, 0, r->pool);
+    flags = APR_READ|APR_BINARY|APR_BUFFERED;
+    rc = apr_file_open(&hfd, headers, flags, 0, r->pool);
     if (rc != APR_SUCCESS) {
         /* XXX: Log message */
         return DECLINED;