]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* fd is no member of disk_cache_object_t. Instead it is a member of
authorRuediger Pluem <rpluem@apache.org>
Mon, 5 Nov 2012 16:01:23 +0000 (16:01 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 5 Nov 2012 16:01:23 +0000 (16:01 +0000)
  disk_cache_file_t. Close all fd's (fd, tempfd) for all cache elements
  (hdrs, data, vary) if they are present.

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

modules/cache/mod_cache_disk.c

index a024b7176fea676fc7d0d8f0bab96dba05915f65..8427e8fd60f947d8499c10b5f116b7cce07a4581 100644 (file)
@@ -594,12 +594,25 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
     return DECLINED;
 }
 
+static void close_disk_cache_fd(disk_cache_file_t *file)
+{
+   if (file->fd != NULL) {
+       apr_file_close(file->fd);
+       file->fd = NULL;
+   }
+   if (file->tempfd != NULL) {
+       apr_file_close(file->tempfd);
+       file->tempfd = NULL;
+   }
+}
+
 static int remove_entity(cache_handle_t *h)
 {
     disk_cache_object_t *dobj = (disk_cache_object_t *) h->cache_obj->vobj;
-    if (dobj->fd != NULL) {
-        apr_file_close(dobj->fd);
-    }
+
+    close_disk_cache_fd(&(dobj->hdrs));
+    close_disk_cache_fd(&(dobj->vary));
+    close_disk_cache_fd(&(dobj->data));
 
     /* Null out the cache object pointer so next time we start from scratch  */
     h->cache_obj = NULL;