httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r1405856 - /httpd/httpd/trunk/modules/cache/mod_cache_disk.c
Date Mon, 05 Nov 2012 16:01:24 GMT
Author: rpluem
Date: Mon Nov  5 16:01:23 2012
New Revision: 1405856

URL: http://svn.apache.org/viewvc?rev=1405856&view=rev
Log:
* fd is no member of disk_cache_object_t. Instead it is a member of
  disk_cache_file_t. Close all fd's (fd, tempfd) for all cache elements
  (hdrs, data, vary) if they are present.

Modified:
    httpd/httpd/trunk/modules/cache/mod_cache_disk.c

Modified: httpd/httpd/trunk/modules/cache/mod_cache_disk.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_cache_disk.c?rev=1405856&r1=1405855&r2=1405856&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache_disk.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_cache_disk.c Mon Nov  5 16:01:23 2012
@@ -594,12 +594,25 @@ static int open_entity(cache_handle_t *h
     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;



Mime
View raw message