From: Eric Covener Date: Wed, 4 Dec 2013 17:09:42 +0000 (+0000) Subject: Only close hdrs.fd when returning non-OK from cache_select(), X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfb98016e918a98b5206def024a285551b9b7931;p=thirdparty%2Fapache%2Fhttpd.git Only close hdrs.fd when returning non-OK from cache_select(), because it will be read from in the very next mod_cache callback recall_headers(). Problem masked on unix by buffering. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1547845 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 41c5c31b951..25224923a26 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_cache_disk: Fix potential hangs on Windows when using mod_cache_disk. + PR55833. [Eric Covener] + *) mod_headers: Allow the "value" parameter of Header and RequestHeader to contain an ap_expr expression if prefixed with "expr=". [Eric Covener] diff --git a/modules/cache/mod_cache_disk.c b/modules/cache/mod_cache_disk.c index 2b50aef9944..83bbc01d3b1 100644 --- a/modules/cache/mod_cache_disk.c +++ b/modules/cache/mod_cache_disk.c @@ -529,13 +529,13 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key) return DECLINED; } - apr_file_close(dobj->hdrs.fd); /* Is this a cached HEAD request? */ if (dobj->disk_info.header_only && !r->header_only) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, APLOGNO(00707) "HEAD request cached, non-HEAD requested, ignoring: %s", dobj->hdrs.file); + apr_file_close(dobj->hdrs.fd); return DECLINED; } @@ -593,6 +593,7 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key) "Cached URL info header '%s' didn't match body, ignoring this entry", dobj->name); + apr_file_close(dobj->hdrs.fd); return DECLINED; }