From: Greg Stein Date: Thu, 23 Nov 2000 11:44:22 +0000 (+0000) Subject: dav_resource should carry around a pool for allocations related to it X-Git-Tag: moving_to_httpd_module~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f71c71e7b50d0386564ae148a85d81c80ac5cd57;p=apache dav_resource should carry around a pool for allocations related to it git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87074 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index 9c17270b58..c168d2a9f2 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -616,9 +616,11 @@ static dav_resource * dav_fs_get_resource( /* Create private resource context descriptor */ ctx = apr_pcalloc(r->pool, sizeof(*ctx)); - ctx->pool = r->pool; ctx->finfo = r->finfo; + /* ### this should go away */ + ctx->pool = r->pool; + /* Preserve case on OSes which fold canonical filenames */ #if 0 /* ### not available in Apache 2.0 yet */ @@ -647,6 +649,7 @@ static dav_resource * dav_fs_get_resource( resource->type = DAV_RESOURCE_TYPE_REGULAR; resource->info = ctx; resource->hooks = &dav_hooks_repository_fs; + resource->pool = r->pool; /* make sure the URI does not have a trailing "/" */ len = strlen(r->uri); @@ -719,6 +722,8 @@ static dav_resource * dav_fs_get_parent_resource(const dav_resource *resource) /* Create private resource context descriptor */ parent_ctx = apr_pcalloc(ctx->pool, sizeof(*parent_ctx)); + + /* ### this should go away */ parent_ctx->pool = ctx->pool; dirpath = ap_make_dirstr_parent(ctx->pool, ctx->pathname); @@ -730,6 +735,7 @@ static dav_resource * dav_fs_get_parent_resource(const dav_resource *resource) parent_resource->info = parent_ctx; parent_resource->collection = 1; parent_resource->hooks = &dav_hooks_repository_fs; + parent_resource->pool = resource->pool; if (resource->uri != NULL) { char *uri = ap_make_dirstr_parent(ctx->pool, resource->uri); @@ -1604,6 +1610,7 @@ static dav_error * dav_fs_internal_walk(const dav_walk_params *params, /* ### zero out versioned, working, baselined? */ fsctx.res1 = *params->root; + fsctx.res1.pool = params->pool; fsctx.res1.info = &fsctx.info1; fsctx.info1 = *params->root->info; @@ -1625,6 +1632,7 @@ static dav_error * dav_fs_internal_walk(const dav_walk_params *params, fsctx.res2.exists = 0; fsctx.res2.collection = 0; fsctx.res2.uri = NULL; /* we don't track this */ + fsctx.res2.pool = params->pool; fsctx.res2.info = &fsctx.info2; fsctx.info2 = *root_dst->info; diff --git a/modules/dav/main/mod_dav.h b/modules/dav/main/mod_dav.h index ef2e4c0cbf..7f876d5fe0 100644 --- a/modules/dav/main/mod_dav.h +++ b/modules/dav/main/mod_dav.h @@ -393,6 +393,11 @@ typedef struct dav_resource { const dav_hooks_repository *hooks; /* hooks used for this resource */ + /* When allocating items related specifically to this resource, the + following pool should be used. Its lifetime will be at least as + long as the dav_resource structure. */ + apr_pool_t *pool; + } dav_resource; /*