You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2012/05/06 23:26:13 UTC

svn commit: r1334784 - in /subversion/trunk/subversion/libsvn_ra_serf: getdate.c getlocks.c locks.c replay.c update.c util.c

Author: gstein
Date: Sun May  6 21:26:13 2012
New Revision: 1334784

URL: http://svn.apache.org/viewvc?rev=1334784&view=rev
Log:
Yup... we *do* need the HANDLER_POOL to always be set. When the base
response handler detects an error, then it may start multistatus
processing to parse out an svn_error reported by the server. The
server_error located in the handler needs to be allocated from the
HANDLER_POOL.

* subversion/libsvn_ra_serf/util.c:
  (svn_ra_esrf__handle_server_error): remove stale comment
  (handle_response): add explanatory comment
  (svn_ra_serf__request_create): assert we have the pool. all requests
    start here, so we should be safe.

* subversion/libsvn_ra_serf/replay.c:
  (svn_ra_serf__replay, svn_ra_serf__replay_range): initialize HANDLER_POOL

* subversion/libsvn_ra_serf/getlocks.c:
  (svn_ra_serf__get_locks): initialize HANDLER_POOL

* subversion/libsvn_ra_serf/locks.c:
  (svn_ra_serf__lock): initialize HANDLER_POOL

* subversion/libsvn_ra_serf/getdate.c:
  (svn_ra_serf__get_dated_revision): initialize HANDLER_POOL

* subversion/libsvn_ra_serf/update.c:
  (fetch_file, finish_report, svn_ra_serf__get_file): initialize
    HANDLER_POOL

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/getdate.c
    subversion/trunk/subversion/libsvn_ra_serf/getlocks.c
    subversion/trunk/subversion/libsvn_ra_serf/locks.c
    subversion/trunk/subversion/libsvn_ra_serf/replay.c
    subversion/trunk/subversion/libsvn_ra_serf/update.c
    subversion/trunk/subversion/libsvn_ra_serf/util.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/getdate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/getdate.c?rev=1334784&r1=1334783&r2=1334784&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/getdate.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/getdate.c Sun May  6 21:26:13 2012
@@ -181,7 +181,7 @@ svn_ra_serf__get_dated_revision(svn_ra_s
 
   handler = apr_pcalloc(pool, sizeof(*handler));
 
-  /* ### skip setting HANDLER_POOL?  */
+  handler->handler_pool = pool;
   handler->method = "REPORT";
   handler->path = report_target;
   handler->body_type = "text/xml";

Modified: subversion/trunk/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/getlocks.c?rev=1334784&r1=1334783&r2=1334784&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/getlocks.c Sun May  6 21:26:13 2012
@@ -340,7 +340,7 @@ svn_ra_serf__get_locks(svn_ra_session_t 
 
   handler = apr_pcalloc(pool, sizeof(*handler));
 
-  /* ### skip setting HANDLER_POOL?  */
+  handler->handler_pool = pool;
   handler->method = "REPORT";
   handler->path = req_url;
   handler->body_type = "text/xml";

Modified: subversion/trunk/subversion/libsvn_ra_serf/locks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/locks.c?rev=1334784&r1=1334783&r2=1334784&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/locks.c Sun May  6 21:26:13 2012
@@ -591,7 +591,7 @@ svn_ra_serf__lock(svn_ra_session_t *ra_s
 
       handler = apr_pcalloc(iterpool, sizeof(*handler));
 
-      /* ### skip setting HANDLER_POOL?  */
+      handler->handler_pool = iterpool;
       handler->method = "LOCK";
       handler->path = req_url;
       handler->body_type = "text/xml";

Modified: subversion/trunk/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/replay.c?rev=1334784&r1=1334783&r2=1334784&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/replay.c Sun May  6 21:26:13 2012
@@ -659,7 +659,7 @@ svn_ra_serf__replay(svn_ra_session_t *ra
 
   handler = apr_pcalloc(pool, sizeof(*handler));
 
-  /* ### skip setting HANDLER_POOL?  */
+  handler->handler_pool = pool;
   handler->method = "REPORT";
   handler->path = session->session_url_str;
   handler->body_delegate = create_replay_body;
@@ -798,7 +798,7 @@ svn_ra_serf__replay_range(svn_ra_session
           /* Send the replay report request. */
           handler = apr_pcalloc(replay_ctx->src_rev_pool, sizeof(*handler));
 
-          /* ### skip setting HANDLER_POOL?  */
+          handler->handler_pool = replay_ctx->src_rev_pool;
           handler->method = "REPORT";
           handler->path = session->session_url_str;
           handler->body_delegate = create_replay_body;

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1334784&r1=1334783&r2=1334784&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Sun May  6 21:26:13 2012
@@ -1493,7 +1493,7 @@ fetch_file(report_context_t *ctx, report
 
           handler = apr_pcalloc(info->dir->pool, sizeof(*handler));
 
-          /* ### skip setting HANDLER_POOL?  */
+          handler->handler_pool = info->dir->pool;
           handler->method = "HEAD";
           handler->path = fetch_ctx->info->url;
 
@@ -1519,7 +1519,7 @@ fetch_file(report_context_t *ctx, report
 
           handler = apr_pcalloc(info->dir->pool, sizeof(*handler));
 
-          /* ### skip setting HANDLER_POOL?  */
+          handler->handler_pool = info->dir->pool;
           handler->method = "GET";
           handler->path = fetch_ctx->info->url;
 
@@ -2566,7 +2566,7 @@ finish_report(void *report_baton,
 
   handler = apr_pcalloc(pool, sizeof(*handler));
 
-  /* ### skip setting HANDLER_POOL?  */
+  handler->handler_pool = pool;
   handler->method = "REPORT";
   handler->path = report->path;
   handler->body_delegate = create_update_report_body;
@@ -3088,7 +3088,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
 
       handler = apr_pcalloc(pool, sizeof(*handler));
 
-      /* ### skip setting HANDLER_POOL?  */
+      handler->handler_pool = pool;
       handler->method = "GET";
       handler->path = fetch_url;
       handler->conn = conn;

Modified: subversion/trunk/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/util.c?rev=1334784&r1=1334783&r2=1334784&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/util.c Sun May  6 21:26:13 2012
@@ -1566,7 +1566,7 @@ svn_ra_serf__handle_xml_parser(serf_requ
   /* not reached */
 }
 
-/* Implements svn_ra_serf__response_handler_t */
+
 svn_error_t *
 svn_ra_serf__handle_server_error(serf_request_t *request,
                                  serf_bucket_t *response,
@@ -1580,6 +1580,7 @@ svn_ra_serf__handle_server_error(serf_re
   return server_err.error;
 }
 
+
 apr_status_t
 svn_ra_serf__credentials_callback(char **username, char **password,
                                   serf_request_t *request, void *baton,
@@ -1704,6 +1705,7 @@ handle_response(serf_request_t *request,
   if (!sl.version && (APR_STATUS_IS_EOF(status) ||
                       APR_STATUS_IS_EAGAIN(status)))
     {
+      /* The response line is not (yet) ready.  */
       *serf_status = status;
       return SVN_NO_ERROR; /* Handled by serf */
     }
@@ -1913,6 +1915,8 @@ setup_request_cb(serf_request_t *request
 void
 svn_ra_serf__request_create(svn_ra_serf__handler_t *handler)
 {
+  SVN_ERR_ASSERT(handler->handler_pool != NULL);
+
   /* ### do we need to hold onto the returned request object, or just
      ### not worry about it (the serf ctx will manage it).  */
   (void) serf_connection_request_create(handler->conn->conn,