]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Only close hdrs.fd when returning non-OK from cache_select(),
authorEric Covener <covener@apache.org>
Wed, 4 Dec 2013 17:09:42 +0000 (17:09 +0000)
committerEric Covener <covener@apache.org>
Wed, 4 Dec 2013 17:09:42 +0000 (17:09 +0000)
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

CHANGES
modules/cache/mod_cache_disk.c

diff --git a/CHANGES b/CHANGES
index 41c5c31b951448f558d010da603ce2b2eb960e39..25224923a26e401437576665b8fcc2d979b032f5 100644 (file)
--- 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]
 
index 2b50aef994496f29b7576fbb012cc922fa5de3e1..83bbc01d3b10747fde80ab7b406f4b01a060df67 100644 (file)
@@ -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;
 }