subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1335250 - in /subversion/trunk/subversion/libsvn_ra_serf: commit.c locks.c ra_serf.h util.c
Date Mon, 07 May 2012 20:47:21 GMT
Author: gstein
Date: Mon May  7 20:47:20 2012
New Revision: 1335250

URL: http://svn.apache.org/viewvc?rev=1335250&view=rev
Log:
Remove the POOL member from the simple request context.

* subversion/libsvn_ra_serf/ra_serf.h:
  (svn_ra_serf__server_error_t): remove POOL member

* subversion/libsvn_ra_serf/locks.c:
  (svn_ra_serf__unlock): don't initialize POOL

* subversion/libsvn_ra_serf/util.c:
  (svn_ra_serf__handle_status_only): don't test POOL
  (handle_response): add some comments. shift assignment of LOCATION
    to right after the headers have been fully read.

* subversion/libsvn_ra_serf/commit.c:
  (checkout_dir, checkout_file, open_root, delete_entry,
      add_directory, close_directory, add_file, close_file,
      close_edit, abort_edit, svn_ra_serf__change_rev_prop): don't
    initialize the 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=1335250&r1=1335249&r2=1335250&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Mon May  7 20:47:20 2012
@@ -366,7 +366,6 @@ checkout_dir(dir_context_t *dir)
 
   checkout_ctx = apr_pcalloc(dir->pool, sizeof(*checkout_ctx));
   checkout_ctx->handler = handler;
-  checkout_ctx->progress.pool = dir->pool;
   checkout_ctx->result_pool = dir->pool;
   checkout_ctx->activity_url = dir->commit->activity_url;
 
@@ -555,7 +554,6 @@ checkout_file(file_context_t *file)
 
   file->checkout = apr_pcalloc(file->pool, sizeof(*file->checkout));
   file->checkout->handler = handler;
-  file->checkout->progress.pool = file->pool;
   file->checkout->result_pool = file->pool;
   file->checkout->activity_url = file->commit->activity_url;
 
@@ -1323,7 +1321,6 @@ 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;
@@ -1419,7 +1416,6 @@ 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;
@@ -1482,7 +1478,6 @@ 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);
@@ -1552,7 +1547,6 @@ 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;
@@ -1673,7 +1667,6 @@ 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;
@@ -1849,7 +1842,6 @@ 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->relpath = dir->relpath;
       proppatch_ctx->changed_props = dir->changed_props;
@@ -1934,7 +1926,6 @@ 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->handler_pool = new_file->pool;
@@ -2122,7 +2113,6 @@ 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;
@@ -2163,7 +2153,6 @@ 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;
@@ -2208,7 +2197,6 @@ close_file(void *file_baton,
 
       proppatch = apr_pcalloc(ctx->pool, sizeof(*proppatch));
       proppatch->pool = ctx->pool;
-      proppatch->progress.pool = pool;
       proppatch->relpath = ctx->relpath;
       proppatch->path = ctx->url;
       proppatch->commit = ctx->commit;
@@ -2270,7 +2258,6 @@ 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;
@@ -2311,7 +2298,6 @@ 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;
@@ -2483,7 +2469,6 @@ 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=1335250&r1=1335249&r2=1335250&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/locks.c Mon May  7 20:47:20 2012
@@ -691,7 +691,6 @@ svn_ra_serf__unlock(svn_ra_session_t *ra
       svn_pool_clear(iterpool);
 
       ctx = apr_pcalloc(iterpool, sizeof(*ctx));
-      ctx->pool = iterpool;
 
       path = svn__apr_hash_index_key(hi);
       token = svn__apr_hash_index_val(hi);

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=1335250&r1=1335249&r2=1335250&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Mon May  7 20:47:20 2012
@@ -661,8 +661,6 @@ struct svn_ra_serf__server_error_t {
 
 /* 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;
-
   /* This value is set to TRUE when the response is completed. */
   svn_boolean_t done;
 

Modified: subversion/trunk/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/util.c?rev=1335250&r1=1335249&r2=1335250&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/util.c Mon May  7 20:47:20 2012
@@ -961,8 +961,6 @@ 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);
 
@@ -1687,9 +1685,13 @@ handle_response(serf_request_t *request,
       handler->sline.reason = apr_pstrdup(handler->handler_pool, sl.reason);
     }
 
+  /* Keep reading from the network until we've read all the headers.  */
   status = serf_bucket_response_wait_for_headers(response);
   if (status)
     {
+      /* The typical "error" will be APR_EAGAIN, meaning that more input
+         from the network is required to complete the reading of the
+         headers.  */
       if (!APR_STATUS_IS_EOF(status))
         {
           /* Either the headers are not (yet) complete, or there really
@@ -1732,6 +1734,12 @@ handle_response(serf_request_t *request,
         }
     }
 
+  /* ... and set up the header fields in HANDLER.  */
+  handler->location = svn_ra_serf__response_get_location(
+                          response, handler->handler_pool);
+
+  /* On the last request, we failed authentication. We succeeded this time,
+     so let's save away these credentials.  */
   if (handler->conn->last_status_code == 401 && handler->sline.code <
400)
     {
       SVN_ERR(svn_auth_save_credentials(handler->session->auth_state,
@@ -1739,7 +1747,6 @@ handle_response(serf_request_t *request,
       handler->session->auth_attempts = 0;
       handler->session->auth_state = NULL;
     }
-
   handler->conn->last_status_code = handler->sline.code;
 
   if (handler->sline.code == 405
@@ -1774,10 +1781,6 @@ handle_response(serf_request_t *request,
       return SVN_NO_ERROR; /* Error is set in caller */
     }
 
-  /* ... and set up the header fields in HANDLER.  */
-  handler->location = svn_ra_serf__response_get_location(
-                          response, handler->handler_pool);
-
   /* Stop processing the above, on every packet arrival.  */
   handler->reading_body = TRUE;
 



Mime
View raw message