subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1658362 [18/34] - in /subversion/branches/remove-log-addressing: ./ build/ build/generator/ build/generator/templates/ notes/ subversion/bindings/cxxhl/include/svncxxhl/ subversion/bindings/javahl/native/ subversion/bindings/javahl/native/...
Date Mon, 09 Feb 2015 11:23:43 GMT
Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra/ra_loader.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra/ra_loader.c Mon Feb  9 11:23:39 2015
@@ -52,6 +52,7 @@
 #include "ra_loader.h"
 #include "deprecated.h"
 
+#include "private/svn_auth_private.h"
 #include "private/svn_ra_private.h"
 #include "svn_private_config.h"
 
@@ -263,23 +264,12 @@ svn_error_t *svn_ra_open4(svn_ra_session
   svn_ra_session_t *session;
   const struct ra_lib_defn *defn;
   const svn_ra__vtable_t *vtable = NULL;
-  svn_config_t *servers = NULL;
-  const char *server_group = NULL;
   apr_uri_t repos_URI;
   apr_status_t apr_err;
   svn_error_t *err;
 #ifdef CHOOSABLE_DAV_MODULE
   const char *http_library = DEFAULT_HTTP_LIBRARY;
 #endif
-  /* Auth caching parameters. */
-  svn_boolean_t store_passwords = SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS;
-  svn_boolean_t store_auth_creds = SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS;
-  const char *store_plaintext_passwords
-    = SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS;
-  svn_boolean_t store_pp = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP;
-  const char *store_pp_plaintext
-    = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT;
-  const char *corrected_url;
 
   /* Initialize the return variable. */
   *session_p = NULL;
@@ -295,100 +285,27 @@ svn_error_t *svn_ra_open4(svn_ra_session
                              repos_URL);
 
   if (callbacks->auth_baton)
-    {
-      /* The 'store-passwords' and 'store-auth-creds' parameters used to
-       * live in SVN_CONFIG_CATEGORY_CONFIG. For backward compatibility,
-       * if values for these parameters have already been set by our
-       * callers, we use those values as defaults.
-       *
-       * Note that we can only catch the case where users explicitly set
-       * "store-passwords = no" or 'store-auth-creds = no".
-       *
-       * However, since the default value for both these options is
-       * currently (and has always been) "yes", users won't know
-       * the difference if they set "store-passwords = yes" or
-       * "store-auth-creds = yes" -- they'll get the expected behaviour.
-       */
-
-      if (svn_auth_get_parameter(callbacks->auth_baton,
-                                 SVN_AUTH_PARAM_DONT_STORE_PASSWORDS) != NULL)
-        store_passwords = FALSE;
-
-      if (svn_auth_get_parameter(callbacks->auth_baton,
-                                 SVN_AUTH_PARAM_NO_AUTH_CACHE) != NULL)
-        store_auth_creds = FALSE;
-    }
+    SVN_ERR(svn_auth__apply_config_for_server(callbacks->auth_baton, config,
+                                              repos_URI.hostname, sesspool));
 
+#ifdef CHOOSABLE_DAV_MODULE
   if (config)
     {
+      svn_config_t *servers = NULL;
+      const char *server_group = NULL;
+
       /* Grab the 'servers' config. */
       servers = svn_hash_gets(config, SVN_CONFIG_CATEGORY_SERVERS);
       if (servers)
         {
           /* First, look in the global section. */
 
-          SVN_ERR(svn_config_get_bool
-            (servers, &store_passwords, SVN_CONFIG_SECTION_GLOBAL,
-             SVN_CONFIG_OPTION_STORE_PASSWORDS,
-             store_passwords));
-
-          SVN_ERR(svn_config_get_yes_no_ask
-            (servers, &store_plaintext_passwords, SVN_CONFIG_SECTION_GLOBAL,
-             SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
-             SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS));
-
-          SVN_ERR(svn_config_get_bool
-            (servers, &store_pp, SVN_CONFIG_SECTION_GLOBAL,
-             SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP,
-             store_pp));
-
-          SVN_ERR(svn_config_get_yes_no_ask
-            (servers, &store_pp_plaintext,
-             SVN_CONFIG_SECTION_GLOBAL,
-             SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
-             SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT));
-
-          SVN_ERR(svn_config_get_bool
-            (servers, &store_auth_creds, SVN_CONFIG_SECTION_GLOBAL,
-              SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
-              store_auth_creds));
-
           /* Find out where we're about to connect to, and
            * try to pick a server group based on the destination. */
           server_group = svn_config_find_group(servers, repos_URI.hostname,
                                                SVN_CONFIG_SECTION_GROUPS,
                                                sesspool);
 
-          if (server_group)
-            {
-              /* Override global auth caching parameters with the ones
-               * for the server group, if any. */
-              SVN_ERR(svn_config_get_bool(servers, &store_auth_creds,
-                                          server_group,
-                                          SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
-                                          store_auth_creds));
-
-              SVN_ERR(svn_config_get_bool(servers, &store_passwords,
-                                          server_group,
-                                          SVN_CONFIG_OPTION_STORE_PASSWORDS,
-                                          store_passwords));
-
-              SVN_ERR(svn_config_get_yes_no_ask
-                (servers, &store_plaintext_passwords, server_group,
-                 SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS,
-                 store_plaintext_passwords));
-
-              SVN_ERR(svn_config_get_bool
-                (servers, &store_pp,
-                 server_group, SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP,
-                 store_pp));
-
-              SVN_ERR(svn_config_get_yes_no_ask
-                (servers, &store_pp_plaintext, server_group,
-                 SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
-                 store_pp_plaintext));
-            }
-#ifdef CHOOSABLE_DAV_MODULE
           /* Now, which DAV-based RA method do we want to use today? */
           http_library
             = svn_config_get_server_setting(servers,
@@ -401,38 +318,9 @@ svn_error_t *svn_ra_open4(svn_ra_session
                                      _("Invalid config: unknown HTTP library "
                                        "'%s'"),
                                      http_library);
-#endif
         }
     }
-
-  if (callbacks->auth_baton)
-    {
-      /* Save auth caching parameters in the auth parameter hash. */
-      if (! store_passwords)
-        svn_auth_set_parameter(callbacks->auth_baton,
-                               SVN_AUTH_PARAM_DONT_STORE_PASSWORDS, "");
-
-      svn_auth_set_parameter(callbacks->auth_baton,
-                             SVN_AUTH_PARAM_STORE_PLAINTEXT_PASSWORDS,
-                             store_plaintext_passwords);
-
-      if (! store_pp)
-        svn_auth_set_parameter(callbacks->auth_baton,
-                               SVN_AUTH_PARAM_DONT_STORE_SSL_CLIENT_CERT_PP,
-                               "");
-
-      svn_auth_set_parameter(callbacks->auth_baton,
-                             SVN_AUTH_PARAM_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT,
-                             store_pp_plaintext);
-
-      if (! store_auth_creds)
-        svn_auth_set_parameter(callbacks->auth_baton,
-                               SVN_AUTH_PARAM_NO_AUTH_CACHE, "");
-
-      if (server_group)
-        svn_auth_set_parameter(callbacks->auth_baton,
-                               SVN_AUTH_PARAM_SERVER_GROUP, server_group);
-    }
+#endif
 
   /* Find the library. */
   for (defn = ra_libraries; defn->ra_name != NULL; ++defn)
@@ -482,34 +370,29 @@ svn_error_t *svn_ra_open4(svn_ra_session
   session->pool = sesspool;
 
   /* Ask the library to open the session. */
-  err = vtable->open_session(session, &corrected_url, repos_URL,
+  err = vtable->open_session(session, corrected_url_p,
+                             repos_URL,
                              callbacks, callback_baton, config, sesspool);
 
   if (err)
-    return svn_error_createf(
+    {
+      if (err->apr_err == SVN_ERR_RA_SESSION_URL_MISMATCH)
+        return svn_error_trace(err);
+
+      return svn_error_createf(
                 SVN_ERR_RA_CANNOT_CREATE_SESSION, err,
                 _("Unable to connect to a repository at URL '%s'"),
                 repos_URL);
+    }
 
   /* If the session open stuff detected a server-provided URL
      correction (a 301 or 302 redirect response during the initial
      OPTIONS request), then kill the session so the caller can decide
      what to do. */
-  if (corrected_url_p && corrected_url)
+  if (corrected_url_p && *corrected_url_p)
     {
-      if (! svn_path_is_url(corrected_url))
-        {
-          /* RFC1945 and RFC2616 state that the Location header's
-             value (from whence this CORRECTED_URL ultimately comes),
-             if present, must be an absolute URI.  But some Apache
-             versions (those older than 2.2.11, it seems) transmit
-             only the path portion of the URI.  See issue #3775 for
-             details. */
-          apr_uri_t corrected_URI = repos_URI;
-          corrected_URI.path = (char *)corrected_url;
-          corrected_url = apr_uri_unparse(pool, &corrected_URI, 0);
-        }
-      *corrected_url_p = svn_uri_canonicalize(corrected_url, pool);
+      /* *session_p = NULL; */
+      *corrected_url_p = apr_pstrdup(pool, *corrected_url_p);
       svn_pool_destroy(sesspool);
       return SVN_NO_ERROR;
     }
@@ -537,11 +420,11 @@ svn_error_t *svn_ra_open4(svn_ra_session
 }
 
 svn_error_t *
-svn_ra_dup_session(svn_ra_session_t **new_session,
-                   svn_ra_session_t *old_session,
-                   const char *session_url,
-                   apr_pool_t *result_pool,
-                   apr_pool_t *scratch_pool)
+svn_ra__dup_session(svn_ra_session_t **new_session,
+                    svn_ra_session_t *old_session,
+                    const char *session_url,
+                    apr_pool_t *result_pool,
+                    apr_pool_t *scratch_pool)
 {
   svn_ra_session_t *session;
 
@@ -1016,8 +899,8 @@ svn_error_t *svn_ra_stat(svn_ra_session_
               svn_uri_split(&parent_url, &base_name, session_url,
                             scratch_pool);
 
-              SVN_ERR(svn_ra_dup_session(&parent_session, session, parent_url,
-                                         scratch_pool, scratch_pool));
+              SVN_ERR(svn_ra__dup_session(&parent_session, session, parent_url,
+                                          scratch_pool, scratch_pool));
 
               /* Get all parent's entries, no props. */
               SVN_ERR(svn_ra_get_dir2(parent_session, &parent_ents, NULL,

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blame.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blame.c Mon Feb  9 11:23:39 2015
@@ -280,7 +280,8 @@ static svn_error_t *
 create_file_revs_body(serf_bucket_t **body_bkt,
                       void *baton,
                       serf_bucket_alloc_t *alloc,
-                      apr_pool_t *pool)
+                      apr_pool_t *pool /* request pool */,
+                      apr_pool_t *scratch_pool)
 {
   serf_bucket_t *buckets;
   blame_context_t *blame_ctx = baton;
@@ -351,7 +352,7 @@ svn_ra_serf__get_file_revs(svn_ra_sessio
     peg_rev = start;
 
   SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      session, NULL /* conn */,
+                                      session,
                                       NULL /* url */, peg_rev,
                                       pool, pool));
 
@@ -361,15 +362,13 @@ svn_ra_serf__get_file_revs(svn_ra_sessio
                                            blame_cdata,
                                            blame_ctx,
                                            pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, pool);
+  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
 
   handler->method = "REPORT";
   handler->path = req_url;
   handler->body_type = "text/xml";
   handler->body_delegate = create_file_revs_body;
   handler->body_delegate_baton = blame_ctx;
-  handler->conn = session->conns[0];
-  handler->session = session;
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blncache.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blncache.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blncache.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blncache.c Mon Feb  9 11:23:39 2015
@@ -112,7 +112,7 @@ svn_ra_serf__blncache_set(svn_ra_serf__b
                           const char *baseline_url,
                           svn_revnum_t revision,
                           const char *bc_url,
-                          apr_pool_t *pool)
+                          apr_pool_t *scratch_pool)
 {
   if (bc_url && SVN_IS_VALID_REVNUM(revision))
     {
@@ -147,11 +147,11 @@ svn_error_t *
 svn_ra_serf__blncache_get_bc_url(const char **bc_url_p,
                                  svn_ra_serf__blncache_t *blncache,
                                  svn_revnum_t revnum,
-                                 apr_pool_t *pool)
+                                 apr_pool_t *result_pool)
 {
   const char *value = apr_hash_get(blncache->revnum_to_bc,
                                    &revnum, sizeof(revnum));
-  *bc_url_p = value ? apr_pstrdup(pool, value) : NULL;
+  *bc_url_p = value ? apr_pstrdup(result_pool, value) : NULL;
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blncache.h
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blncache.h?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blncache.h (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/blncache.h Mon Feb  9 11:23:39 2015
@@ -59,7 +59,7 @@ svn_ra_serf__blncache_set(svn_ra_serf__b
                           const char *baseline_url,
                           svn_revnum_t revnum,
                           const char *bc_url,
-                          apr_pool_t *pool);
+                          apr_pool_t *scratch_pool);
 
 /* Sets *BC_URL_P with a pointer to baseline collection URL for the given
  * REVNUM. *BC_URL_P will be NULL if cache doesn't have information about
@@ -69,7 +69,7 @@ svn_error_t *
 svn_ra_serf__blncache_get_bc_url(const char **bc_url_p,
                                  svn_ra_serf__blncache_t *blncache,
                                  svn_revnum_t revnum,
-                                 apr_pool_t *pool);
+                                 apr_pool_t *result_pool);
 
 /* Sets *BC_URL_P with pointer to baseline collection URL and *REVISION_P
  * with revision number of baseline BASELINE_URL. *BC_URL_P will be NULL,

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/commit.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/commit.c Mon Feb  9 11:23:39 2015
@@ -51,7 +51,6 @@ typedef struct commit_context_t {
   apr_pool_t *pool;
 
   svn_ra_serf__session_t *session;
-  svn_ra_serf__connection_t *conn;
 
   apr_hash_t *revprop_table;
 
@@ -85,13 +84,11 @@ typedef struct proppatch_context_t {
 
   commit_context_t *commit_ctx;
 
-  /* Changed and removed properties. */
-  apr_hash_t *changed_props;
-  apr_hash_t *removed_props;
-
-  /* Same, for the old value (*old_value_p). */
-  apr_hash_t *previous_changed_props;
-  apr_hash_t *previous_removed_props;
+  /* Changed properties. const char * -> svn_prop_t * */
+  apr_hash_t *prop_changes;
+
+  /* Same, for the old value, or NULL. */
+  apr_hash_t *old_props;
 
   /* In HTTP v2, this is the file/directory version we think we're changing. */
   svn_revnum_t base_revision;
@@ -139,9 +136,8 @@ typedef struct dir_context_t {
   const char *copy_path;
   svn_revnum_t copy_revision;
 
-  /* Changed and removed properties */
-  apr_hash_t *changed_props;
-  apr_hash_t *removed_props;
+  /* Changed properties (const char * -> svn_prop_t *) */
+  apr_hash_t *prop_changes;
 
   /* The checked-out working resource for this directory.  May be NULL; if so
      call checkout_dir() first.  */
@@ -186,9 +182,8 @@ typedef struct file_context_t {
   /* Our resulting checksum as reported by the WC. */
   const char *result_checksum;
 
-  /* Changed and removed properties. */
-  apr_hash_t *changed_props;
-  apr_hash_t *removed_props;
+  /* Changed properties (const char * -> svn_prop_t *) */
+  apr_hash_t *prop_changes;
 
   /* URL to PUT the file at. */
   const char *url;
@@ -203,7 +198,8 @@ static svn_error_t *
 create_checkout_body(serf_bucket_t **bkt,
                      void *baton,
                      serf_bucket_alloc_t *alloc,
-                     apr_pool_t *pool)
+                     apr_pool_t *pool /* request pool */,
+                     apr_pool_t *scratch_pool)
 {
   const char *activity_url = baton;
   serf_bucket_t *body_bkt;
@@ -267,9 +263,7 @@ checkout_node(const char **working_url,
 
   /* HANDLER_POOL is the scratch pool since we don't need to remember
      anything from the handler. We just want the working resource.  */
-  handler = svn_ra_serf__create_handler(scratch_pool);
-  handler->session = commit_ctx->session;
-  handler->conn = commit_ctx->conn;
+  handler = svn_ra_serf__create_handler(commit_ctx->session, scratch_pool);
 
   handler->body_delegate = create_checkout_body;
   handler->body_delegate_baton = (/* const */ void *)commit_ctx->activity_url;
@@ -459,7 +453,6 @@ get_version_url(const char **checked_in_
   else
     {
       const char *propfind_url;
-      svn_ra_serf__connection_t *conn = session->conns[0];
 
       if (SVN_IS_VALID_REVNUM(base_revision))
         {
@@ -468,10 +461,9 @@ get_version_url(const char **checked_in_
              this lookup, so we'll do things the hard(er) way, by
              looking up the version URL from a resource in the
              baseline collection. */
-          /* ### conn==NULL for session->conns[0]. same as CONN.  */
           SVN_ERR(svn_ra_serf__get_stable_url(&propfind_url,
                                               NULL /* latest_revnum */,
-                                              session, NULL /* conn */,
+                                              session,
                                               NULL /* url */, base_revision,
                                               scratch_pool, scratch_pool));
         }
@@ -480,8 +472,8 @@ get_version_url(const char **checked_in_
           propfind_url = session->session_url.path;
         }
 
-      SVN_ERR(svn_ra_serf__fetch_dav_prop(&root_checkout,
-                                          conn, propfind_url, base_revision,
+      SVN_ERR(svn_ra_serf__fetch_dav_prop(&root_checkout, session,
+                                          propfind_url, base_revision,
                                           "checked-in",
                                           scratch_pool, scratch_pool));
       if (!root_checkout)
@@ -569,101 +561,23 @@ get_encoding_and_cdata(const char **enco
   return SVN_NO_ERROR;
 }
 
-typedef struct walker_baton_t {
-  serf_bucket_t *body_bkt;
-  apr_pool_t *body_pool;
-
-  apr_hash_t *previous_changed_props;
-  apr_hash_t *previous_removed_props;
-
-  const char *path;
-
-  /* Hack, since change_rev_prop(old_value_p != NULL, value = NULL) uses D:set
-     rather than D:remove...  (see notes/http-and-webdav/webdav-protocol) */
-  enum {
-    filter_all_props,
-    filter_props_with_old_value,
-    filter_props_without_old_value
-  } filter;
-
-  /* Is the property being deleted? */
-  svn_boolean_t deleting;
-} walker_baton_t;
-
-/* If we have (recorded in WB) the old value of the property named NS:NAME,
- * then set *HAVE_OLD_VAL to TRUE and set *OLD_VAL_P to that old value
- * (which may be NULL); else set *HAVE_OLD_VAL to FALSE.  */
+/* Helper for create_proppatch_body. Writes per property xml to body */
 static svn_error_t *
-derive_old_val(svn_boolean_t *have_old_val,
-               const svn_string_t **old_val_p,
-               walker_baton_t *wb,
-               const char *ns,
-               const char *name)
+write_prop_xml(const proppatch_context_t *proppatch,
+               serf_bucket_t *body_bkt,
+               serf_bucket_alloc_t *alloc,
+               const svn_prop_t *prop,
+               apr_pool_t *result_pool,
+               apr_pool_t *scratch_pool)
 {
-  *have_old_val = FALSE;
-
-  if (wb->previous_changed_props)
-    {
-      const svn_string_t *val;
-      val = svn_ra_serf__get_prop_string(wb->previous_changed_props,
-                                         wb->path, ns, name);
-      if (val)
-        {
-          *have_old_val = TRUE;
-          *old_val_p = val;
-        }
-    }
-
-  if (wb->previous_removed_props)
-    {
-      const svn_string_t *val;
-      val = svn_ra_serf__get_prop_string(wb->previous_removed_props,
-                                         wb->path, ns, name);
-      if (val)
-        {
-          *have_old_val = TRUE;
-          *old_val_p = NULL;
-        }
-    }
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-proppatch_walker(void *baton,
-                 const char *ns,
-                 const char *name,
-                 const svn_string_t *val,
-                 apr_pool_t *scratch_pool)
-{
-  walker_baton_t *wb = baton;
-  serf_bucket_t *body_bkt = wb->body_bkt;
   serf_bucket_t *cdata_bkt;
-  serf_bucket_alloc_t *alloc;
   const char *encoding;
-  svn_boolean_t have_old_val;
-  const svn_string_t *old_val;
   const svn_string_t *encoded_value;
   const char *prop_name;
+  const svn_prop_t *old_prop;
 
-  SVN_ERR(derive_old_val(&have_old_val, &old_val, wb, ns, name));
-
-  /* Jump through hoops to work with D:remove and its val = (""-for-NULL)
-   * representation. */
-  if (wb->filter != filter_all_props)
-    {
-      if (wb->filter == filter_props_with_old_value && ! have_old_val)
-        return SVN_NO_ERROR;
-      if (wb->filter == filter_props_without_old_value && have_old_val)
-        return SVN_NO_ERROR;
-    }
-  if (wb->deleting)
-    val = NULL;
-
-  alloc = body_bkt->allocator;
-
-  SVN_ERR(get_encoding_and_cdata(&encoding, &encoded_value, alloc, val,
-                                 wb->body_pool, scratch_pool));
+  SVN_ERR(get_encoding_and_cdata(&encoding, &encoded_value, alloc, prop->value,
+                                 result_pool, scratch_pool));
   if (encoded_value)
     {
       cdata_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(encoded_value->data,
@@ -677,12 +591,18 @@ proppatch_walker(void *baton,
 
   /* Use the namespace prefix instead of adding the xmlns attribute to support
      property names containing ':' */
-  if (strcmp(ns, SVN_DAV_PROP_NS_SVN) == 0)
-    prop_name = apr_pstrcat(wb->body_pool, "S:", name, SVN_VA_NULL);
-  else if (strcmp(ns, SVN_DAV_PROP_NS_CUSTOM) == 0)
-    prop_name = apr_pstrcat(wb->body_pool, "C:", name, SVN_VA_NULL);
+  if (strncmp(prop->name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
+    {
+      prop_name = apr_pstrcat(result_pool,
+                              "S:", prop->name + sizeof(SVN_PROP_PREFIX) - 1,
+                              SVN_VA_NULL);
+    }
   else
-    SVN_ERR_MALFUNCTION();
+    {
+      prop_name = apr_pstrcat(result_pool,
+                              "C:", prop->name,
+                              SVN_VA_NULL);
+    }
 
   if (cdata_bkt)
     svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, prop_name,
@@ -693,15 +613,18 @@ proppatch_walker(void *baton,
                                       "V:" SVN_DAV__OLD_VALUE__ABSENT, "1",
                                       SVN_VA_NULL);
 
-  if (have_old_val)
+  old_prop = proppatch->old_props
+                          ? svn_hash_gets(proppatch->old_props, prop->name)
+                          : NULL;
+  if (old_prop)
     {
       const char *encoding2;
       const svn_string_t *encoded_value2;
       serf_bucket_t *cdata_bkt2;
 
       SVN_ERR(get_encoding_and_cdata(&encoding2, &encoded_value2,
-                                     alloc, old_val,
-                                     wb->body_pool, scratch_pool));
+                                     alloc, old_prop->value,
+                                     result_pool, scratch_pool));
 
       if (encoded_value2)
         {
@@ -789,7 +712,8 @@ maybe_set_lock_token_header(serf_bucket_
 static svn_error_t *
 setup_proppatch_headers(serf_bucket_t *headers,
                         void *baton,
-                        apr_pool_t *pool)
+                        apr_pool_t *pool /* request pool */,
+                        apr_pool_t *scratch_pool)
 {
   proppatch_context_t *proppatch = baton;
 
@@ -813,11 +737,13 @@ static svn_error_t *
 create_proppatch_body(serf_bucket_t **bkt,
                       void *baton,
                       serf_bucket_alloc_t *alloc,
+                      apr_pool_t *pool /* request pool */,
                       apr_pool_t *scratch_pool)
 {
   proppatch_context_t *ctx = baton;
   serf_bucket_t *body_bkt;
-  walker_baton_t wb = { 0 };
+  svn_boolean_t opened = FALSE;
+  apr_hash_index_t *hi;
 
   body_bkt = serf_bucket_aggregate_create(alloc);
 
@@ -829,59 +755,64 @@ create_proppatch_body(serf_bucket_t **bk
                                     "xmlns:S", SVN_DAV_PROP_NS_SVN,
                                     SVN_VA_NULL);
 
-  wb.body_bkt = body_bkt;
-  wb.body_pool = scratch_pool;
-  wb.previous_changed_props = ctx->previous_changed_props;
-  wb.previous_removed_props = ctx->previous_removed_props;
-  wb.path = ctx->path;
-
-  if (apr_hash_count(ctx->changed_props) > 0)
-    {
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", SVN_VA_NULL);
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
-
-      wb.filter = filter_all_props;
-      wb.deleting = FALSE;
-      SVN_ERR(svn_ra_serf__walk_all_props(ctx->changed_props, ctx->path,
-                                          SVN_INVALID_REVNUM,
-                                          proppatch_walker, &wb,
-                                          scratch_pool));
+  /* First we write property SETs */
+  for (hi = apr_hash_first(scratch_pool, ctx->prop_changes);
+       hi;
+       hi = apr_hash_next(hi))
+    {
+      svn_prop_t *prop = apr_hash_this_val(hi);
 
-      svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
-      svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:set");
+      if (prop->value
+          || (ctx->old_props && svn_hash_gets(ctx->old_props, prop->name)))
+        {
+          if (!opened)
+            {
+              opened = TRUE;
+              svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set",
+                                                SVN_VA_NULL);
+              svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop",
+                                                SVN_VA_NULL);
+            }
+
+          SVN_ERR(write_prop_xml(ctx, body_bkt, alloc, prop,
+                                 pool, scratch_pool));
+        }
     }
 
-  if ((apr_hash_count(ctx->removed_props) > 0)
-      && (wb.previous_changed_props || wb.previous_removed_props))
+  if (opened)
     {
-      /* For revision properties we handle a remove as a special propset if
-         we want to provide the old version of the property */
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:set", SVN_VA_NULL);
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
-
-      wb.filter = filter_props_with_old_value;
-      wb.deleting = TRUE;
-      SVN_ERR(svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
-                                          SVN_INVALID_REVNUM,
-                                          proppatch_walker, &wb,
-                                          scratch_pool));
-
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:set");
     }
 
-  if (apr_hash_count(ctx->removed_props) > 0)
+  /* And then property REMOVEs */
+  opened = FALSE;
+
+  for (hi = apr_hash_first(scratch_pool, ctx->prop_changes);
+       hi;
+       hi = apr_hash_next(hi))
     {
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:remove", SVN_VA_NULL);
-      svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop", SVN_VA_NULL);
+      svn_prop_t *prop = apr_hash_this_val(hi);
+
+      if (!prop->value
+          && !(ctx->old_props && svn_hash_gets(ctx->old_props, prop->name)))
+        {
+          if (!opened)
+            {
+              opened = TRUE;
+              svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:remove",
+                                                SVN_VA_NULL);
+              svn_ra_serf__add_open_tag_buckets(body_bkt, alloc, "D:prop",
+                                                SVN_VA_NULL);
+            }
 
-      wb.filter = filter_props_without_old_value;
-      wb.deleting = TRUE;
-      SVN_ERR(svn_ra_serf__walk_all_props(ctx->removed_props, ctx->path,
-                                          SVN_INVALID_REVNUM,
-                                          proppatch_walker, &wb,
-                                          scratch_pool));
+          SVN_ERR(write_prop_xml(ctx, body_bkt, alloc, prop,
+                                 pool, scratch_pool));
+        }
+    }
 
+  if (opened)
+    {
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:prop");
       svn_ra_serf__add_close_tag_buckets(body_bkt, alloc, "D:remove");
     }
@@ -894,19 +825,16 @@ create_proppatch_body(serf_bucket_t **bk
 
 static svn_error_t*
 proppatch_resource(svn_ra_serf__session_t *session,
-                   svn_ra_serf__connection_t *conn,
                    proppatch_context_t *proppatch,
                    apr_pool_t *pool)
 {
   svn_ra_serf__handler_t *handler;
   svn_error_t *err;
 
-  handler = svn_ra_serf__create_handler(pool);
+  handler = svn_ra_serf__create_handler(session, pool);
 
   handler->method = "PROPPATCH";
   handler->path = proppatch->path;
-  handler->conn = conn;
-  handler->session = session;
 
   handler->header_delegate = setup_proppatch_headers;
   handler->header_delegate_baton = proppatch;
@@ -943,7 +871,8 @@ static svn_error_t *
 create_put_body(serf_bucket_t **body_bkt,
                 void *baton,
                 serf_bucket_alloc_t *alloc,
-                apr_pool_t *pool)
+                apr_pool_t *pool /* request pool */,
+                apr_pool_t *scratch_pool)
 {
   file_context_t *ctx = baton;
   apr_off_t offset;
@@ -971,7 +900,8 @@ static svn_error_t *
 create_empty_put_body(serf_bucket_t **body_bkt,
                       void *baton,
                       serf_bucket_alloc_t *alloc,
-                      apr_pool_t *pool)
+                      apr_pool_t *pool /* request pool */,
+                      apr_pool_t *scratch_pool)
 {
   *body_bkt = SERF_BUCKET_SIMPLE_STRING("", alloc);
   return SVN_NO_ERROR;
@@ -980,7 +910,8 @@ create_empty_put_body(serf_bucket_t **bo
 static svn_error_t *
 setup_put_headers(serf_bucket_t *headers,
                   void *baton,
-                  apr_pool_t *pool)
+                  apr_pool_t *pool /* request pool */,
+                  apr_pool_t *scratch_pool)
 {
   file_context_t *ctx = baton;
 
@@ -1011,7 +942,8 @@ setup_put_headers(serf_bucket_t *headers
 static svn_error_t *
 setup_copy_file_headers(serf_bucket_t *headers,
                         void *baton,
-                        apr_pool_t *pool)
+                        apr_pool_t *pool /* request pool */,
+                        apr_pool_t *scratch_pool)
 {
   file_context_t *file = baton;
   apr_uri_t uri;
@@ -1109,7 +1041,8 @@ setup_if_header_recursive(svn_boolean_t
 static svn_error_t *
 setup_add_dir_common_headers(serf_bucket_t *headers,
                              void *baton,
-                             apr_pool_t *pool)
+                             apr_pool_t *pool /* request pool */,
+                             apr_pool_t *scratch_pool)
 {
   dir_context_t *dir = baton;
   svn_boolean_t added;
@@ -1122,7 +1055,8 @@ setup_add_dir_common_headers(serf_bucket
 static svn_error_t *
 setup_copy_dir_headers(serf_bucket_t *headers,
                        void *baton,
-                       apr_pool_t *pool)
+                       apr_pool_t *pool /* request pool */,
+                       apr_pool_t *scratch_pool)
 {
   dir_context_t *dir = baton;
   apr_uri_t uri;
@@ -1151,13 +1085,15 @@ setup_copy_dir_headers(serf_bucket_t *he
   /* Implicitly checkout this dir now. */
   dir->working_url = apr_pstrdup(dir->pool, uri.path);
 
-  return svn_error_trace(setup_add_dir_common_headers(headers, baton, pool));
+  return svn_error_trace(setup_add_dir_common_headers(headers, baton, pool,
+                                                      scratch_pool));
 }
 
 static svn_error_t *
 setup_delete_headers(serf_bucket_t *headers,
                      void *baton,
-                     apr_pool_t *pool)
+                     apr_pool_t *pool /* request pool */,
+                     apr_pool_t *scratch_pool)
 {
   delete_context_t *del = baton;
   svn_boolean_t added;
@@ -1182,7 +1118,8 @@ static svn_error_t *
 create_txn_post_body(serf_bucket_t **body_bkt,
                      void *baton,
                      serf_bucket_alloc_t *alloc,
-                     apr_pool_t *pool)
+                     apr_pool_t *pool /* request pool */,
+                     apr_pool_t *scratch_pool)
 {
   apr_hash_t *revprops = baton;
   svn_skel_t *request_skel;
@@ -1211,7 +1148,8 @@ create_txn_post_body(serf_bucket_t **bod
 static svn_error_t *
 setup_post_headers(serf_bucket_t *headers,
                    void *baton,
-                   apr_pool_t *pool)
+                   apr_pool_t *pool /* request pool */,
+                   apr_pool_t *scratch_pool)
 {
 #ifdef SVN_DAV_SEND_VTXN_NAME
   /* Enable this to exercise the VTXN-NAME code based on a client
@@ -1320,7 +1258,7 @@ open_root(void *edit_baton,
                                  "create-txn-with-props"));
 
       /* Create our activity URL now on the server. */
-      handler = svn_ra_serf__create_handler(scratch_pool);
+      handler = svn_ra_serf__create_handler(commit_ctx->session, scratch_pool);
 
       handler->method = "POST";
       handler->body_type = SVN_SKEL_MIME_TYPE;
@@ -1330,8 +1268,6 @@ open_root(void *edit_baton,
       handler->header_delegate = setup_post_headers;
       handler->header_delegate_baton = NULL;
       handler->path = commit_ctx->session->me_resource;
-      handler->conn = commit_ctx->session->conns[0];
-      handler->session = commit_ctx->session;
 
       prc = apr_pcalloc(scratch_pool, sizeof(*prc));
       prc->handler = handler;
@@ -1356,7 +1292,7 @@ open_root(void *edit_baton,
       SVN_ERR(svn_ra_serf__get_relative_path(
                                         &rel_path,
                                         commit_ctx->session->session_url.path,
-                                        commit_ctx->session, NULL,
+                                        commit_ctx->session,
                                         scratch_pool));
       commit_ctx->txn_root_url = svn_path_url_add_component2(
                                         commit_ctx->txn_root_url,
@@ -1369,8 +1305,7 @@ open_root(void *edit_baton,
       dir->base_revision = base_revision;
       dir->relpath = "";
       dir->name = "";
-      dir->changed_props = apr_hash_make(dir->pool);
-      dir->removed_props = apr_hash_make(dir->pool);
+      dir->prop_changes = apr_hash_make(dir->pool);
       dir->url = apr_pstrdup(dir->pool, commit_ctx->txn_root_url);
 
       /* If we included our revprops in the POST, we need not
@@ -1384,21 +1319,8 @@ open_root(void *edit_baton,
       if (!activity_str)
         SVN_ERR(svn_ra_serf__v1_get_activity_collection(
                                     &activity_str,
-                                    commit_ctx->session->conns[0],
-                                    commit_ctx->pool, scratch_pool));
-
-      /* Cache the result. */
-      if (activity_str)
-        {
-          commit_ctx->session->activity_collection_url =
-            apr_pstrdup(commit_ctx->session->pool, activity_str);
-        }
-      else
-        {
-          return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
-                                  _("The OPTIONS response did not include the "
-                                    "requested activity-collection-set value"));
-        }
+                                    commit_ctx->session,
+                                    scratch_pool, scratch_pool));
 
       commit_ctx->activity_url = svn_path_url_add_component2(
                                     activity_str,
@@ -1406,12 +1328,10 @@ open_root(void *edit_baton,
                                     commit_ctx->pool);
 
       /* Create our activity URL now on the server. */
-      handler = svn_ra_serf__create_handler(scratch_pool);
+      handler = svn_ra_serf__create_handler(commit_ctx->session, scratch_pool);
 
       handler->method = "MKACTIVITY";
       handler->path = commit_ctx->activity_url;
-      handler->conn = commit_ctx->session->conns[0];
-      handler->session = commit_ctx->session;
 
       handler->response_handler = svn_ra_serf__expect_empty_body;
       handler->response_baton = handler;
@@ -1423,8 +1343,7 @@ open_root(void *edit_baton,
 
       /* Now go fetch our VCC and baseline so we can do a CHECKOUT. */
       SVN_ERR(svn_ra_serf__discover_vcc(&(commit_ctx->vcc_url),
-                                        commit_ctx->session,
-                                        commit_ctx->conn, commit_ctx->pool));
+                                        commit_ctx->session, scratch_pool));
 
 
       /* Build our directory baton. */
@@ -1434,8 +1353,7 @@ open_root(void *edit_baton,
       dir->base_revision = base_revision;
       dir->relpath = "";
       dir->name = "";
-      dir->changed_props = apr_hash_make(dir->pool);
-      dir->removed_props = apr_hash_make(dir->pool);
+      dir->prop_changes = apr_hash_make(dir->pool);
 
       SVN_ERR(get_version_url(&dir->url, dir->commit_ctx->session,
                               dir->relpath,
@@ -1458,35 +1376,22 @@ open_root(void *edit_baton,
       proppatch_ctx->pool = scratch_pool;
       proppatch_ctx->commit_ctx = NULL; /* No lock info */
       proppatch_ctx->path = proppatch_target;
-      proppatch_ctx->changed_props = apr_hash_make(proppatch_ctx->pool);
-      proppatch_ctx->removed_props = apr_hash_make(proppatch_ctx->pool);
+      proppatch_ctx->prop_changes = apr_hash_make(proppatch_ctx->pool);
       proppatch_ctx->base_revision = SVN_INVALID_REVNUM;
 
       for (hi = apr_hash_first(scratch_pool, commit_ctx->revprop_table);
            hi;
            hi = apr_hash_next(hi))
         {
-          const char *name = apr_hash_this_key(hi);
-          svn_string_t *value = apr_hash_this_val(hi);
-          const char *ns;
+          svn_prop_t *prop = apr_palloc(scratch_pool, sizeof(*prop));
 
-          if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
-            {
-              ns = SVN_DAV_PROP_NS_SVN;
-              name += sizeof(SVN_PROP_PREFIX) - 1;
-            }
-          else
-            {
-              ns = SVN_DAV_PROP_NS_CUSTOM;
-            }
+          prop->name = apr_hash_this_key(hi);
+          prop->value = apr_hash_this_val(hi);
 
-          svn_ra_serf__set_prop(proppatch_ctx->changed_props,
-                                proppatch_ctx->path,
-                                ns, name, value, scratch_pool);
+          svn_hash_sets(proppatch_ctx->prop_changes, prop->name, prop);
         }
 
       SVN_ERR(proppatch_resource(commit_ctx->session,
-                                 commit_ctx->conn,
                                  proppatch_ctx, scratch_pool));
     }
 
@@ -1530,9 +1435,7 @@ delete_entry(const char *path,
   delete_ctx->revision = revision;
   delete_ctx->commit_ctx = dir->commit_ctx;
 
-  handler = svn_ra_serf__create_handler(pool);
-  handler->session = dir->commit_ctx->session;
-  handler->conn = dir->commit_ctx->conn;
+  handler = svn_ra_serf__create_handler(dir->commit_ctx->session, pool);
 
   handler->response_handler = svn_ra_serf__expect_empty_body;
   handler->response_baton = handler;
@@ -1580,8 +1483,7 @@ add_directory(const char *path,
   dir->copy_path = apr_pstrdup(dir->pool, copyfrom_path);
   dir->relpath = apr_pstrdup(dir->pool, path);
   dir->name = svn_relpath_basename(dir->relpath, NULL);
-  dir->changed_props = apr_hash_make(dir->pool);
-  dir->removed_props = apr_hash_make(dir->pool);
+  dir->prop_changes = apr_hash_make(dir->pool);
 
   if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
     {
@@ -1601,9 +1503,7 @@ add_directory(const char *path,
                                dir->name, dir->pool);
     }
 
-  handler = svn_ra_serf__create_handler(dir->pool);
-  handler->conn = dir->commit_ctx->conn;
-  handler->session = dir->commit_ctx->session;
+  handler = svn_ra_serf__create_handler(dir->commit_ctx->session, dir->pool);
 
   handler->response_handler = svn_ra_serf__expect_empty_body;
   handler->response_baton = handler;
@@ -1628,10 +1528,8 @@ add_directory(const char *path,
                                    dir->copy_path);
         }
 
-      /* ### conn==NULL for session->conns[0]. same as commit->conn.  */
       SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
                                           dir->commit_ctx->session,
-                                          NULL /* conn */,
                                           uri.path, dir->copy_revision,
                                           dir_pool, dir_pool));
 
@@ -1673,8 +1571,7 @@ open_directory(const char *path,
   dir->base_revision = base_revision;
   dir->relpath = apr_pstrdup(dir->pool, path);
   dir->name = svn_relpath_basename(dir->relpath, NULL);
-  dir->changed_props = apr_hash_make(dir->pool);
-  dir->removed_props = apr_hash_make(dir->pool);
+  dir->prop_changes = apr_hash_make(dir->pool);
 
   if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
     {
@@ -1698,46 +1595,23 @@ static svn_error_t *
 change_dir_prop(void *dir_baton,
                 const char *name,
                 const svn_string_t *value,
-                apr_pool_t *pool)
+                apr_pool_t *scratch_pool)
 {
   dir_context_t *dir = dir_baton;
-  const char *ns;
-  const char *proppatch_target;
-
+  svn_prop_t *prop;
 
-  if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
-    {
-      proppatch_target = dir->url;
-    }
-  else
+  if (! USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
     {
       /* Ensure we have a checked out dir. */
-      SVN_ERR(checkout_dir(dir, pool /* scratch_pool */));
-
-      proppatch_target = dir->working_url;
+      SVN_ERR(checkout_dir(dir, scratch_pool));
     }
 
-  if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
-    {
-      ns = SVN_DAV_PROP_NS_SVN;
-      name += sizeof(SVN_PROP_PREFIX) - 1;
-    }
-  else
-    {
-      ns = SVN_DAV_PROP_NS_CUSTOM;
-    }
+  prop = apr_palloc(dir->pool, sizeof(*prop));
 
-  if (value)
-    {
-      svn_ra_serf__set_prop(dir->changed_props, proppatch_target,
-                            ns, name, value, dir->pool);
-    }
-  else
-    {
-      value = svn_string_create_empty(pool);
-      svn_ra_serf__set_prop(dir->removed_props, proppatch_target,
-                            ns, name, value, dir->pool);
-    }
+  prop->name = apr_pstrdup(dir->pool, name);
+  prop->value = svn_string_dup(value, dir->pool);
+
+  svn_hash_sets(dir->prop_changes, prop->name, prop);
 
   return SVN_NO_ERROR;
 }
@@ -1753,17 +1627,15 @@ close_directory(void *dir_baton,
    */
 
   /* PROPPATCH our prop change and pass it along.  */
-  if (apr_hash_count(dir->changed_props) ||
-      apr_hash_count(dir->removed_props))
+  if (apr_hash_count(dir->prop_changes))
     {
       proppatch_context_t *proppatch_ctx;
 
       proppatch_ctx = apr_pcalloc(pool, sizeof(*proppatch_ctx));
       proppatch_ctx->pool = pool;
-      proppatch_ctx->commit_ctx = dir->commit_ctx;
+      proppatch_ctx->commit_ctx = NULL /* No lock tokens necessary */;
       proppatch_ctx->relpath = dir->relpath;
-      proppatch_ctx->changed_props = dir->changed_props;
-      proppatch_ctx->removed_props = dir->removed_props;
+      proppatch_ctx->prop_changes = dir->prop_changes;
       proppatch_ctx->base_revision = dir->base_revision;
 
       if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit_ctx))
@@ -1776,7 +1648,6 @@ close_directory(void *dir_baton,
         }
 
       SVN_ERR(proppatch_resource(dir->commit_ctx->session,
-                                 dir->commit_ctx->conn,
                                  proppatch_ctx, dir->pool));
     }
 
@@ -1809,8 +1680,7 @@ add_file(const char *path,
   new_file->base_revision = SVN_INVALID_REVNUM;
   new_file->copy_path = apr_pstrdup(new_file->pool, copy_path);
   new_file->copy_revision = copy_revision;
-  new_file->changed_props = apr_hash_make(new_file->pool);
-  new_file->removed_props = apr_hash_make(new_file->pool);
+  new_file->prop_changes = apr_hash_make(new_file->pool);
 
   /* Ensure that the file doesn't exist by doing a HEAD on the
      resource.  If we're using HTTP v2, we'll just look into the
@@ -1853,18 +1723,15 @@ add_file(const char *path,
       if (status)
         return svn_ra_serf__wrap_err(status, NULL);
 
-      /* ### conn==NULL for session->conns[0]. same as commit_ctx->conn.  */
       SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
                                           dir->commit_ctx->session,
-                                          NULL /* conn */,
                                           uri.path, copy_revision,
                                           scratch_pool, scratch_pool));
 
-      handler = svn_ra_serf__create_handler(scratch_pool);
+      handler = svn_ra_serf__create_handler(dir->commit_ctx->session,
+                                            scratch_pool);
       handler->method = "COPY";
       handler->path = req_url;
-      handler->conn = dir->commit_ctx->conn;
-      handler->session = dir->commit_ctx->session;
 
       handler->response_handler = svn_ra_serf__expect_empty_body;
       handler->response_baton = handler;
@@ -1883,15 +1750,15 @@ add_file(const char *path,
       svn_ra_serf__handler_t *handler;
       svn_error_t *err;
 
-      handler = svn_ra_serf__create_handler(scratch_pool);
-      handler->session = new_file->commit_ctx->session;
-      handler->conn = new_file->commit_ctx->conn;
+      handler = svn_ra_serf__create_handler(dir->commit_ctx->session,
+                                            scratch_pool);
       handler->method = "HEAD";
       handler->path = svn_path_url_add_component2(
                                         dir->commit_ctx->session->session_url.path,
                                         path, scratch_pool);
       handler->response_handler = svn_ra_serf__expect_empty_body;
       handler->response_baton = handler;
+      handler->no_dav_headers = TRUE; /* Read only operation outside txn */
 
       err = svn_ra_serf__context_run_one(handler, scratch_pool);
 
@@ -1933,8 +1800,7 @@ open_file(const char *path,
   new_file->name = svn_relpath_basename(new_file->relpath, NULL);
   new_file->added = FALSE;
   new_file->base_revision = base_revision;
-  new_file->changed_props = apr_hash_make(new_file->pool);
-  new_file->removed_props = apr_hash_make(new_file->pool);
+  new_file->prop_changes = apr_hash_make(new_file->pool);
 
   if (USING_HTTPV2_COMMIT_SUPPORT(parent->commit_ctx))
     {
@@ -2008,30 +1874,14 @@ change_file_prop(void *file_baton,
                  apr_pool_t *pool)
 {
   file_context_t *file = file_baton;
-  const char *ns;
+  svn_prop_t *prop;
 
-  if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
-    {
-      ns = SVN_DAV_PROP_NS_SVN;
-      name += sizeof(SVN_PROP_PREFIX) - 1;
-    }
-  else
-    {
-      ns = SVN_DAV_PROP_NS_CUSTOM;
-    }
+  prop = apr_palloc(file->pool, sizeof(*prop));
 
-  if (value)
-    {
-      svn_ra_serf__set_prop(file->changed_props, file->url,
-                            ns, name, value, file->pool);
-    }
-  else
-    {
-      value = svn_string_create_empty(pool);
+  prop->name = apr_pstrdup(file->pool, name);
+  prop->value = svn_string_dup(value, file->pool);
 
-      svn_ra_serf__set_prop(file->removed_props, file->url,
-                            ns, name, value, file->pool);
-    }
+  svn_hash_sets(file->prop_changes, prop->name, prop);
 
   return SVN_NO_ERROR;
 }
@@ -2058,12 +1908,11 @@ close_file(void *file_baton,
       svn_ra_serf__handler_t *handler;
       int expected_result;
 
-      handler = svn_ra_serf__create_handler(scratch_pool);
+      handler = svn_ra_serf__create_handler(ctx->commit_ctx->session,
+                                            scratch_pool);
 
       handler->method = "PUT";
       handler->path = ctx->url;
-      handler->conn = ctx->commit_ctx->conn;
-      handler->session = ctx->commit_ctx->session;
 
       handler->response_handler = svn_ra_serf__expect_empty_body;
       handler->response_baton = handler;
@@ -2099,8 +1948,7 @@ close_file(void *file_baton,
     SVN_ERR(svn_io_file_close(ctx->svndiff, scratch_pool));
 
   /* If we had any prop changes, push them via PROPPATCH. */
-  if (apr_hash_count(ctx->changed_props) ||
-      apr_hash_count(ctx->removed_props))
+  if (apr_hash_count(ctx->prop_changes))
     {
       proppatch_context_t *proppatch;
 
@@ -2109,12 +1957,10 @@ close_file(void *file_baton,
       proppatch->relpath = ctx->relpath;
       proppatch->path = ctx->url;
       proppatch->commit_ctx = ctx->commit_ctx;
-      proppatch->changed_props = ctx->changed_props;
-      proppatch->removed_props = ctx->removed_props;
+      proppatch->prop_changes = ctx->prop_changes;
       proppatch->base_revision = ctx->base_revision;
 
       SVN_ERR(proppatch_resource(ctx->commit_ctx->session,
-                                 ctx->commit_ctx->conn,
                                  proppatch, scratch_pool));
     }
 
@@ -2133,7 +1979,6 @@ close_edit(void *edit_baton,
   /* MERGE our activity */
   SVN_ERR(svn_ra_serf__run_merge(&commit_info,
                                  ctx->session,
-                                 ctx->session->conns[0],
                                  merge_target,
                                  ctx->lock_tokens,
                                  ctx->keep_locks,
@@ -2148,12 +1993,10 @@ close_edit(void *edit_baton,
     {
       svn_ra_serf__handler_t *handler;
 
-      handler = svn_ra_serf__create_handler(pool);
+      handler = svn_ra_serf__create_handler(ctx->session, pool);
 
       handler->method = "DELETE";
       handler->path = ctx->activity_url;
-      handler->conn = ctx->conn;
-      handler->session = ctx->session;
 
       handler->response_handler = svn_ra_serf__expect_empty_body;
       handler->response_baton = handler;
@@ -2186,11 +2029,9 @@ abort_edit(void *edit_baton,
   serf_connection_reset(ctx->session->conns[0]->conn);
 
   /* DELETE our aborted activity */
-  handler = svn_ra_serf__create_handler(pool);
+  handler = svn_ra_serf__create_handler(ctx->session, pool);
 
   handler->method = "DELETE";
-  handler->conn = ctx->session->conns[0];
-  handler->session = ctx->session;
 
   handler->response_handler = svn_ra_serf__expect_empty_body;
   handler->response_baton = handler;
@@ -2243,7 +2084,6 @@ svn_ra_serf__get_commit_editor(svn_ra_se
   ctx->pool = pool;
 
   ctx->session = session;
-  ctx->conn = session->conns[0];
 
   ctx->revprop_table = svn_prop_hash_dup(revprop_table, pool);
 
@@ -2311,9 +2151,9 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
   svn_ra_serf__session_t *session = ra_session->priv;
   proppatch_context_t *proppatch_ctx;
   const char *proppatch_target;
-  const char *ns;
   const svn_string_t *tmp_old_value;
   svn_boolean_t atomic_capable = FALSE;
+  svn_prop_t *prop;
   svn_error_t *err;
 
   if (old_value_p || !value)
@@ -2356,70 +2196,39 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
     {
       const char *vcc_url;
 
-      SVN_ERR(svn_ra_serf__discover_vcc(&vcc_url, session,
-                                        session->conns[0], pool));
+      SVN_ERR(svn_ra_serf__discover_vcc(&vcc_url, session, pool));
 
       SVN_ERR(svn_ra_serf__fetch_dav_prop(&proppatch_target,
-                                          session->conns[0], vcc_url, rev,
-                                          "href",
+                                          session, vcc_url, rev, "href",
                                           pool, pool));
     }
 
-  if (strncmp(name, SVN_PROP_PREFIX, sizeof(SVN_PROP_PREFIX) - 1) == 0)
-    {
-      ns = SVN_DAV_PROP_NS_SVN;
-      name += sizeof(SVN_PROP_PREFIX) - 1;
-    }
-  else
-    {
-      ns = SVN_DAV_PROP_NS_CUSTOM;
-    }
-
   /* PROPPATCH our log message and pass it along.  */
   proppatch_ctx = apr_pcalloc(pool, sizeof(*proppatch_ctx));
   proppatch_ctx->pool = pool;
   proppatch_ctx->commit_ctx = NULL; /* No lock headers */
   proppatch_ctx->path = proppatch_target;
-  proppatch_ctx->changed_props = apr_hash_make(pool);
-  proppatch_ctx->removed_props = apr_hash_make(pool);
-  if (old_value_p)
-    {
-      proppatch_ctx->previous_changed_props = apr_hash_make(pool);
-      proppatch_ctx->previous_removed_props = apr_hash_make(pool);
-    }
+  proppatch_ctx->prop_changes = apr_hash_make(pool);
   proppatch_ctx->base_revision = SVN_INVALID_REVNUM;
 
-  if (old_value_p && *old_value_p)
-    {
-      svn_ra_serf__set_prop(proppatch_ctx->previous_changed_props,
-                            proppatch_ctx->path,
-                            ns, name, *old_value_p, pool);
-    }
-  else if (old_value_p)
+  if (old_value_p)
     {
-      svn_string_t *dummy_value = svn_string_create_empty(pool);
+      prop = apr_palloc(pool, sizeof (*prop));
 
-      svn_ra_serf__set_prop(proppatch_ctx->previous_removed_props,
-                            proppatch_ctx->path,
-                            ns, name, dummy_value, pool);
-    }
+      prop->name = name;
+      prop->value = *old_value_p;
 
-  if (value)
-    {
-      svn_ra_serf__set_prop(proppatch_ctx->changed_props, proppatch_ctx->path,
-                            ns, name, value, pool);
+      proppatch_ctx->old_props = apr_hash_make(pool);
+      svn_hash_sets(proppatch_ctx->old_props, prop->name, prop);
     }
-  else
-    {
-      value = svn_string_create_empty(pool);
 
-      svn_ra_serf__set_prop(proppatch_ctx->removed_props, proppatch_ctx->path,
-                            ns, name, value, pool);
-    }
+  prop = apr_palloc(pool, sizeof (*prop));
+
+  prop->name = name;
+  prop->value = value;
+  svn_hash_sets(proppatch_ctx->prop_changes, prop->name, prop);
 
-  err = proppatch_resource(session,
-                           session->conns[0],
-                            proppatch_ctx, pool);
+  err = proppatch_resource(session, proppatch_ctx, pool);
 
   /* Use specific error code for old property value mismatch.
      Use loop to provide the right result with tracing */

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_deleted_rev.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_deleted_rev.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_deleted_rev.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_deleted_rev.c Mon Feb  9 11:23:39 2015
@@ -92,7 +92,8 @@ static svn_error_t *
 create_getdrev_body(serf_bucket_t **body_bkt,
                     void *baton,
                     serf_bucket_alloc_t *alloc,
-                    apr_pool_t *pool)
+                    apr_pool_t *pool /* request pool */,
+                    apr_pool_t *scratch_pool)
 {
   serf_bucket_t *buckets;
   drev_context_t *drev_ctx = baton;
@@ -148,23 +149,20 @@ svn_ra_serf__get_deleted_rev(svn_ra_sess
   drev_ctx->revision_deleted = revision_deleted;
 
   SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      ras, NULL /* conn */,
-                                      NULL /* url */, peg_revision,
+                                      ras, NULL /* url */, peg_revision,
                                       pool, pool));
 
   xmlctx = svn_ra_serf__xml_context_create(getdrev_ttable,
                                            NULL, getdrev_closed, NULL,
                                            drev_ctx,
                                            pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, pool);
+  handler = svn_ra_serf__create_expat_handler(ras, xmlctx, NULL, pool);
 
   handler->method = "REPORT";
   handler->path = req_url;
   handler->body_type = "text/xml";
   handler->body_delegate = create_getdrev_body;
   handler->body_delegate_baton = drev_ctx;
-  handler->conn = ras->conns[0];
-  handler->session = ras;
 
   err = svn_ra_serf__context_run_one(handler, pool);
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_file.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_file.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_file.c Mon Feb  9 11:23:39 2015
@@ -83,7 +83,8 @@ typedef struct stream_ctx_t {
 static svn_error_t *
 headers_fetch(serf_bucket_t *headers,
               void *baton,
-              apr_pool_t *pool)
+              apr_pool_t *pool /* request pool */,
+              apr_pool_t *scratch_pool)
 {
   stream_ctx_t *fetch_ctx = baton;
 
@@ -143,12 +144,10 @@ cancel_fetch(serf_request_t *request,
 static svn_error_t *
 try_get_wc_contents(svn_boolean_t *found_p,
                     svn_ra_serf__session_t *session,
-                    apr_hash_t *props,
+                    const char *sha1_checksum_prop,
                     svn_stream_t *dst_stream,
                     apr_pool_t *pool)
 {
-  apr_hash_t *svn_props;
-  const char *sha1_checksum_prop;
   svn_checksum_t *checksum;
   svn_stream_t *wc_stream;
   svn_error_t *err;
@@ -156,24 +155,10 @@ try_get_wc_contents(svn_boolean_t *found
   /* No contents found by default. */
   *found_p = FALSE;
 
-  if (!session->wc_callbacks->get_wc_contents)
-    {
-      /* No callback, nothing to do. */
-      return SVN_NO_ERROR;
-    }
-
-
-  svn_props = svn_hash_gets(props, SVN_DAV_PROP_NS_DAV);
-  if (!svn_props)
-    {
-      /* No properties -- therefore no checksum property -- in response. */
-      return SVN_NO_ERROR;
-    }
-
-  sha1_checksum_prop = svn_prop_get_value(svn_props, "sha1-checksum");
-  if (sha1_checksum_prop == NULL)
+  if (!session->wc_callbacks->get_wc_contents
+      || sha1_checksum_prop == NULL)
     {
-      /* No checksum property in response. */
+      /* Nothing to do. */
       return SVN_NO_ERROR;
     }
 
@@ -279,6 +264,55 @@ handle_stream(serf_request_t *request,
   /* not reached */
 }
 
+/* Baton for get_file_prop_cb */
+struct file_prop_baton_t
+{
+  apr_pool_t *result_pool;
+  svn_node_kind_t kind;
+  apr_hash_t *props;
+  const char *sha1_checksum;
+};
+
+/* Implements svn_ra_serf__prop_func_t for svn_ra_serf__get_file */
+static svn_error_t *
+get_file_prop_cb(void *baton,
+                 const char *path,
+                 const char *ns,
+                 const char *name,
+                 const svn_string_t *value,
+                 apr_pool_t *scratch_pool)
+{
+  struct file_prop_baton_t *fb = baton;
+  const char *svn_name;
+
+  if (strcmp(ns, "DAV:") == 0 && strcmp(name, "resourcetype") == 0)
+    {
+      const char *val = value->data;
+
+      if (strcmp(val, "collection") == 0)
+        fb->kind = svn_node_dir;
+      else
+        fb->kind = svn_node_file;
+
+      return SVN_NO_ERROR;
+    }
+  else if (strcmp(ns, SVN_DAV_PROP_NS_DAV) == 0
+           && strcmp(name, "sha1-checksum") == 0)
+    {
+      fb->sha1_checksum = apr_pstrdup(fb->result_pool, value->data);
+    }
+
+  if (!fb->props)
+    return SVN_NO_ERROR;
+
+  svn_name = svn_ra_serf__svnname_from_wirename(ns, name, fb->result_pool);
+  if (svn_name)
+    {
+      svn_hash_sets(fb->props, svn_name,
+                    svn_string_dup(value, fb->result_pool));
+    }
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
 svn_ra_serf__get_file(svn_ra_session_t *ra_session,
@@ -290,14 +324,10 @@ svn_ra_serf__get_file(svn_ra_session_t *
                       apr_pool_t *pool)
 {
   svn_ra_serf__session_t *session = ra_session->priv;
-  svn_ra_serf__connection_t *conn;
   const char *fetch_url;
-  apr_hash_t *fetch_props;
-  svn_node_kind_t res_kind;
   const svn_ra_serf__dav_props_t *which_props;
-
-  /* What connection should we go on? */
-  conn = session->conns[session->cur_conn];
+  svn_ra_serf__handler_t *propfind_handler;
+  struct file_prop_baton_t fb;
 
   /* Fetch properties. */
 
@@ -311,7 +341,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
   if (SVN_IS_VALID_REVNUM(revision) || fetched_rev)
     {
       SVN_ERR(svn_ra_serf__get_stable_url(&fetch_url, fetched_rev,
-                                          session, conn,
+                                          session,
                                           fetch_url, revision,
                                           pool, pool));
       revision = SVN_INVALID_REVNUM;
@@ -320,44 +350,39 @@ svn_ra_serf__get_file(svn_ra_session_t *
   SVN_ERR_ASSERT(!SVN_IS_VALID_REVNUM(revision));
 
   if (props)
-    {
       which_props = all_props;
-    }
   else if (stream && session->wc_callbacks->get_wc_contents)
-    {
       which_props = type_and_checksum_props;
-    }
   else
-    {
       which_props = check_path_props;
-    }
 
-  SVN_ERR(svn_ra_serf__fetch_node_props(&fetch_props, conn, fetch_url,
-                                        SVN_INVALID_REVNUM,
-                                        which_props,
-                                        pool, pool));
+  fb.result_pool = pool;
+  fb.props = props ? apr_hash_make(pool) : NULL;
+  fb.kind = svn_node_unknown;
+  fb.sha1_checksum = NULL;
+
+  SVN_ERR(svn_ra_serf__create_propfind_handler(&propfind_handler, session,
+                                               fetch_url, SVN_INVALID_REVNUM,
+                                               "0", which_props,
+                                               get_file_prop_cb, &fb,
+                                               pool));
+
+  SVN_ERR(svn_ra_serf__context_run_one(propfind_handler, pool));
 
   /* Verify that resource type is not collection. */
-  SVN_ERR(svn_ra_serf__get_resource_type(&res_kind, fetch_props));
-  if (res_kind != svn_node_file)
+  if (fb.kind != svn_node_file)
     {
       return svn_error_create(SVN_ERR_FS_NOT_FILE, NULL,
                               _("Can't get text contents of a directory"));
     }
 
-  /* TODO Filter out all of our props into a usable format. */
   if (props)
-    {
-      /* ### flatten_props() does not copy PROPVALUE, but fetch_node_props()
-         ### put them into POOL, so we're okay.  */
-      SVN_ERR(svn_ra_serf__flatten_props(props, fetch_props,
-                                         pool, pool));
-    }
+    *props = fb.props;
 
   if (stream)
     {
       svn_boolean_t found;
-      SVN_ERR(try_get_wc_contents(&found, session, fetch_props, stream, pool));
+      SVN_ERR(try_get_wc_contents(&found, session, fb.sha1_checksum, stream, pool));
 
       /* No contents found in the WC, let's fetch from server. */
       if (!found)
@@ -370,12 +395,10 @@ svn_ra_serf__get_file(svn_ra_session_t *
           stream_ctx->result_stream = stream;
           stream_ctx->using_compression = session->using_compression;
 
-          handler = svn_ra_serf__create_handler(pool);
+          handler = svn_ra_serf__create_handler(session, pool);
 
           handler->method = "GET";
           handler->path = fetch_url;
-          handler->conn = conn;
-          handler->session = session;
 
           handler->custom_accept_encoding = TRUE;
           handler->no_dav_headers = TRUE;

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_lock.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_lock.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/get_lock.c Mon Feb  9 11:23:39 2015
@@ -232,7 +232,8 @@ static svn_error_t *
 create_getlock_body(serf_bucket_t **body_bkt,
                     void *baton,
                     serf_bucket_alloc_t *alloc,
-                    apr_pool_t *pool)
+                    apr_pool_t *pool /* request pool */,
+                    apr_pool_t *scratch_pool)
 {
   serf_bucket_t *buckets;
 
@@ -255,7 +256,8 @@ create_getlock_body(serf_bucket_t **body
 static svn_error_t*
 setup_getlock_headers(serf_bucket_t *headers,
                       void *baton,
-                      apr_pool_t *pool)
+                      apr_pool_t *pool /* request pool */,
+                      apr_pool_t *scratch_pool)
 {
   serf_bucket_headers_setn(headers, "Depth", "0");
 
@@ -289,14 +291,13 @@ svn_ra_serf__get_lock(svn_ra_session_t *
                                            NULL, locks_closed, NULL,
                                            lock_ctx,
                                            scratch_pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, locks_expected_status,
+  handler = svn_ra_serf__create_expat_handler(session, xmlctx,
+                                              locks_expected_status,
                                               scratch_pool);
 
   handler->method = "PROPFIND";
   handler->path = req_url;
   handler->body_type = "text/xml";
-  handler->conn = session->conns[0];
-  handler->session = session;
 
   handler->body_delegate = create_getlock_body;
   handler->body_delegate_baton = lock_ctx;
@@ -304,6 +305,8 @@ svn_ra_serf__get_lock(svn_ra_session_t *
   handler->header_delegate = setup_getlock_headers;
   handler->header_delegate_baton = lock_ctx;
 
+  handler->no_dav_headers = TRUE;
+
   lock_ctx->inner_handler = handler->response_handler;
   lock_ctx->inner_baton = handler->response_baton;
   handler->response_handler = handle_lock;
@@ -318,8 +321,8 @@ svn_ra_serf__get_lock(svn_ra_session_t *
     return svn_error_trace(
              svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err,
                               _("Server does not support locking features")));
-  else if (err)
-    return svn_error_trace(err);
+  else if (svn_error_find_cause(err, SVN_ERR_FS_NOT_FOUND))
+    svn_error_clear(err); /* Behave like the other RA layers */
   else if (handler->sline.code != 207)
     return svn_error_trace(svn_ra_serf__unexpected_status(handler));
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getdate.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getdate.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getdate.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getdate.c Mon Feb  9 11:23:39 2015
@@ -100,7 +100,8 @@ static svn_error_t *
 create_getdate_body(serf_bucket_t **body_bkt,
                     void *baton,
                     serf_bucket_alloc_t *alloc,
-                    apr_pool_t *pool)
+                    apr_pool_t *pool /* request pool */,
+                    apr_pool_t *scratch_pool)
 {
   serf_bucket_t *buckets;
   date_context_t *date_ctx = baton;
@@ -139,19 +140,17 @@ svn_ra_serf__get_dated_revision(svn_ra_s
   date_ctx->time = tm;
   date_ctx->revision = revision;
 
-  SVN_ERR(svn_ra_serf__report_resource(&report_target, session, NULL, pool));
+  SVN_ERR(svn_ra_serf__report_resource(&report_target, session, pool));
 
   xmlctx = svn_ra_serf__xml_context_create(date_ttable,
                                            NULL, date_closed, NULL,
                                            date_ctx,
                                            pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, pool);
+  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
 
   handler->method = "REPORT";
   handler->path = report_target;
   handler->body_type = "text/xml";
-  handler->conn = session->conns[0];
-  handler->session = session;
 
   handler->body_delegate = create_getdate_body;
   handler->body_delegate_baton = date_ctx;

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocations.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocations.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocations.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocations.c Mon Feb  9 11:23:39 2015
@@ -114,7 +114,8 @@ static svn_error_t *
 create_get_locations_body(serf_bucket_t **body_bkt,
                           void *baton,
                           serf_bucket_alloc_t *alloc,
-                          apr_pool_t *pool)
+                          apr_pool_t *pool /* request pool */,
+                          apr_pool_t *scratch_pool)
 {
   serf_bucket_t *buckets;
   loc_context_t *loc_ctx = baton;
@@ -175,23 +176,20 @@ svn_ra_serf__get_locations(svn_ra_sessio
   *locations = loc_ctx->paths;
 
   SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      session, NULL /* conn */,
-                                      NULL /* url */, peg_revision,
+                                      session,  NULL /* url */, peg_revision,
                                       pool, pool));
 
   xmlctx = svn_ra_serf__xml_context_create(getloc_ttable,
                                            NULL, getloc_closed, NULL,
                                            loc_ctx,
                                            pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, pool);
+  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
 
   handler->method = "REPORT";
   handler->path = req_url;
   handler->body_delegate = create_get_locations_body;
   handler->body_delegate_baton = loc_ctx;
   handler->body_type = "text/xml";
-  handler->conn = session->conns[0];
-  handler->session = session;
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocationsegments.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocationsegments.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocationsegments.c Mon Feb  9 11:23:39 2015
@@ -114,7 +114,8 @@ static svn_error_t *
 create_gls_body(serf_bucket_t **body_bkt,
                 void *baton,
                 serf_bucket_alloc_t *alloc,
-                apr_pool_t *pool)
+                apr_pool_t *pool /* request pool */,
+                apr_pool_t *scratch_pool)
 {
   serf_bucket_t *buckets;
   gls_context_t *gls_ctx = baton;
@@ -178,23 +179,20 @@ svn_ra_serf__get_location_segments(svn_r
   gls_ctx->receiver_baton = receiver_baton;
 
   SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      session, NULL /* conn */,
-                                      NULL /* url */, peg_revision,
+                                      session, NULL /* url */, peg_revision,
                                       pool, pool));
 
   xmlctx = svn_ra_serf__xml_context_create(gls_ttable,
                                            NULL, gls_closed, NULL,
                                            gls_ctx,
                                            pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, pool);
+  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
 
   handler->method = "REPORT";
   handler->path = req_url;
   handler->body_delegate = create_gls_body;
   handler->body_delegate_baton = gls_ctx;
   handler->body_type = "text/xml";
-  handler->conn = session->conns[0];
-  handler->session = session;
 
   err = svn_ra_serf__context_run_one(handler, pool);
 

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocks.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/getlocks.c Mon Feb  9 11:23:39 2015
@@ -213,7 +213,8 @@ static svn_error_t *
 create_getlocks_body(serf_bucket_t **body_bkt,
                      void *baton,
                      serf_bucket_alloc_t *alloc,
-                     apr_pool_t *pool)
+                     apr_pool_t *pool /* request pool */,
+                     apr_pool_t *scratch_pool)
 {
   lock_context_t *lock_ctx = baton;
   serf_bucket_t *buckets;
@@ -244,8 +245,7 @@ svn_ra_serf__get_locks(svn_ra_session_t
   svn_error_t *err;
 
   req_url = svn_path_url_add_component2(session->session_url.path, path, pool);
-  SVN_ERR(svn_ra_serf__get_relative_path(&rel_path, req_url, session,
-                                         NULL, pool));
+  SVN_ERR(svn_ra_serf__get_relative_path(&rel_path, req_url, session, pool));
 
   lock_ctx = apr_pcalloc(pool, sizeof(*lock_ctx));
   lock_ctx->pool = pool;
@@ -257,13 +257,11 @@ svn_ra_serf__get_locks(svn_ra_session_t
                                            NULL, getlocks_closed, NULL,
                                            lock_ctx,
                                            pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, pool);
+  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
 
   handler->method = "REPORT";
   handler->path = req_url;
   handler->body_type = "text/xml";
-  handler->conn = session->conns[0];
-  handler->session = session;
 
   handler->body_delegate = create_getlocks_body;
   handler->body_delegate_baton = lock_ctx;

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/inherited_props.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/inherited_props.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/inherited_props.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/inherited_props.c Mon Feb  9 11:23:39 2015
@@ -199,7 +199,8 @@ static svn_error_t *
 create_iprops_body(serf_bucket_t **bkt,
                    void *baton,
                    serf_bucket_alloc_t *alloc,
-                   apr_pool_t *pool)
+                   apr_pool_t *pool /* request pool */,
+                   apr_pool_t *scratch_pool)
 {
   iprops_context_t *iprops_ctx = baton;
   serf_bucket_t *body_bkt;
@@ -231,21 +232,6 @@ typedef struct iprop_rq_info_t
   svn_ra_serf__handler_t *handler;
 } iprop_rq_info_t;
 
-/* Removes all non regular properties from PROPS */
-static void
-keep_only_regular_props(apr_hash_t *props,
-                        apr_pool_t *scratch_pool)
-{
-  apr_hash_index_t *hi;
-
-  for (hi = apr_hash_first(scratch_pool, props); hi; hi = apr_hash_next(hi))
-    {
-      const char *propname = apr_hash_this_key(hi);
-
-      if (svn_property_kind2(propname) != svn_prop_regular_kind)
-        svn_hash_sets(props, propname, NULL);
-    }
-}
 
 /* Assumes session reparented to the repository root. The old session
    root is passed as session_url */
@@ -287,17 +273,19 @@ get_iprops_via_more_requests(svn_ra_sess
       rq->props = apr_hash_make(scratch_pool);
 
       SVN_ERR(svn_ra_serf__get_stable_url(&rq->urlpath, NULL, session,
-                                          session->conns[0],
                                           svn_path_url_add_component2(
                                                 session->repos_root.path,
                                                 relpath, scratch_pool),
                                           revision,
                                           scratch_pool, scratch_pool));
 
-      SVN_ERR(svn_ra_serf__deliver_props(&rq->handler, rq->props, session,
-                                         session->conns[0], rq->urlpath,
-                                         rev_marker, "0", all_props,
-                                         scratch_pool));
+      SVN_ERR(svn_ra_serf__create_propfind_handler(
+                                          &rq->handler, session,
+                                          rq->urlpath,
+                                          rev_marker, "0", all_props,
+                                          svn_ra_serf__deliver_svn_props,
+                                          rq->props,
+                                          scratch_pool));
 
       /* Allow ignoring authz problems */
       rq->handler->no_fail_on_http_failure_status = TRUE;
@@ -335,29 +323,18 @@ get_iprops_via_more_requests(svn_ra_sess
       apr_hash_t *node_props;
       svn_prop_inherited_item_t *new_iprop;
 
-      if (rq->handler->sline.code >= 400 && rq->handler->sline.code != 403)
+      if (rq->handler->sline.code != 207 && rq->handler->sline.code != 403)
         {
-          return svn_error_trace(
-                        svn_ra_serf__error_on_status(rq->handler->sline,
-                                                     rq->handler->path,
-                                                     rq->handler->location));
-        }
+          if (rq->handler->server_error)
+            SVN_ERR(svn_ra_serf__server_error_create(rq->handler,
+                                                     scratch_pool));
 
-      /* Obtain the real properties from the double hash */
-      node_props = apr_hash_get(rq->props, &rev_marker, sizeof(rev_marker));
-
-      if (!node_props)
-        continue;
-
-      node_props = svn_hash_gets(node_props, rq->urlpath);
-
-      if (!node_props)
-        continue;
+          return svn_error_trace(svn_ra_serf__unexpected_status(rq->handler));
+        }
 
-      SVN_ERR(svn_ra_serf__flatten_props(&node_props, node_props,
-                                         scratch_pool, scratch_pool));
+      node_props = rq->props;
 
-      keep_only_regular_props(node_props, scratch_pool);
+      svn_ra_serf__keep_only_regular_props(node_props, scratch_pool);
 
       if (!apr_hash_count(node_props))
         continue;
@@ -410,7 +387,6 @@ svn_ra_serf__get_inherited_props(svn_ra_
                                         scratch_pool));
         }
 
-      /* For now, use implementation in libsvn_ra */
       err = get_iprops_via_more_requests(ra_session, iprops, session_uri, path,
                                          revision, result_pool, scratch_pool);
 
@@ -426,7 +402,6 @@ svn_ra_serf__get_inherited_props(svn_ra_
   SVN_ERR(svn_ra_serf__get_stable_url(&req_url,
                                       NULL /* latest_revnum */,
                                       session,
-                                      NULL /* conn */,
                                       NULL /* url */,
                                       revision,
                                       scratch_pool, scratch_pool));
@@ -448,12 +423,12 @@ svn_ra_serf__get_inherited_props(svn_ra_
                                            NULL,
                                            iprops_ctx,
                                            scratch_pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, scratch_pool);
+  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL,
+                                              scratch_pool);
 
   handler->method = "REPORT";
   handler->path = req_url;
-  handler->conn = session->conns[0];
-  handler->session = session;
+
   handler->body_delegate = create_iprops_body;
   handler->body_delegate_baton = iprops_ctx;
   handler->body_type = "text/xml";

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/lock.c Mon Feb  9 11:23:39 2015
@@ -191,7 +191,8 @@ locks_closed(svn_ra_serf__xml_estate_t *
 static svn_error_t *
 set_lock_headers(serf_bucket_t *headers,
                  void *baton,
-                 apr_pool_t *pool)
+                 apr_pool_t *pool /* request pool */,
+                 apr_pool_t *scratch_pool)
 {
   lock_ctx_t *lock_ctx = baton;
 
@@ -335,7 +336,7 @@ run_locks(svn_ra_serf__session_t *sess,
                 {
                   svn_lock_t *report_lock = NULL;
 
-                  if (locking)
+                  if (locking && ctx->lock->token)
                     report_lock = ctx->lock;
 
                   cb_err = lock_func(lock_baton, ctx->path, locking,
@@ -399,7 +400,8 @@ static svn_error_t *
 create_lock_body(serf_bucket_t **body_bkt,
                  void *baton,
                  serf_bucket_alloc_t *alloc,
-                 apr_pool_t *pool)
+                 apr_pool_t *pool /* request pool */,
+                 apr_pool_t *scratch_pool)
 {
   lock_ctx_t *ctx = baton;
   serf_bucket_t *buckets;
@@ -482,7 +484,8 @@ svn_ra_serf__lock(svn_ra_session_t *ra_s
                                                NULL, locks_closed, NULL,
                                                lock_ctx,
                                                lock_pool);
-      handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, lock_pool);
+      handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL,
+                                                  lock_pool);
 
       handler->method = "LOCK";
       handler->path = req_url;
@@ -495,8 +498,6 @@ svn_ra_serf__lock(svn_ra_session_t *ra_s
       if (session->cur_conn >= session->num_conns)
         session->cur_conn = 0;
 
-      handler->session = session;
-
       handler->header_delegate = set_lock_headers;
       handler->header_delegate_baton = lock_ctx;
 
@@ -528,7 +529,8 @@ svn_ra_serf__lock(svn_ra_session_t *ra_s
 static svn_error_t *
 set_unlock_headers(serf_bucket_t *headers,
                    void *baton,
-                   apr_pool_t *pool)
+                   apr_pool_t *pool /* request pool */,
+                   apr_pool_t *scratch_pool)
 {
   lock_ctx_t *ctx = baton;
 
@@ -647,12 +649,10 @@ svn_ra_serf__unlock(svn_ra_session_t *ra
       req_url = svn_path_url_add_component2(session->session_url.path, lock_ctx->path,
                                             lock_pool);
 
-      handler = svn_ra_serf__create_handler(lock_pool);
+      handler = svn_ra_serf__create_handler(session, lock_pool);
 
       handler->method = "UNLOCK";
       handler->path = req_url;
-      handler->conn = session->conns[0];
-      handler->session = session;
 
       handler->header_delegate = set_unlock_headers;
       handler->header_delegate_baton = lock_ctx;

Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/log.c?rev=1658362&r1=1658361&r2=1658362&view=diff
==============================================================================
--- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/log.c Mon Feb  9 11:23:39 2015
@@ -412,7 +412,8 @@ static svn_error_t *
 create_log_body(serf_bucket_t **body_bkt,
                 void *baton,
                 serf_bucket_alloc_t *alloc,
-                apr_pool_t *pool)
+                apr_pool_t *pool /* request pool */,
+                apr_pool_t *scratch_pool)
 {
   serf_bucket_t *buckets;
   log_context_t *log_ctx = baton;
@@ -579,7 +580,7 @@ svn_ra_serf__get_log(svn_ra_session_t *r
   peg_rev = (start == SVN_INVALID_REVNUM || start > end) ? start : end;
 
   SVN_ERR(svn_ra_serf__get_stable_url(&req_url, NULL /* latest_revnum */,
-                                      session, NULL /* conn */,
+                                      session,
                                       NULL /* url */, peg_rev,
                                       pool, pool));
 
@@ -587,15 +588,13 @@ svn_ra_serf__get_log(svn_ra_session_t *r
                                            log_opened, log_closed, NULL,
                                            log_ctx,
                                            pool);
-  handler = svn_ra_serf__create_expat_handler(xmlctx, NULL, pool);
+  handler = svn_ra_serf__create_expat_handler(session, xmlctx, NULL, pool);
 
   handler->method = "REPORT";
   handler->path = req_url;
   handler->body_delegate = create_log_body;
   handler->body_delegate_baton = log_ctx;
   handler->body_type = "text/xml";
-  handler->conn = session->conns[0];
-  handler->session = session;
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 



Mime
View raw message