From: Justin Erenkrantz Date: Mon, 2 Aug 2004 18:39:09 +0000 (+0000) Subject: * modules/experimental/mod_disk_cache.c (open_entity): Allow the data file to X-Git-Tag: pre_ajp_proxy~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59e2bcf76e965246f3611bdb1aa3682eb842ad55;p=apache * modules/experimental/mod_disk_cache.c (open_entity): Allow the data file to 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 --- diff --git a/modules/experimental/mod_disk_cache.c b/modules/experimental/mod_disk_cache.c index 92ae5e1545..3797667f15 100644 --- a/modules/experimental/mod_disk_cache.c +++ b/modules/experimental/mod_disk_cache.c @@ -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;