You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2011/06/23 16:14:11 UTC
svn commit: r1138891 - in /subversion/trunk/subversion/libsvn_ra_serf:
commit.c locks.c ra_serf.h util.c
Author: philip
Date: Thu Jun 23 14:14:10 2011
New Revision: 1138891
URL: http://svn.apache.org/viewvc?rev=1138891&view=rev
Log:
Fix issue 3935, redirect tests FAIL due to pool lifetime.
* subversion/libsvn_ra_serf/ra_serf.h
(struct svn_ra_serf__simple_request_context_t): Add pool member.
* subversion/libsvn_ra_serf/util.c
(svn_ra_serf__handle_status_only,
svn_ra_serf__handle_multistatus_only): Assert pool member is set,
allocate location and reason in context pool.
(svn_ra_serf__handle_xml_parser): Allocate location in context pool.
* subversion/libsvn_ra_serf/locks.c
(svn_ra_serf__unlock): Initialise pool member.
* subversion/libsvn_ra_serf/commit.c
(checkout_dir, checkout_file, setup_copy_dir_headers,
open_root, delete_entry, add_directory, close_directory,
add_file, close_file, close_edit, abort_edit,
svn_ra_serf__change_rev_prop): Initialise pool member.
Modified:
subversion/trunk/subversion/libsvn_ra_serf/commit.c
subversion/trunk/subversion/libsvn_ra_serf/locks.c
subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
subversion/trunk/subversion/libsvn_ra_serf/util.c
Modified: subversion/trunk/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/commit.c?rev=1138891&r1=1138890&r2=1138891&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Thu Jun 23 14:14:10 2011
@@ -372,6 +372,7 @@ checkout_dir(dir_context_t *dir)
/* Implicitly checkout this dir now. */
dir->checkout = apr_pcalloc(dir->pool, sizeof(*dir->checkout));
dir->checkout->pool = dir->pool;
+ dir->checkout->progress.pool = dir->pool;
dir->checkout->activity_url = dir->commit->activity_url;
dir->checkout->resource_url =
svn_path_url_add_component2(dir->parent_dir->checkout->resource_url,
@@ -390,6 +391,7 @@ checkout_dir(dir_context_t *dir)
checkout_ctx = apr_pcalloc(dir->pool, sizeof(*checkout_ctx));
checkout_ctx->pool = dir->pool;
+ checkout_ctx->progress.pool = dir->pool;
checkout_ctx->activity_url = dir->commit->activity_url;
@@ -558,6 +560,7 @@ checkout_file(file_context_t *file)
/* Implicitly checkout this file now. */
file->checkout = apr_pcalloc(file->pool, sizeof(*file->checkout));
file->checkout->pool = file->pool;
+ file->checkout->progress.pool = file->pool;
file->checkout->activity_url = file->commit->activity_url;
file->checkout->resource_url =
svn_path_url_add_component2(parent_dir->checkout->resource_url,
@@ -577,6 +580,7 @@ checkout_file(file_context_t *file)
file->checkout = apr_pcalloc(file->pool, sizeof(*file->checkout));
file->checkout->pool = file->pool;
+ file->checkout->progress.pool = file->pool;
file->checkout->activity_url = file->commit->activity_url;
@@ -1129,6 +1133,7 @@ setup_copy_dir_headers(serf_bucket_t *he
/* Implicitly checkout this dir now. */
dir->checkout = apr_pcalloc(dir->pool, sizeof(*dir->checkout));
dir->checkout->pool = dir->pool;
+ dir->checkout->progress.pool = dir->pool;
dir->checkout->activity_url = dir->commit->activity_url;
dir->checkout->resource_url = apr_pstrdup(dir->checkout->pool, uri.path);
@@ -1341,6 +1346,7 @@ open_root(void *edit_baton,
handler->session = ctx->session;
post_ctx = apr_pcalloc(ctx->pool, sizeof(*post_ctx));
+ post_ctx->pool = ctx->pool;
prc = apr_pcalloc(ctx->pool, sizeof(*prc));
prc->request_ctx = post_ctx;
@@ -1422,6 +1428,7 @@ open_root(void *edit_baton,
handler->session = ctx->session;
mkact_ctx = apr_pcalloc(ctx->pool, sizeof(*mkact_ctx));
+ mkact_ctx->pool = ctx->pool;
handler->response_handler = svn_ra_serf__handle_status_only;
handler->response_baton = mkact_ctx;
@@ -1471,6 +1478,7 @@ open_root(void *edit_baton,
/* PROPPATCH our revprops and pass them along. */
proppatch_ctx = apr_pcalloc(ctx->pool, sizeof(*proppatch_ctx));
proppatch_ctx->pool = dir_pool;
+ proppatch_ctx->progress.pool = dir_pool;
proppatch_ctx->commit = ctx;
proppatch_ctx->path = proppatch_target;
proppatch_ctx->changed_props = apr_hash_make(proppatch_ctx->pool);
@@ -1540,6 +1548,7 @@ delete_entry(const char *path,
/* DELETE our entry */
delete_ctx = apr_pcalloc(pool, sizeof(*delete_ctx));
+ delete_ctx->progress.pool = pool;
delete_ctx->path = apr_pstrdup(pool, path);
delete_ctx->revision = revision;
delete_ctx->lock_token_hash = dir->commit->lock_tokens;
@@ -1656,6 +1665,7 @@ add_directory(const char *path,
handler->session = dir->commit->session;
add_dir_ctx = apr_pcalloc(dir->pool, sizeof(*add_dir_ctx));
+ add_dir_ctx->pool = dir->pool;
handler->response_handler = svn_ra_serf__handle_status_only;
handler->response_baton = add_dir_ctx;
@@ -1823,6 +1833,7 @@ close_directory(void *dir_baton,
proppatch_ctx = apr_pcalloc(pool, sizeof(*proppatch_ctx));
proppatch_ctx->pool = pool;
+ proppatch_ctx->progress.pool = pool;
proppatch_ctx->commit = dir->commit;
proppatch_ctx->name = dir->name;
proppatch_ctx->changed_props = dir->changed_props;
@@ -1907,6 +1918,7 @@ add_file(const char *path,
svn_ra_serf__handler_t *handler;
head_ctx = apr_pcalloc(new_file->pool, sizeof(*head_ctx));
+ head_ctx->pool = new_file->pool;
handler = apr_pcalloc(new_file->pool, sizeof(*handler));
handler->session = new_file->commit->session;
@@ -2091,6 +2103,7 @@ close_file(void *file_baton,
handler->session = ctx->commit->session;
copy_ctx = apr_pcalloc(pool, sizeof(*copy_ctx));
+ copy_ctx->pool = pool;
handler->response_handler = svn_ra_serf__handle_status_only;
handler->response_baton = copy_ctx;
@@ -2128,6 +2141,7 @@ close_file(void *file_baton,
handler->session = ctx->commit->session;
put_ctx = apr_pcalloc(pool, sizeof(*put_ctx));
+ put_ctx->pool = pool;
handler->response_handler = svn_ra_serf__handle_status_only;
handler->response_baton = put_ctx;
@@ -2170,6 +2184,7 @@ close_file(void *file_baton,
proppatch = apr_pcalloc(ctx->pool, sizeof(*proppatch));
proppatch->pool = ctx->pool;
+ proppatch->progress.pool = pool;
proppatch->name = ctx->name;
proppatch->path = ctx->url;
proppatch->commit = ctx->commit;
@@ -2227,6 +2242,7 @@ close_edit(void *edit_baton,
handler->session = ctx->session;
delete_ctx = apr_pcalloc(pool, sizeof(*delete_ctx));
+ delete_ctx->pool = pool;
handler->response_handler = svn_ra_serf__handle_status_only;
handler->response_baton = delete_ctx;
@@ -2266,6 +2282,7 @@ abort_edit(void *edit_baton,
handler->session = ctx->session;
delete_ctx = apr_pcalloc(pool, sizeof(*delete_ctx));
+ delete_ctx->pool = pool;
handler->response_handler = svn_ra_serf__handle_status_only;
handler->response_baton = delete_ctx;
@@ -2427,6 +2444,7 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
/* PROPPATCH our log message and pass it along. */
proppatch_ctx = apr_pcalloc(pool, sizeof(*proppatch_ctx));
proppatch_ctx->pool = pool;
+ proppatch_ctx->progress.pool = pool;
proppatch_ctx->commit = commit;
proppatch_ctx->path = proppatch_target;
proppatch_ctx->changed_props = apr_hash_make(proppatch_ctx->pool);
Modified: subversion/trunk/subversion/libsvn_ra_serf/locks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/locks.c?rev=1138891&r1=1138890&r2=1138891&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/locks.c Thu Jun 23 14:14:10 2011
@@ -705,6 +705,7 @@ svn_ra_serf__unlock(svn_ra_session_t *ra
svn_pool_clear(subpool);
ctx = apr_pcalloc(subpool, sizeof(*ctx));
+ ctx->pool = subpool;
apr_hash_this(hi, &key, NULL, &val);
path = key;
Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1138891&r1=1138890&r2=1138891&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Thu Jun 23 14:14:10 2011
@@ -654,6 +654,8 @@ typedef struct svn_ra_serf__server_error
/* A simple request context that can be passed to handle_status_only. */
typedef struct svn_ra_serf__simple_request_context_t {
+ apr_pool_t *pool;
+
/* The HTTP status code of the response */
int status;
Modified: subversion/trunk/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/util.c?rev=1138891&r1=1138890&r2=1138891&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/util.c Thu Jun 23 14:14:10 2011
@@ -917,6 +917,8 @@ svn_ra_serf__handle_status_only(serf_req
svn_error_t *err;
svn_ra_serf__simple_request_context_t *ctx = baton;
+ SVN_ERR_ASSERT(ctx->pool);
+
err = svn_ra_serf__handle_discard_body(request, response,
&ctx->server_error, pool);
@@ -932,8 +934,8 @@ svn_ra_serf__handle_status_only(serf_req
}
ctx->status = sl.code;
- ctx->reason = sl.reason;
- ctx->location = svn_ra_serf__response_get_location(response, pool);
+ ctx->reason = sl.reason ? apr_pstrdup(ctx->pool, sl.reason) : NULL;
+ ctx->location = svn_ra_serf__response_get_location(response, ctx->pool);
ctx->done = TRUE;
}
@@ -1077,6 +1079,8 @@ svn_ra_serf__handle_multistatus_only(ser
svn_ra_serf__simple_request_context_t *ctx = baton;
svn_ra_serf__server_error_t *server_err = &ctx->server_error;
+ SVN_ERR_ASSERT(ctx->pool);
+
/* If necessary, initialize our XML parser. */
if (server_err && !server_err->init)
{
@@ -1148,8 +1152,8 @@ svn_ra_serf__handle_multistatus_only(ser
}
ctx->status = sl.code;
- ctx->reason = sl.reason;
- ctx->location = svn_ra_serf__response_get_location(response, pool);
+ ctx->reason = sl.reason ? apr_pstrdup(ctx->pool, sl.reason) : NULL;
+ ctx->location = svn_ra_serf__response_get_location(response, ctx->pool);
}
return svn_error_return(err);
@@ -1482,7 +1486,7 @@ svn_ra_serf__handle_xml_parser(serf_requ
if (sl.code == 301 || sl.code == 302 || sl.code == 307)
{
- ctx->location = svn_ra_serf__response_get_location(response, pool);
+ ctx->location = svn_ra_serf__response_get_location(response, ctx->pool);
}
/* Woo-hoo. Nothing here to see. */