You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jf...@apache.org on 2006/08/03 17:56:20 UTC

svn commit: r428435 - in /httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem: mod_sharedmem.c sharedmem_util.c

Author: jfclere
Date: Thu Aug  3 08:56:20 2006
New Revision: 428435

URL: http://svn.apache.org/viewvc?rev=428435&view=rev
Log:
Use a global pool for global pool.
Remove the file containing the slotmems if its size has changed.

Modified:
    httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c
    httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/sharedmem_util.c

Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c?rev=428435&r1=428434&r2=428435&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/mod_sharedmem.c Thu Aug  3 08:56:20 2006
@@ -40,7 +40,16 @@
 static int pre_config(apr_pool_t *p, apr_pool_t *plog,
                              apr_pool_t *ptemp)
 {
-    sharedmem_initglobalpool(p);
+    apr_pool_t *global_pool;
+    apr_status_t rv;
+
+    rv = apr_pool_create(&global_pool, NULL);
+    if (rv != APR_SUCCESS) {
+        ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
+                     "Fatal error: unable to create global pool for shared slotmem");
+        return rv;
+    }
+    sharedmem_initglobalpool(global_pool);
     return OK;
 }
 

Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/sharedmem_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/sharedmem_util.c?rev=428435&r1=428434&r2=428435&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/sharedmem_util.c (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/mem/sharedmem_util.c Thu Aug  3 08:56:20 2006
@@ -110,6 +110,10 @@
         if (apr_file_info_get(&fi, APR_FINFO_SIZE, fp) == APR_SUCCESS) {
             if (fi.size == nbytes) {
                 apr_file_read(fp, ptr, &nbytes);
+            } else {
+                apr_file_close(fp);
+                apr_file_remove(storename, pool);
+                return;
             }
         }
         apr_file_close(fp);