Commit 98ea03e5 authored by Jean-Frederic Clere's avatar Jean-Frederic Clere
Browse files

Use a global pool for global pool.

Remove the file containing the slotmems if its size has changed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpd-proxy-scoreboard@428435 13f79535-47bb-0310-9956-ffa450edef68
parent 8337c572
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -40,7 +40,16 @@ static int initialize_cleanup(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp
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;
}

+4 −0
Original line number Diff line number Diff line
@@ -110,6 +110,10 @@ void restore_slotmem(void *ptr, const char *name, apr_size_t item_size, int item
        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);