1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00

fix mod_disk_cache to support EnableSendfile.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@746541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lars Eilebrecht
2009-02-21 17:07:01 +00:00
parent 477355f136
commit 77188b407d
8 changed files with 59 additions and 3 deletions

View File

@@ -376,6 +376,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;
@@ -471,7 +475,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) {