You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/02/20 08:45:54 UTC

svn commit: r1072522 [3/9] - in /subversion/branches/performance: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ notes/ notes/wc-ng/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/...

Modified: subversion/branches/performance/subversion/libsvn_fs_base/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_base/dag.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_base/dag.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_base/dag.c Sun Feb 20 07:45:48 2011
@@ -1275,15 +1275,9 @@ svn_fs_base__dag_finalize_edits(dag_node
         return svn_error_create(SVN_ERR_BAD_CHECKSUM_KIND, NULL, NULL);
 
       if (! svn_checksum_match(checksum, test_checksum))
-        return svn_error_createf
-          (SVN_ERR_CHECKSUM_MISMATCH, NULL,
-           apr_psprintf(pool, "%s:\n%s\n%s\n",
+        return svn_checksum_mismatch_err(checksum, test_checksum, pool,
                         _("Checksum mismatch on representation '%s'"),
-                        _("   expected:  %s"),
-                        _("     actual:  %s")),
-           noderev->edit_key,
-           svn_checksum_to_cstring_display(checksum, pool),
-           svn_checksum_to_cstring_display(test_checksum, pool));
+                        noderev->edit_key);
     }
 
   /* Now, we want to delete the old representation and replace it with

Modified: subversion/branches/performance/subversion/libsvn_fs_base/reps-strings.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_base/reps-strings.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_base/reps-strings.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_base/reps-strings.c Sun Feb 20 07:45:48 2011
@@ -823,15 +823,11 @@ svn_fs_base__rep_contents(svn_string_t *
                          pool));
 
     if (! svn_checksum_match(checksum, rep_checksum))
-      return svn_error_createf
-        (SVN_ERR_FS_CORRUPT, NULL,
-         apr_psprintf(pool, "%s:\n%s\n%s\n",
-                      _("Checksum mismatch on representation '%s'"),
-                      _("   expected:  %s"),
-                      _("     actual:  %s")),
-         rep_key,
-         svn_checksum_to_cstring_display(rep_checksum, pool),
-         svn_checksum_to_cstring_display(checksum, pool));
+      return svn_error_create(SVN_ERR_FS_CORRUPT,
+                svn_checksum_mismatch_err(rep_checksum, checksum, pool,
+                            _("Checksum mismatch on representation '%s'"),
+                            rep_key),
+                NULL);
   }
 
   return SVN_NO_ERROR;
@@ -921,32 +917,22 @@ txn_body_read_rep(void *baton, trail_t *
               if (rep->md5_checksum
                   && (! svn_checksum_match(rep->md5_checksum,
                                            args->rb->md5_checksum)))
-                return svn_error_createf
-                  (SVN_ERR_FS_CORRUPT, NULL,
-                   apr_psprintf(trail->pool, "%s:\n%s\n%s\n",
-                                _("MD5 checksum mismatch on representation '%s'"),
-                                _("   expected:  %s"),
-                                _("     actual:  %s")),
-                   args->rb->rep_key,
-                   svn_checksum_to_cstring_display(rep->md5_checksum,
-                                                   trail->pool),
-                   svn_checksum_to_cstring_display(args->rb->md5_checksum,
-                                                   trail->pool));
+                return svn_error_create(SVN_ERR_FS_CORRUPT,
+                        svn_checksum_mismatch_err(rep->md5_checksum,
+                             args->rb->sha1_checksum, trail->pool,
+                             _("MD5 checksum mismatch on representation '%s'"),
+                             args->rb->rep_key),
+                        NULL);
 
               if (rep->sha1_checksum
                   && (! svn_checksum_match(rep->sha1_checksum,
                                            args->rb->sha1_checksum)))
-                return svn_error_createf
-                  (SVN_ERR_FS_CORRUPT, NULL,
-                   apr_psprintf(trail->pool, "%s:\n%s\n%s\n",
-                                _("SHA1 checksum mismatch on representation '%s'"),
-                                _("   expected:  %s"),
-                                _("     actual:  %s")),
-                   args->rb->rep_key,
-                   svn_checksum_to_cstring_display(rep->sha1_checksum,
-                                                   trail->pool),
-                   svn_checksum_to_cstring_display(args->rb->sha1_checksum,
-                                                   trail->pool));
+                return svn_error_createf(SVN_ERR_FS_CORRUPT,
+                        svn_checksum_mismatch_err(rep->sha1_checksum,
+                            args->rb->sha1_checksum, trail->pool,
+                            _("SHA1 checksum mismatch on representation '%s'"),
+                            args->rb->rep_key),
+                        NULL);
             }
         }
     }

Modified: subversion/branches/performance/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_base/tree.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_base/tree.c Sun Feb 20 07:45:48 2011
@@ -3875,16 +3875,10 @@ txn_body_apply_textdelta(void *baton, tr
          check could be more comprehensive? */
       if (tb->base_checksum->kind == checksum->kind
             && !svn_checksum_match(tb->base_checksum, checksum))
-        return svn_error_createf
-          (SVN_ERR_CHECKSUM_MISMATCH,
-           NULL,
-           apr_psprintf(trail->pool, "%s:\n%s\n%s\n",
-                        _("Base checksum mismatch on '%s'"),
-                        _("   expected:  %s"),
-                        _("     actual:  %s")),
-           tb->path,
-           svn_checksum_to_cstring_display(tb->base_checksum, trail->pool),
-           svn_checksum_to_cstring_display(checksum, trail->pool));
+        return svn_checksum_mismatch_err(tb->base_checksum, checksum,
+                            trail->pool,
+                            _("Base checksum mismatch on '%s'"),
+                            tb->path);
     }
 
   /* Make a readable "source" stream out of the current contents of

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/caching.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/caching.c Sun Feb 20 07:45:48 2011
@@ -32,8 +32,6 @@
 
 #include "svn_private_config.h"
 
-/*** Dup/serialize/deserialize functions. ***/
-
 /* Return a memcache in *MEMCACHE_P for FS if it's configured to use
    memcached, or NULL otherwise.  Also, sets *FAIL_STOP to a boolean
    indicating whether cache errors should be returned to the caller or

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/dag.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/dag.c Sun Feb 20 07:45:48 2011
@@ -1039,16 +1039,9 @@ svn_fs_fs__dag_finalize_edits(dag_node_t
       SVN_ERR(svn_fs_fs__dag_file_checksum(&file_checksum, file,
                                            checksum->kind, pool));
       if (!svn_checksum_match(checksum, file_checksum))
-        return svn_error_createf(SVN_ERR_CHECKSUM_MISMATCH, NULL,
-                                 apr_psprintf(pool, "%s:\n%s\n%s\n",
-                                              _("Checksum mismatch for '%s'"),
-                                              _("   expected:  %s"),
-                                              _("     actual:  %s")),
-                                 file->created_path,
-                                 svn_checksum_to_cstring_display(checksum,
-                                                                 pool),
-                                 svn_checksum_to_cstring_display(file_checksum,
-                                                                 pool));
+        return svn_checksum_mismatch_err(checksum, file_checksum, pool,
+                                         _("Checksum mismatch for '%s'"),
+                                         file->created_path);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c Sun Feb 20 07:45:48 2011
@@ -1134,9 +1134,9 @@ read_config(svn_fs_t *fs,
 {
   fs_fs_data_t *ffd = fs->fsap_data;
 
-  SVN_ERR(svn_config_read(&ffd->config,
-                          svn_dirent_join(fs->path, PATH_CONFIG, pool),
-                          FALSE, fs->pool));
+  SVN_ERR(svn_config_read2(&ffd->config,
+                           svn_dirent_join(fs->path, PATH_CONFIG, pool),
+                           FALSE, FALSE, fs->pool));
 
   /* Initialize ffd->rep_sharing_allowed. */
   if (ffd->format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT)
@@ -3847,14 +3847,11 @@ rep_read_contents(void *baton,
           SVN_ERR(svn_checksum_final(&md5_checksum, rb->md5_checksum_ctx,
                                      rb->pool));
           if (!svn_checksum_match(md5_checksum, rb->md5_checksum))
-            return svn_error_createf
-              (SVN_ERR_FS_CORRUPT, NULL,
-               apr_psprintf(rb->pool, "%s:\n%s\n%s\n",
-                            _("Checksum mismatch while reading representation"),
-                            _("   expected:  %s"),
-                            _("     actual:  %s")),
-               svn_checksum_to_cstring_display(rb->md5_checksum, rb->pool),
-               svn_checksum_to_cstring_display(md5_checksum, rb->pool));
+            return svn_error_create(SVN_ERR_FS_CORRUPT,
+                    svn_checksum_mismatch_err(rb->md5_checksum, md5_checksum,
+                        rb->pool,
+                        _("Checksum mismatch while reading representation")),
+                    NULL);
         }
     }
 

Propchange: subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Feb 20 07:45:48 2011
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:962911-1027198,1039498-1043512
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:962911-1027198,1039498-1043512,1067687-1072519

Propchange: subversion/branches/performance/subversion/libsvn_fs_fs/temp_serializer.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Feb 20 07:45:48 2011
@@ -34,4 +34,4 @@
 /subversion/branches/tc_url_rev/subversion/libsvn_fs_fs/fs_fs.h:874351-874483
 /subversion/branches/tree-conflicts/subversion/libsvn_fs_fs/fs_fs.h:868291-873154
 /subversion/branches/tree-conflicts-notify/subversion/libsvn_fs_fs/fs_fs.h:873926-874008
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:962911-1027198,1039498-1043512
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:962911-1027198,1039498-1043512,1067687-1072519

Modified: subversion/branches/performance/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/tree.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/tree.c Sun Feb 20 07:45:48 2011
@@ -2455,16 +2455,9 @@ apply_textdelta(void *baton, apr_pool_t 
       SVN_ERR(svn_fs_fs__dag_file_checksum(&checksum, tb->node,
                                            tb->base_checksum->kind, pool));
       if (!svn_checksum_match(tb->base_checksum, checksum))
-        return svn_error_createf
-          (SVN_ERR_CHECKSUM_MISMATCH,
-           NULL,
-           apr_psprintf(pool, "%s:\n%s\n%s\n",
-                        _("Base checksum mismatch on '%s'"),
-                        _("   expected:  %s"),
-                        _("     actual:  %s")),
-           tb->path,
-           svn_checksum_to_cstring_display(tb->base_checksum, pool),
-           svn_checksum_to_cstring_display(checksum, pool));
+        return svn_checksum_mismatch_err(tb->base_checksum, checksum, pool,
+                                         _("Base checksum mismatch on '%s'"),
+                                         tb->path);
     }
 
   /* Make a readable "source" stream out of the current contents of
@@ -3512,16 +3505,17 @@ crawl_directory_dag_for_mergeinfo(svn_fs
                                   const char *this_path,
                                   dag_node_t *dir_dag,
                                   svn_mergeinfo_catalog_t result_catalog,
-                                  apr_pool_t *pool,
-                                  apr_pool_t *result_pool)
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool)
 {
   apr_hash_t *entries;
   apr_hash_index_t *hi;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
-  SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, dir_dag, pool, pool));
+  SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, dir_dag,
+                                     scratch_pool, scratch_pool));
 
-  for (hi = apr_hash_first(pool, entries);
+  for (hi = apr_hash_first(scratch_pool, entries);
        hi;
        hi = apr_hash_next(hi))
     {
@@ -3573,8 +3567,8 @@ crawl_directory_dag_for_mergeinfo(svn_fs
                                                   kid_path,
                                                   kid_dag,
                                                   result_catalog,
-                                                  iterpool,
-                                                  result_pool));
+                                                  result_pool,
+                                                  iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -3622,19 +3616,19 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
                        const char *path,
                        svn_mergeinfo_inheritance_t inherit,
                        svn_boolean_t validate_inherited_mergeinfo,
-                       apr_pool_t *pool,
-                       apr_pool_t *result_pool)
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool)
 {
   parent_path_t *parent_path, *nearest_ancestor;
   apr_hash_t *proplist;
   svn_string_t *mergeinfo_string;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
   *mergeinfo = NULL;
 
-  path = svn_fs__canonicalize_abspath(path, pool);
+  path = svn_fs__canonicalize_abspath(path, scratch_pool);
 
-  SVN_ERR(open_path(&parent_path, rev_root, path, 0, NULL, pool));
+  SVN_ERR(open_path(&parent_path, rev_root, path, 0, NULL, scratch_pool));
 
   if (inherit == svn_mergeinfo_nearest_ancestor && ! parent_path->parent)
     return SVN_NO_ERROR;
@@ -3672,14 +3666,15 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
         }
     }
 
-  SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, nearest_ancestor->node, pool));
+  SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, nearest_ancestor->node,
+                                      scratch_pool));
   mergeinfo_string = apr_hash_get(proplist, SVN_PROP_MERGEINFO,
                                   APR_HASH_KEY_STRING);
   if (!mergeinfo_string)
     return svn_error_createf
       (SVN_ERR_FS_CORRUPT, NULL,
        _("Node-revision '%s@%ld' claims to have mergeinfo but doesn't"),
-       parent_path_path(nearest_ancestor, pool), rev_root->rev);
+       parent_path_path(nearest_ancestor, scratch_pool), rev_root->rev);
 
   if (nearest_ancestor == parent_path)
     {
@@ -3700,22 +3695,23 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
 
       SVN_ERR(svn_mergeinfo_parse(&temp_mergeinfo,
                                   mergeinfo_string->data,
-                                  pool));
+                                  scratch_pool));
       SVN_ERR(svn_mergeinfo_inheritable(&temp_mergeinfo,
                                         temp_mergeinfo,
                                         NULL, SVN_INVALID_REVNUM,
-                                        SVN_INVALID_REVNUM, pool));
+                                        SVN_INVALID_REVNUM, scratch_pool));
 
       SVN_ERR(append_to_merged_froms(mergeinfo,
                                      temp_mergeinfo,
                                      parent_path_relpath(parent_path,
                                                          nearest_ancestor,
-                                                         pool),
+                                                         scratch_pool),
                                      result_pool));
 
       if (validate_inherited_mergeinfo)
         SVN_ERR(svn_fs_fs__validate_mergeinfo(mergeinfo, rev_root->fs,
-                                              *mergeinfo, pool, iterpool));
+                                              *mergeinfo, result_pool,
+                                              iterpool));
       svn_pool_destroy(iterpool);
       return SVN_NO_ERROR;
     }
@@ -3728,23 +3724,23 @@ static svn_error_t *
 add_descendant_mergeinfo(svn_mergeinfo_catalog_t result_catalog,
                          svn_fs_root_t *root,
                          const char *path,
-                         apr_pool_t *pool,
-                         apr_pool_t *result_pool)
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool)
 {
   dag_node_t *this_dag;
   svn_boolean_t go_down;
 
-  SVN_ERR(get_dag(&this_dag, root, path, pool));
+  SVN_ERR(get_dag(&this_dag, root, path, scratch_pool));
   SVN_ERR(svn_fs_fs__dag_has_descendants_with_mergeinfo(&go_down,
                                                         this_dag,
-                                                        pool));
+                                                        scratch_pool));
   if (go_down)
     SVN_ERR(crawl_directory_dag_for_mergeinfo(root,
                                               path,
                                               this_dag,
                                               result_catalog,
-                                              pool,
-                                              result_pool));
+                                              result_pool,
+                                              scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -3777,13 +3773,13 @@ get_mergeinfos_for_paths(svn_fs_root_t *
 
       SVN_ERR(get_mergeinfo_for_path(&path_mergeinfo, root, path,
                                      inherit, validate_inherited_mergeinfo,
-                                     iterpool, pool));
+                                     pool, iterpool));
       if (path_mergeinfo)
         apr_hash_set(result_catalog, path, APR_HASH_KEY_STRING,
                      path_mergeinfo);
       if (include_descendants)
-        SVN_ERR(add_descendant_mergeinfo(result_catalog, root, path, iterpool,
-                                         pool));
+        SVN_ERR(add_descendant_mergeinfo(result_catalog, root, path, pool,
+                                         iterpool));
     }
   svn_pool_destroy(iterpool);
 

Modified: subversion/branches/performance/subversion/libsvn_fs_util/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_util/caching.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_util/caching.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_util/caching.c Sun Feb 20 07:45:48 2011
@@ -34,18 +34,48 @@
 static svn_fs_cache_config_t cache_settings =
   {
     /* default configuration:
+     *
+     * Please note that the resources listed below will be allocated
+     * PER PROCESS. Thus, the defaults chosen here are kept deliberately
+     * low to still make a difference yet to ensure that pre-fork servers
+     * on machines with small amounts of RAM aren't severely impacted.
      */
-    0x1000000,   /* 16 MB for caches */
-    16,          /* up to 16 files kept open */
-    TRUE,        /* cache fulltexts */
-    FALSE,       /* don't cache text deltas */
-
+    0x1000000,   /* 16 MB for caches.
+                  * If you are running a single server process,
+                  * you may easily increase that to 50+% of your RAM
+                  * using svn_fs_set_cache_config().
+                  */
+    16,          /* up to 16 files kept open.
+                  * Most OS restrict the number of open file handles to
+                  * about 1000. To minimize I/O and OS overhead, values
+                  * of 500+ can be beneficial (use svn_fs_set_cache_config()
+                  * to change the configuration).
+                  * When running with a huge in-process cache, this number
+                  * has little impact on performance and a more modest
+                  * value (< 100) may be more suitable.
+                  */
+    TRUE,        /* cache fulltexts.
+                  * Most SVN tools care about reconstructed file content.
+                  * Thus, this is a reasonable default.
+                  * SVN admin tools may set that to FALSE because fulltexts
+                  * won't be re-used rendering the cache less effective
+                  * by squeezing wanted data out.
+                  */
+    FALSE,       /* don't cache text deltas.
+                  * Once we reconstructed the fulltexts from the deltas,
+                  * these deltas are rarely re-used. Therefore, only tools
+                  * like svnadmin will activate this to speed up operations
+                  * dump and verify.
+                  */
 #ifdef APR_HAS_THREADS
-    FALSE        /* assume multi-threaded operation */
+    FALSE        /* assume multi-threaded operation.
+                  * Because this simply activates proper synchronization
+                  * between threads, it is a safe default.
+                  */
 #else
     TRUE         /* single-threaded is the only supported mode of operation */
 #endif
-  };
+};
 
 /* Get the current FSFS cache configuration. */
 const svn_fs_cache_config_t *
@@ -62,15 +92,17 @@ svn_fs_get_cache_config(void)
 svn_membuffer_t *
 svn_fs__get_global_membuffer_cache(void)
 {
-  static volatile svn_membuffer_t *cache = NULL;
+  static svn_membuffer_t * volatile cache = NULL;
 
   apr_uint64_t cache_size = cache_settings.cache_size;
   if (!cache && cache_size)
     {
+      svn_error_t *err;
+
       svn_membuffer_t *old_cache = NULL;
       svn_membuffer_t *new_cache = NULL;
 
-      /* auto-allocate cache*/
+      /* auto-allocate cache */
       apr_allocator_t *allocator = NULL;
       apr_pool_t *pool = NULL;
 
@@ -82,22 +114,55 @@ svn_fs__get_global_membuffer_cache(void)
        * in its full size, the create() function will clear the pool
        * explicitly. The allocator will make sure that any memory no
        * longer used by the pool will actually be returned to the OS.
+       *
+       * Please note that this pool and allocator is used *only* to
+       * allocate the large membuffer. All later dynamic allocations
+       * come from other, temporary pools and allocators.
        */
       apr_allocator_max_free_set(allocator, 1);
-      pool = svn_pool_create_ex(NULL, allocator);
 
-      svn_error_clear(svn_cache__membuffer_cache_create(
+      /* don't terminate upon OOM but make pool return a NULL pointer
+       * instead so we can disable caching gracefully and continue
+       * operation without membuffer caches.
+       */
+      apr_pool_create_ex(&pool, NULL, NULL, allocator);
+      if (pool == NULL)
+        return NULL;
+
+      err = svn_cache__membuffer_cache_create(
           &new_cache,
           (apr_size_t)cache_size,
           (apr_size_t)(cache_size / 16),
           ! svn_fs_get_cache_config()->single_threaded,
-          pool));
+          pool);
+
+      /* Some error occured. Most likely it's an OOM error but we don't
+       * really care. Simply release all cache memory and disable caching
+       */
+      if (err)
+        {
+          /* Memory and error cleanup */
+          svn_error_clear(err);
+          apr_pool_destroy(pool);
+
+          /* Prevent future attempts to create the cache. However, an
+           * existing cache instance (see next comment) remains valid.
+           */
+          cache_settings.cache_size = 0;
+
+          /* The current caller won't get the cache object.
+           * However, a concurrent call might have succeeded in creating
+           * the cache object. That call and all following ones will then
+           * use the successfully created cache instance.
+           */
+          return NULL;
+        }
 
       /* Handle race condition: if we are the first to create a
        * cache object, make it our global singleton. Otherwise,
        * discard the new cache and keep the existing one.
        */
-      old_cache = apr_atomic_casptr(&cache, new_cache, NULL);
+      old_cache = apr_atomic_casptr((volatile void **)&cache, new_cache, NULL);
       if (old_cache != NULL)
         apr_pool_destroy(pool);
     }

Modified: subversion/branches/performance/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_neon/options.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_neon/options.c Sun Feb 20 07:45:48 2011
@@ -189,26 +189,25 @@ parse_capabilities(ne_request *req,
          slightly more efficiently, but that wouldn't be worth it
          until we have many more capabilities. */
 
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_DEPTH, vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_DEPTH, vals))
         apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_DEPTH,
                      APR_HASH_KEY_STRING, capability_yes);
 
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
         /* The server doesn't know what repository we're referring
            to, so it can't just say capability_yes. */
         apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
                      APR_HASH_KEY_STRING, capability_server_yes);
 
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
         apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_LOG_REVPROPS,
                      APR_HASH_KEY_STRING, capability_yes);
 
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS, vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS, vals))
         apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
                      APR_HASH_KEY_STRING, capability_yes);
 
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY,
-                                      vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY, vals))
         apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_PARTIAL_REPLAY,
                      APR_HASH_KEY_STRING, capability_yes);
     }

Modified: subversion/branches/performance/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_serf/commit.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_serf/commit.c Sun Feb 20 07:45:48 2011
@@ -529,7 +529,7 @@ get_version_url(const char **checked_in_
 
       SVN_ERR(svn_ra_serf__deliver_props(&propfind_ctx, props, session, conn,
                                          propfind_url, base_revision, "0",
-                                         checked_in_props, FALSE, NULL, pool));
+                                         checked_in_props, NULL, pool));
 
       SVN_ERR(svn_ra_serf__wait_for_props(propfind_ctx, session, pool));
 
@@ -1544,11 +1544,9 @@ delete_entry(const char *path,
     {
       svn_error_clear(err);
 
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
       /* An error has been registered on the connection. Reset the thing
          so that we can use it again.  */
       serf_connection_reset(handler->conn->conn);
-#endif
 
       handler->body_delegate = create_delete_body;
       handler->body_delegate_baton = delete_ctx;
@@ -2250,11 +2248,9 @@ abort_edit(void *edit_baton,
   if (! (ctx->activity_url || ctx->txn_url))
     return SVN_NO_ERROR;
 
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
   /* An error occurred on conns[0]. serf 0.4.0 remembers that the connection
      had a problem. We need to reset it, in order to use it again.  */
   serf_connection_reset(ctx->session->conns[0]->conn);
-#endif
 
   /* DELETE our aborted activity */
   handler = apr_pcalloc(pool, sizeof(*handler));
@@ -2406,7 +2402,7 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
       propfind_ctx = NULL;
       SVN_ERR(svn_ra_serf__deliver_props(&propfind_ctx, props, commit->session,
                                          commit->conn, vcc_url, rev, "0",
-                                         checked_in_props, FALSE, NULL, pool));
+                                         checked_in_props, NULL, pool));
 
       SVN_ERR(svn_ra_serf__wait_for_props(propfind_ctx, commit->session, pool));
 

Modified: subversion/branches/performance/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_serf/options.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_serf/options.c Sun Feb 20 07:45:48 2011
@@ -295,33 +295,31 @@ capabilities_headers_iterator_callback(v
          efficiently, but that wouldn't be worth it until we have many
          more capabilities. */
 
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_DEPTH, vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_DEPTH, vals))
         {
           apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_DEPTH,
                        APR_HASH_KEY_STRING, capability_yes);
         }
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
         {
           /* The server doesn't know what repository we're referring
              to, so it can't just say capability_yes. */
           apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
                        APR_HASH_KEY_STRING, capability_server_yes);
         }
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS,
-                                      vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
         {
           apr_hash_set(orc->session->capabilities,
                        SVN_RA_CAPABILITY_LOG_REVPROPS,
                        APR_HASH_KEY_STRING, capability_yes);
         }
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS,
-                                      vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS, vals))
         {
           apr_hash_set(orc->session->capabilities,
                        SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
                        APR_HASH_KEY_STRING, capability_yes);
         }
-      if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY, vals))
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY, vals))
         {
           apr_hash_set(orc->session->capabilities,
                        SVN_RA_CAPABILITY_PARTIAL_REPLAY,

Modified: subversion/branches/performance/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_serf/property.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_serf/property.c Sun Feb 20 07:45:48 2011
@@ -87,9 +87,6 @@ struct svn_ra_serf__propfind_context_t {
   /* the list of requested properties */
   const svn_ra_serf__dav_props_t *find_props;
 
-  /* should we cache the values of this propfind in our session? */
-  svn_boolean_t cache_props;
-
   /* hash table that will be updated with the properties
    *
    * This can be shared between multiple svn_ra_serf__propfind_context_t
@@ -385,18 +382,6 @@ end_propfind(svn_ra_serf__xml_parser_t *
                                 ctx->current_path, ctx->rev,
                                 ns, pname, val_str,
                                 ctx->pool);
-      if (ctx->cache_props)
-        {
-          ns = apr_pstrdup(ctx->sess->pool, info->ns);
-          pname = apr_pstrdup(ctx->sess->pool, info->name);
-          val = apr_pmemdup(ctx->sess->pool, info->val, info->val_len);
-          val_str = svn_string_ncreate(val, info->val_len, ctx->sess->pool);
-
-          svn_ra_serf__set_ver_prop(ctx->sess->cached_props,
-                                    ctx->current_path, ctx->rev,
-                                    ns, pname, val_str,
-                                    ctx->sess->pool);
-        }
 
       svn_ra_serf__xml_pop_state(parser);
     }
@@ -533,40 +518,6 @@ create_propfind_body(serf_bucket_t **bkt
   return SVN_NO_ERROR;
 }
 
-static svn_boolean_t
-check_cache(apr_hash_t *ret_props,
-            svn_ra_serf__session_t *sess,
-            const char *path,
-            svn_revnum_t rev,
-            const svn_ra_serf__dav_props_t *find_props,
-            apr_pool_t *pool)
-{
-  svn_boolean_t cache_hit = TRUE;
-  const svn_ra_serf__dav_props_t *prop;
-
-  /* check to see if we have any of this information cached */
-  prop = find_props;
-  while (prop && prop->namespace)
-    {
-      const svn_string_t *val;
-
-      val = svn_ra_serf__get_ver_prop_string(sess->cached_props, path, rev,
-                                             prop->namespace, prop->name);
-      if (val)
-        {
-          svn_ra_serf__set_ver_prop(ret_props, path, rev,
-                                    prop->namespace, prop->name, val, pool);
-        }
-      else
-        {
-          cache_hit = FALSE;
-        }
-      prop++;
-    }
-
-  return cache_hit;
-}
-
 /*
  * This function will deliver a PROP_CTX PROPFIND request in the SESS
  * serf context for the properties listed in LOOKUP_PROPS at URL for
@@ -586,7 +537,6 @@ svn_ra_serf__deliver_props(svn_ra_serf__
                            svn_revnum_t rev,
                            const char *depth,
                            const svn_ra_serf__dav_props_t *find_props,
-                           svn_boolean_t cache_props,
                            svn_ra_serf__list_t **done_list,
                            apr_pool_t *pool)
 {
@@ -597,25 +547,10 @@ svn_ra_serf__deliver_props(svn_ra_serf__
       svn_ra_serf__handler_t *handler;
       svn_ra_serf__xml_parser_t *parser_ctx;
 
-      if (cache_props)
-        {
-          svn_boolean_t cache_satisfy;
-
-          cache_satisfy = check_cache(ret_props, sess, path, rev, find_props,
-                                      pool);
-
-          if (cache_satisfy)
-            {
-              *prop_ctx = NULL;
-              return SVN_NO_ERROR;
-            }
-        }
-
       new_prop_ctx = apr_pcalloc(pool, sizeof(*new_prop_ctx));
 
       new_prop_ctx->pool = apr_hash_pool_get(ret_props);
       new_prop_ctx->path = path;
-      new_prop_ctx->cache_props = cache_props;
       new_prop_ctx->find_props = find_props;
       new_prop_ctx->ret_props = ret_props;
       new_prop_ctx->depth = depth;
@@ -742,7 +677,7 @@ svn_ra_serf__retrieve_props(apr_hash_t *
   svn_ra_serf__propfind_context_t *prop_ctx = NULL;
 
   SVN_ERR(svn_ra_serf__deliver_props(&prop_ctx, prop_vals, sess, conn, url,
-                                     rev, depth, props, TRUE, NULL, pool));
+                                     rev, depth, props, NULL, pool));
   if (prop_ctx)
     {
       SVN_ERR(svn_ra_serf__wait_for_props(prop_ctx, sess, pool));
@@ -959,6 +894,50 @@ svn_ra_serf__set_bare_props(void *baton,
                         ns, ns_len, name, name_len, val, pool);
 }
 
+static svn_error_t *
+retrieve_baseline_info(svn_revnum_t *actual_revision,
+                       const char **basecoll_url_p,
+                       svn_ra_serf__session_t *session,
+                       svn_ra_serf__connection_t *conn,
+                       const char *baseline_url,
+                       svn_revnum_t revision,                       
+                       apr_pool_t  *pool)
+{
+  apr_hash_t *props = apr_hash_make(pool);
+  const char *basecoll_url;
+  const char *version_name;
+
+  SVN_ERR(svn_ra_serf__retrieve_props(props, session, conn,
+                                      baseline_url, revision, "0",
+                                      baseline_props, pool));
+
+  basecoll_url  = svn_ra_serf__get_ver_prop(props, baseline_url, revision,
+                                            "DAV:",
+                                            "baseline-collection");
+
+  if (!basecoll_url)
+    {
+      return svn_error_create(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL,
+                              _("The PROPFIND response did not include "
+                                "the requested baseline-collection value"));
+    }
+
+  *basecoll_url_p = svn_urlpath__canonicalize(basecoll_url, pool);
+
+  version_name = svn_ra_serf__get_ver_prop(props, baseline_url, revision,
+                                       "DAV:", SVN_DAV__VERSION_NAME);
+  if (!version_name)
+    {
+      return svn_error_create(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL,
+                              _("The PROPFIND response did not include "
+                              "the requested version-name value"));
+    }
+
+  *actual_revision = SVN_STR_TO_REV(version_name);
+  
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_ra_serf__get_baseline_info(const char **bc_url,
                                const char **bc_relative,
@@ -991,35 +970,42 @@ svn_ra_serf__get_baseline_info(const cha
 
       if (latest_revnum)
         {
-          svn_ra_serf__options_context_t *opt_ctx;
+          if (SVN_IS_VALID_REVNUM(revision))
+            {
+              *latest_revnum = revision;
+            }
+          else
+           {
+              svn_ra_serf__options_context_t *opt_ctx;
 
-          SVN_ERR(svn_ra_serf__create_options_req(&opt_ctx, session, conn,
+              SVN_ERR(svn_ra_serf__create_options_req(&opt_ctx, session, conn,
                                                   session->repos_url.path,
                                                   pool));
-          SVN_ERR(svn_ra_serf__context_run_wait(
-            svn_ra_serf__get_options_done_ptr(opt_ctx), session, pool));
+              SVN_ERR(svn_ra_serf__context_run_wait(
+                svn_ra_serf__get_options_done_ptr(opt_ctx), session, pool));
 
-          *latest_revnum = svn_ra_serf__options_get_youngest_rev(opt_ctx);
-          if (! SVN_IS_VALID_REVNUM(*latest_revnum))
-            return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
-                                    _("The OPTIONS response did not include "
-                                      "the youngest revision"));
+             *latest_revnum = svn_ra_serf__options_get_youngest_rev(opt_ctx);
+             if (! SVN_IS_VALID_REVNUM(*latest_revnum))
+               return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
+                                       _("The OPTIONS response did not include "
+                                         "the youngest revision"));
+          }
         }
     }
 
   /* Otherwise, we fall back to the old VCC_URL PROPFIND hunt.  */
   else
     {
+      svn_revnum_t actual_revision;
+
       SVN_ERR(svn_ra_serf__discover_vcc(&vcc_url, session, conn, pool));
 
       if (revision != SVN_INVALID_REVNUM)
         {
-          SVN_ERR(svn_ra_serf__retrieve_props(props, session, conn,
-                                              vcc_url, revision, "0",
-                                              baseline_props, pool));
-          basecoll_url = svn_ra_serf__get_ver_prop(props, vcc_url, revision,
-                                                   "DAV:",
-                                                   "baseline-collection");
+          SVN_ERR(retrieve_baseline_info(&actual_revision, &basecoll_url,
+                                         session, conn,
+                                         vcc_url, revision,
+                                         pool));
         }
       else
         {
@@ -1037,38 +1023,14 @@ svn_ra_serf__get_baseline_info(const cha
 
           baseline_url = svn_urlpath__canonicalize(baseline_url, pool);
 
-          SVN_ERR(svn_ra_serf__retrieve_props(props, session, conn,
-                                              baseline_url, revision, "0",
-                                              baseline_props, pool));
-          basecoll_url = svn_ra_serf__get_ver_prop(props, baseline_url,
-                                                   revision, "DAV:",
-                                                   "baseline-collection");
-        }
-
-      if (!basecoll_url)
-        {
-          return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
-                                  _("The OPTIONS response did not include the "
-                                    "requested baseline-collection value"));
+          SVN_ERR(retrieve_baseline_info(&actual_revision, &basecoll_url,
+                                         session, conn,
+                                         baseline_url, revision, pool));
         }
 
-      basecoll_url = svn_urlpath__canonicalize(basecoll_url, pool);
-
       if (latest_revnum)
         {
-          const char *version_name;
-
-          version_name = svn_ra_serf__get_prop(props, baseline_url,
-                                               "DAV:", SVN_DAV__VERSION_NAME);
-
-          if (!version_name)
-            {
-              return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
-                                      _("The OPTIONS response did not include "
-                                        "the requested version-name value"));
-            }
-
-          *latest_revnum = SVN_STR_TO_REV(version_name);
+          *latest_revnum = actual_revision;
         }
     }
 

Modified: subversion/branches/performance/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_serf/ra_serf.h?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/performance/subversion/libsvn_ra_serf/ra_serf.h Sun Feb 20 07:45:48 2011
@@ -46,8 +46,8 @@ extern "C" {
 
 
 /* Enforce the minimum version of serf. */
-#if !SERF_VERSION_AT_LEAST(0, 3, 0)
-#error Please update your version of serf to at least 0.3.0.
+#if !SERF_VERSION_AT_LEAST(0, 7, 1)
+#error Please update your version of serf to at least 0.7.1.
 #endif
 
 /** Use this to silence compiler warnings about unused parameters. */
@@ -59,24 +59,9 @@ extern "C" {
                    APR_STRINGIFY(SERF_MINOR_VERSION) "." \
                    APR_STRINGIFY(SERF_PATCH_VERSION)
 
-#ifdef WIN32
-#define SVN_RA_SERF_SSPI_ENABLED
-#endif
-
 
 /* Forward declarations. */
 typedef struct svn_ra_serf__session_t svn_ra_serf__session_t;
-typedef struct svn_ra_serf__auth_protocol_t svn_ra_serf__auth_protocol_t;
-
-typedef enum svn_ra_serf__authn_types
-{
-  svn_ra_serf__authn_none      = 0x00,
-  svn_ra_serf__authn_basic     = 0x01,
-  svn_ra_serf__authn_digest    = 0x02,
-  svn_ra_serf__authn_ntlm      = 0x04,
-  svn_ra_serf__authn_negotiate = 0x08,
-  svn_ra_serf__authn_all       = 0xFF,
-} svn_ra_serf__authn_types;
 
 /* A serf connection and optionally associated SSL context.  */
 typedef struct svn_ra_serf__connection_t {
@@ -89,9 +74,6 @@ typedef struct svn_ra_serf__connection_t
   /* Host name */
   const char *hostinfo;
 
-  /* The address where the connections are made to */
-  apr_sockaddr_t *address;
-
   /* Are we using ssl */
   svn_boolean_t using_ssl;
 
@@ -101,12 +83,6 @@ typedef struct svn_ra_serf__connection_t
   /* What was the last HTTP status code we got on this connection? */
   int last_status_code;
 
-  /* Current authorization header used for this connection; may be NULL */
-  const char *auth_header;
-
-  /* Current authorization value used for this connection; may be NULL */
-  const char *auth_value;
-
   /* Optional SSL context for this connection. */
   serf_ssl_context_t *ssl_context;
   svn_auth_iterstate_t *ssl_client_auth_state;
@@ -114,18 +90,6 @@ typedef struct svn_ra_serf__connection_t
 
   svn_ra_serf__session_t *session;
 
-  /* Baton used to store connection specific authn/authz data */
-  void *auth_context;
-
-  /* Baton used to store proxy specific authn/authz data */
-  void *proxy_auth_context;
-
-  /* Current authorization header used for the proxy server; may be NULL */
-  const char *proxy_auth_header;
-
-  /* Current authorization value used for the proxy server; may be NULL */
-  const char *proxy_auth_value;
-
   /* user agent string */
   const char *useragent;
 
@@ -168,13 +132,7 @@ struct svn_ra_serf__session_t {
   /* Our Version-Controlled-Configuration; may be NULL until we know it. */
   const char *vcc_url;
 
-  /* Cached properties */
-  apr_hash_t *cached_props;
-
   /* Authentication related properties. */
-  const char *realm;
-  const char *auth_header;
-  const char *auth_value;
   svn_auth_iterstate_t *auth_state;
   int auth_attempts;
 
@@ -189,11 +147,8 @@ struct svn_ra_serf__session_t {
   /* Error that we've received but not yet returned upstream. */
   svn_error_t *pending_error;
 
-  /* vtable and info object handling the authentication */
-  const svn_ra_serf__auth_protocol_t *auth_protocol;
-
   /* List of authn types supported by the client.*/
-  svn_ra_serf__authn_types authn_types;
+  int authn_types;
 
   /* Maps SVN_RA_CAPABILITY_foo keys to "yes" or "no" values.
      If a capability is not yet discovered, it is absent from the table.
@@ -207,11 +162,6 @@ struct svn_ra_serf__session_t {
   /* Are we using a proxy? */
   int using_proxy;
 
-  /* Proxy Authentication related properties */
-  const char *proxy_auth_header;
-  const char *proxy_auth_value;
-  const svn_ra_serf__auth_protocol_t *proxy_auth_protocol;
-
   const char *proxy_username;
   const char *proxy_password;
   int proxy_auth_attempts;
@@ -349,19 +299,12 @@ static const svn_ra_serf__dav_props_t hr
 
 /** Serf utility functions **/
 
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
 apr_status_t
 svn_ra_serf__conn_setup(apr_socket_t *sock,
                         serf_bucket_t **read_bkt,
                         serf_bucket_t **write_bkt,
                         void *baton,
                         apr_pool_t *pool);
-#else
-serf_bucket_t *
-svn_ra_serf__conn_setup(apr_socket_t *sock,
-                        void *baton,
-                        apr_pool_t *pool);
-#endif
 
 serf_bucket_t*
 svn_ra_serf__accept_response(serf_request_t *request,
@@ -530,9 +473,6 @@ typedef struct svn_ra_serf__handler_t {
 serf_request_t*
 svn_ra_serf__request_create(svn_ra_serf__handler_t *handler);
 
-serf_request_t*
-svn_ra_serf__priority_request_create(svn_ra_serf__handler_t *handler);
-
 /* XML helper callbacks. */
 
 typedef struct svn_ra_serf__xml_state_t {
@@ -795,13 +735,6 @@ const char *
 svn_ra_serf__response_get_location(serf_bucket_t *response,
                                    apr_pool_t *pool);
 
-/* Canonicalize URI, in the general sense.  URI might be a full,
- * absolute, schema-ful URL.  It might be just the path portion of a
- * URL.  Or it might be a relative path.  Whatever the case, it is a
- * URI-encoded identifier of *some sort*, as will be the returned form
- * thereof.
- */
-
 /** XML helper functions. **/
 
 /*
@@ -932,9 +865,7 @@ svn_ra_serf__propfind_status_code(svn_ra
  * serf context for the properties listed in LOOKUP_PROPS at URL for
  * DEPTH ("0","1","infinity").
  *
- * This function will not block waiting for the response.  If the
- * request can be satisfied from a local cache, set PROP_CTX to NULL
- * as a signal to callers of that fact.  Otherwise, callers are
+ * This function will not block waiting for the response. Callers are
  * expected to call svn_ra_serf__wait_for_props().
  */
 svn_error_t *
@@ -946,7 +877,6 @@ svn_ra_serf__deliver_props(svn_ra_serf__
                            svn_revnum_t rev,
                            const char *depth,
                            const svn_ra_serf__dav_props_t *lookup_props,
-                           svn_boolean_t cache_props,
                            svn_ra_serf__list_t **done_list,
                            apr_pool_t *pool);
 
@@ -1444,105 +1374,6 @@ svn_ra_serf__credentials_callback(char *
                                   int code, const char *authn_type,
                                   const char *realm,
                                   apr_pool_t *pool);
-/**
- * For each authentication protocol we need a handler function of type
- * svn_serf__auth_handler_func_t. This function will be called when an
- * authentication challenge is received in a session.
- */
-typedef svn_error_t *
-(*svn_serf__auth_handler_func_t)(svn_ra_serf__handler_t *ctx,
-                                 serf_request_t *request,
-                                 serf_bucket_t *response,
-                                 const char *auth_hdr,
-                                 const char *auth_attr,
-                                 apr_pool_t *pool);
-
-/**
- * For each authentication protocol we need an initialization function of type
- * svn_serf__init_conn_func_t. This function will be called when a new
- * connection is opened.
- */
-typedef svn_error_t *
-(*svn_serf__init_conn_func_t)(svn_ra_serf__session_t *session,
-                              svn_ra_serf__connection_t *conn,
-                              apr_pool_t *pool);
-
-/**
- * For each authentication protocol we need a setup_request function of type
- * svn_serf__setup_request_func_t. This function will be called when a
- * new serf_request_t object is created and should fill in the correct
- * authentication headers (if needed).
- */
-typedef svn_error_t *
-(*svn_serf__setup_request_func_t)(svn_ra_serf__connection_t *conn,
-                                  const char *method,
-                                  const char *uri,
-                                  serf_bucket_t *hdrs_bkt);
-
-/**
- * This function will be called when a response is received, so that the
- * protocol handler can validate the Authentication related response headers
- * (if needed).
- */
-typedef svn_error_t *
-(*svn_serf__validate_response_func_t)(svn_ra_serf__handler_t *ctx,
-                                      serf_request_t *request,
-                                      serf_bucket_t *response,
-                                      apr_pool_t *pool);
-
-/**
- * svn_ra_serf__auth_protocol_t: vtable for an authn protocol provider.
- *
- */
-struct svn_ra_serf__auth_protocol_t {
-  /* The http status code that's handled by this authentication protocol.
-     Normal values are 401 for server authentication and 407 for proxy
-     authentication */
-  int code;
-
-  /* The name of this authentication protocol. This should be a case
-     sensitive match of the string sent in the HTTP authentication header. */
-  const char *auth_name;
-
-  /* Internal code used for this authn type. */
-  svn_ra_serf__authn_types auth_type;
-
-  /* The initialization function if any; otherwise, NULL */
-  svn_serf__init_conn_func_t init_conn_func;
-
-  /* The authentication handler function */
-  svn_serf__auth_handler_func_t handle_func;
-
-  /* Function to set up the authentication header of a request */
-  svn_serf__setup_request_func_t setup_request_func;
-
-  /* Function to validate the authentication header of a response */
-  svn_serf__validate_response_func_t validate_response_func;
-};
-
-/**
- * This function will be called when an authentication challenge is
- * received. Based on the challenge, handle_auth will pick the needed
- * authn implementation and forward the call to its authn handler.
- */
-svn_error_t *
-svn_ra_serf__handle_auth(int code,
-                         svn_ra_serf__handler_t *ctx,
-                         serf_request_t *request,
-                         serf_bucket_t *response,
-                         apr_pool_t *pool);
-
-/**
- * encode_auth_header: base64 encodes the authentication data and builds an
- * authentication header in this format:
- * [PROTOCOL] [BASE64 AUTH DATA]
- */
-void
-svn_ra_serf__encode_auth_header(const char *protocol,
-                                const char **header,
-                                const char *data,
-                                apr_size_t data_len,
-                                apr_pool_t *pool);
 
 
 /*** General utility functions ***/

Modified: subversion/branches/performance/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_serf/replay.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_serf/replay.c Sun Feb 20 07:45:48 2011
@@ -781,7 +781,7 @@ svn_ra_serf__replay_range(svn_ra_session
                                              replay_ctx->revprop_target,
                                              replay_ctx->revprop_rev,
                                              "0", all_props,
-                                             TRUE, NULL,
+                                             NULL,
                                              replay_ctx->src_rev_pool));
 
           replay_ctx->prop_ctx = prop_ctx;

Modified: subversion/branches/performance/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_serf/serf.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_serf/serf.c Sun Feb 20 07:45:48 2011
@@ -86,10 +86,10 @@ ra_serf_get_schemes(apr_pool_t *pool)
 static svn_error_t *
 load_http_auth_types(apr_pool_t *pool, svn_config_t *config,
                      const char *server_group,
-                     svn_ra_serf__authn_types *authn_types)
+                     int *authn_types)
 {
   const char *http_auth_types = NULL;
-  *authn_types = svn_ra_serf__authn_none;
+  *authn_types = SERF_AUTHN_NONE;
 
   svn_config_get(config, &http_auth_types, SVN_CONFIG_SECTION_GLOBAL,
                SVN_CONFIG_OPTION_HTTP_AUTH_TYPES, NULL);
@@ -109,13 +109,13 @@ load_http_auth_types(apr_pool_t *pool, s
         {
           auth_types_list = NULL;
           if (svn_cstring_casecmp("basic", token) == 0)
-            *authn_types |= svn_ra_serf__authn_basic;
+            *authn_types |= SERF_AUTHN_BASIC;
           else if (svn_cstring_casecmp("digest", token) == 0)
-            *authn_types |= svn_ra_serf__authn_digest;
+            *authn_types |= SERF_AUTHN_DIGEST;
           else if (svn_cstring_casecmp("ntlm", token) == 0)
-            *authn_types |= svn_ra_serf__authn_ntlm;
+            *authn_types |= SERF_AUTHN_NTLM;
           else if (svn_cstring_casecmp("negotiate", token) == 0)
-            *authn_types |= svn_ra_serf__authn_negotiate;
+            *authn_types |= SERF_AUTHN_NEGOTIATE;
           else
             return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
                                      _("Invalid config: unknown http auth"
@@ -125,7 +125,7 @@ load_http_auth_types(apr_pool_t *pool, s
   else
     {
       /* Nothing specified by the user, so accept all types. */
-      *authn_types = svn_ra_serf__authn_all;
+      *authn_types = SERF_AUTHN_ALL;
     }
 
   return SVN_NO_ERROR;
@@ -298,6 +298,12 @@ load_config(svn_ra_serf__session_t *sess
       status = apr_sockaddr_info_get(&proxy_addr, proxy_host,
                                      APR_UNSPEC, proxy_port, 0,
                                      session->pool);
+      if (status)
+        {
+          return svn_error_wrap_apr(status,
+                                    _("Could not resolve proxy server '%s'"),
+                                    proxy_host);
+        }
       session->using_proxy = TRUE;
       serf_config_proxy(session->context, proxy_addr);
     }
@@ -307,12 +313,9 @@ load_config(svn_ra_serf__session_t *sess
   /* Setup authentication. */
   SVN_ERR(load_http_auth_types(pool, config, server_group,
                                &session->authn_types));
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
-  /* TODO: convert string authn types to SERF_AUTHN bitmask.
-     serf_config_authn_types(session->context, session->authn_types);*/
+  serf_config_authn_types(session->context, session->authn_types);
   serf_config_credentials_callback(session->context,
                                    svn_ra_serf__credentials_callback);
-#endif
 
   return SVN_NO_ERROR;
 }
@@ -351,7 +354,6 @@ svn_ra_serf__open(svn_ra_session_t *sess
   serf_sess->pool = svn_pool_create(pool);
   serf_sess->bkt_alloc = serf_bucket_allocator_create(serf_sess->pool, NULL,
                                                       NULL);
-  serf_sess->cached_props = apr_hash_make(serf_sess->pool);
   serf_sess->wc_callbacks = callbacks;
   serf_sess->wc_callback_baton = callback_baton;
   serf_sess->wc_progress_baton = callbacks->progress_baton;
@@ -397,35 +399,9 @@ svn_ra_serf__open(svn_ra_session_t *sess
   serf_sess->conns[0]->session = serf_sess;
   serf_sess->conns[0]->last_status_code = -1;
 
-  /* Unless we're using a proxy, fetch the DNS record for this host */
-  if (! serf_sess->using_proxy)
-    {
-      status = apr_sockaddr_info_get(&serf_sess->conns[0]->address,
-                                     url.hostname,
-                                     APR_UNSPEC, url.port, 0, serf_sess->pool);
-      if (status)
-        {
-          return svn_error_wrap_apr(status,
-                                    _("Could not lookup hostname `%s'"),
-                                    url.hostname);
-        }
-    }
-  else
-    {
-      /* Create an address with unresolved hostname. */
-      apr_sockaddr_t *sa = apr_pcalloc(serf_sess->pool, sizeof(apr_sockaddr_t));
-      sa->pool = serf_sess->pool;
-      sa->hostname = apr_pstrdup(serf_sess->pool, url.hostname);
-      sa->port = url.port;
-      sa->family = APR_UNSPEC;
-      serf_sess->conns[0]->address = sa;
-    }
-
   serf_sess->conns[0]->using_ssl = serf_sess->using_ssl;
   serf_sess->conns[0]->using_compression = serf_sess->using_compression;
   serf_sess->conns[0]->hostinfo = url.hostinfo;
-  serf_sess->conns[0]->auth_header = NULL;
-  serf_sess->conns[0]->auth_value = NULL;
   serf_sess->conns[0]->useragent = NULL;
 
   /* create the user agent string */
@@ -603,8 +579,8 @@ fetch_path_props(svn_ra_serf__propfind_c
     {
       SVN_ERR(svn_ra_serf__deliver_props(&prop_ctx, props, session,
                                          session->conns[0], path, revision,
-                                         "0", desired_props, TRUE, NULL,
-                                         session->pool));
+                                         "0", desired_props, NULL,
+                                         pool));
     }
   else
     {
@@ -623,8 +599,8 @@ fetch_path_props(svn_ra_serf__propfind_c
       revision = SVN_INVALID_REVNUM;
       SVN_ERR(svn_ra_serf__deliver_props(&prop_ctx, props, session,
                                          session->conns[0], path, revision,
-                                         "0", desired_props, TRUE, NULL,
-                                         session->pool));
+                                         "0", desired_props, NULL,
+                                         pool));
     }
 
   if (prop_ctx)
@@ -707,6 +683,15 @@ dirent_walker(void *baton,
     {
       entry->has_props = TRUE;
     }
+  else if (strcmp(ns, SVN_DAV_PROP_NS_DAV) == 0)
+    {
+      if(strcmp(name, "deadprop-count") == 0)
+        {
+          apr_int64_t deadprop_count;
+          SVN_ERR(svn_cstring_atoi64(&deadprop_count, val->data));
+          entry->has_props = deadprop_count > 0;
+        }
+    }
   else if (strcmp(ns, "DAV:") == 0)
     {
       if (strcmp(name, SVN_DAV__VERSION_NAME) == 0)
@@ -723,7 +708,11 @@ dirent_walker(void *baton,
         }
       else if (strcmp(name, "getcontentlength") == 0)
         {
-          SVN_ERR(svn_cstring_atoi64(&entry->size, val->data));
+          /* 'getcontentlength' property is empty for directories. */
+          if (val->len)
+            {
+              SVN_ERR(svn_cstring_atoi64(&entry->size, val->data));
+            }
         }
       else if (strcmp(name, "resourcetype") == 0)
         {
@@ -783,6 +772,62 @@ path_dirent_walker(void *baton,
   return dirent_walker(entry, ns, ns_len, name, name_len, val, pool);
 }
 
+static const svn_ra_serf__dav_props_t *
+get_dirent_props(apr_uint32_t dirent_fields, apr_pool_t *pool)
+{
+  svn_ra_serf__dav_props_t *prop;
+  apr_array_header_t *props = apr_array_make
+    (pool, 7, sizeof(svn_ra_serf__dav_props_t));
+
+  if (dirent_fields & SVN_DIRENT_KIND) 
+    {
+      prop = apr_array_push(props);
+      prop->namespace = "DAV:";
+      prop->name = "resourcetype";
+    }
+
+  if (dirent_fields & SVN_DIRENT_SIZE)
+    {
+      prop = apr_array_push(props);
+      prop->namespace = "DAV:";
+      prop->name = "getcontentlength";
+    }
+  
+  if (dirent_fields & SVN_DIRENT_HAS_PROPS)
+    {
+      prop = apr_array_push(props);
+      prop->namespace = SVN_DAV_PROP_NS_DAV;
+      prop->name = "deadprop-count";
+    }
+
+  if (dirent_fields & SVN_DIRENT_CREATED_REV)
+    {
+      svn_ra_serf__dav_props_t *p = apr_array_push(props);
+      p->namespace = "DAV:";
+      p->name = SVN_DAV__VERSION_NAME;
+    }
+
+  if (dirent_fields & SVN_DIRENT_TIME)
+    {
+      prop = apr_array_push(props);
+      prop->namespace = "DAV:";
+      prop->name = SVN_DAV__CREATIONDATE;
+    }
+
+  if (dirent_fields & SVN_DIRENT_LAST_AUTHOR)
+    {
+      prop = apr_array_push(props);
+      prop->namespace = "DAV:";
+      prop->name = "creator-displayname";
+    }
+
+  prop = apr_array_push(props);
+  prop->namespace = NULL;
+  prop->name = NULL;
+
+  return (svn_ra_serf__dav_props_t *) props->elts;
+}
+
 static svn_error_t *
 svn_ra_serf__stat(svn_ra_session_t *ra_session,
                   const char *rel_path,
@@ -799,7 +844,8 @@ svn_ra_serf__stat(svn_ra_session_t *ra_s
   svn_error_t *err;
 
   err = fetch_path_props(&prop_ctx, &props, &path, &fetched_rev,
-                         session, rel_path, revision, all_props, pool);
+                         session, rel_path, revision,
+                         get_dirent_props(SVN_DIRENT_ALL, pool), pool);
   if (err)
     {
       if (err->apr_err == SVN_ERR_FS_NOT_FOUND)
@@ -895,9 +941,15 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
     {
       struct path_dirent_visitor_t dirent_walk;
 
+      /* Always request node kind to check that path is really a
+       * directory.
+       */
+      dirent_fields |= SVN_DIRENT_KIND;
       SVN_ERR(svn_ra_serf__retrieve_props(props, session, session->conns[0],
-                                          path, revision, "1", all_props,
-                                          session->pool));
+                                          path, revision, "1",
+                                          get_dirent_props(dirent_fields,
+                                                           pool),
+                                          pool));
 
       /* Check if the path is really a directory. */
       SVN_ERR(resource_is_directory (props, path, revision));

Modified: subversion/branches/performance/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_serf/update.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_serf/update.c Sun Feb 20 07:45:48 2011
@@ -1193,7 +1193,7 @@ fetch_file(report_context_t *ctx, report
       SVN_ERR(svn_ra_serf__deliver_props(&info->propfind, info->props,
                                          ctx->sess, conn, info->url,
                                          info->target_rev, "0", all_props,
-                                         FALSE, &ctx->done_propfinds,
+                                         &ctx->done_propfinds,
                                          info->dir->pool));
 
       SVN_ERR_ASSERT(info->propfind);
@@ -1752,7 +1752,7 @@ end_report(svn_ra_serf__xml_parser_t *pa
                                              ctx->sess->conns[ctx->sess->cur_conn],
                                              info->dir->url,
                                              info->dir->target_rev, "0",
-                                             all_props, FALSE,
+                                             all_props,
                                              &ctx->done_propfinds,
                                              info->dir->pool));
 
@@ -2194,12 +2194,9 @@ open_connection_if_needed(svn_ra_serf__s
       sess->conns[cur] = apr_palloc(sess->pool, sizeof(*sess->conns[cur]));
       sess->conns[cur]->bkt_alloc = serf_bucket_allocator_create(sess->pool,
                                                                  NULL, NULL);
-      sess->conns[cur]->address = sess->conns[0]->address;
       sess->conns[cur]->hostinfo = sess->conns[0]->hostinfo;
       sess->conns[cur]->using_ssl = sess->conns[0]->using_ssl;
       sess->conns[cur]->using_compression = sess->conns[0]->using_compression;
-      sess->conns[cur]->proxy_auth_header = sess->conns[0]->proxy_auth_header;
-      sess->conns[cur]->proxy_auth_value = sess->conns[0]->proxy_auth_value;
       sess->conns[cur]->useragent = sess->conns[0]->useragent;
       sess->conns[cur]->last_status_code = -1;
       sess->conns[cur]->ssl_context = NULL;
@@ -2216,15 +2213,6 @@ open_connection_if_needed(svn_ra_serf__s
         return svn_error_wrap_apr(status, NULL);
 
       sess->num_conns++;
-
-      /* Authentication protocol specific initalization. */
-      if (sess->auth_protocol)
-        SVN_ERR(sess->auth_protocol->init_conn_func(sess, sess->conns[cur],
-                                                    sess->pool));
-      if (sess->proxy_auth_protocol)
-        SVN_ERR(sess->proxy_auth_protocol->init_conn_func(sess,
-                                                          sess->conns[cur],
-                                                          sess->pool));
     }
 
   return SVN_NO_ERROR;
@@ -2262,6 +2250,7 @@ finish_report(void *report_baton,
   svn_boolean_t closed_root;
   int status_code, i;
   svn_stringbuf_t *buf = NULL;
+  apr_pool_t *iterpool;
 
   svn_xml_make_close_tag(&buf, pool, "S:update-report");
   SVN_ERR(svn_io_file_write_full(report->body_file, buf->data, buf->len,
@@ -2319,10 +2308,14 @@ finish_report(void *report_baton,
   sess->cur_conn = 1;
   closed_root = FALSE;
 
+  iterpool = svn_pool_create(pool);
   while (!report->done || report->active_fetches || report->active_propfinds)
     {
       svn_error_t *err;
-      status = serf_context_run(sess->context, sess->timeout, pool);
+
+      svn_pool_clear(iterpool);
+
+      status = serf_context_run(sess->context, sess->timeout, iterpool);
 
       err = sess->pending_error;
       sess->pending_error = SVN_NO_ERROR;
@@ -2454,6 +2447,7 @@ finish_report(void *report_baton,
          serf_debug__closed_conn(sess->conns[i]->bkt_alloc);
         }
     }
+  svn_pool_destroy(iterpool);
 
   /* Ensure that we opened and closed our root dir and that we closed
    * all of our children. */
@@ -2721,13 +2715,13 @@ svn_ra_serf__get_file(svn_ra_session_t *
    * Otherwise, we need to get the baseline version for this particular
    * revision and then fetch that file.
    */
-  if (SVN_IS_VALID_REVNUM(revision))
+  if (SVN_IS_VALID_REVNUM(revision) || fetched_rev)
     {
       const char *baseline_url, *rel_path;
 
       SVN_ERR(svn_ra_serf__get_baseline_info(&baseline_url, &rel_path,
                                              session, conn, fetch_url,
-                                             revision, NULL, pool));
+                                             revision, fetched_rev, pool));
       fetch_url = svn_path_url_add_component2(baseline_url, rel_path, pool);
       revision = SVN_INVALID_REVNUM;
     }

Modified: subversion/branches/performance/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_serf/util.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_serf/util.c Sun Feb 20 07:45:48 2011
@@ -326,10 +326,6 @@ conn_setup(apr_socket_t *sock,
   return SVN_NO_ERROR;
 }
 
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
-/* This ugly ifdef construction can be cleaned up as soon as serf >= 0.4
-   gets the minimum supported serf version! */
-
 /* svn_ra_serf__conn_setup is a callback for serf. This function
    creates a read bucket and will wrap the write bucket if SSL
    is needed. */
@@ -340,18 +336,6 @@ svn_ra_serf__conn_setup(apr_socket_t *so
                         void *baton,
                         apr_pool_t *pool)
 {
-#else
-/* This is the old API, for compatibility with serf
-   versions <= 0.3. */
-serf_bucket_t *
-svn_ra_serf__conn_setup(apr_socket_t *sock,
-                        void *baton,
-                        apr_pool_t *pool)
-{
-  serf_bucket_t **write_bkt = NULL;
-  serf_bucket_t *rb = NULL;
-  serf_bucket_t **read_bkt = &rb;
-#endif
   svn_ra_serf__connection_t *conn = baton;
   svn_ra_serf__session_t *session = conn->session;
   apr_status_t status = SVN_NO_ERROR;
@@ -371,12 +355,7 @@ svn_ra_serf__conn_setup(apr_socket_t *so
       status = session->pending_error->apr_err;
     }
 
-#if ! SERF_VERSION_AT_LEAST(0, 4, 0)
-  SVN_ERR_ASSERT_NO_RETURN(rb != NULL);
-  return rb;
-#else
   return status;
-#endif
 }
 
 serf_bucket_t*
@@ -425,12 +404,6 @@ connection_closed(serf_connection_t *con
   if (sc->using_ssl)
       sc->ssl_context = NULL;
 
-  /* Restart the authentication phase on this new connection. */
-  if (sc->session->auth_protocol)
-    SVN_ERR(sc->session->auth_protocol->init_conn_func(sc->session,
-                                                       sc,
-                                                       sc->session->pool));
-
   return SVN_NO_ERROR;
 }
 
@@ -619,38 +592,6 @@ svn_ra_serf__setup_serf_req(serf_request
   serf_bucket_headers_set(hdrs_bkt, "DAV", SVN_DAV_NS_DAV_SVN_MERGEINFO);
   serf_bucket_headers_set(hdrs_bkt, "DAV", SVN_DAV_NS_DAV_SVN_LOG_REVPROPS);
 
-  /* Setup server authorization headers */
-  if (conn->session->auth_protocol)
-    SVN_ERR(conn->session->auth_protocol->setup_request_func(conn, method, url,
-                                                             hdrs_bkt));
-
-  /* Setup proxy authorization headers */
-  if (conn->session->proxy_auth_protocol)
-    SVN_ERR(conn->session->proxy_auth_protocol->setup_request_func(conn,
-                                                                   method,
-                                                                   url,
-                                                                   hdrs_bkt));
-
-#if ! SERF_VERSION_AT_LEAST(0, 4, 0)
-  /* Set up SSL if we need to */
-  if (conn->using_ssl)
-    {
-      *req_bkt = serf_bucket_ssl_encrypt_create(*req_bkt, conn->ssl_context,
-                                            serf_request_get_alloc(request));
-      if (!conn->ssl_context)
-        {
-          conn->ssl_context = serf_bucket_ssl_encrypt_context_get(*req_bkt);
-
-          serf_ssl_client_cert_provider_set(conn->ssl_context,
-                                            svn_ra_serf__handle_client_cert,
-                                            conn, conn->session->pool);
-          serf_ssl_client_cert_password_set(conn->ssl_context,
-                                            svn_ra_serf__handle_client_cert_pw,
-                                            conn, conn->session->pool);
-        }
-    }
-#endif
-
   if (ret_hdrs_bkt)
     {
       *ret_hdrs_bkt = hdrs_bkt;
@@ -665,19 +606,23 @@ svn_ra_serf__context_run_wait(svn_boolea
                               apr_pool_t *pool)
 {
   apr_status_t status;
+  apr_pool_t *iterpool;
 
   assert(sess->pending_error == SVN_NO_ERROR);
 
+  iterpool = svn_pool_create(pool);
   while (!*done)
     {
       svn_error_t *err;
       int i;
 
+      svn_pool_clear(iterpool);
+
       if (sess->wc_callbacks &&
           sess->wc_callbacks->cancel_func)
         SVN_ERR((sess->wc_callbacks->cancel_func)(sess->wc_callback_baton));
 
-      status = serf_context_run(sess->context, sess->timeout, pool);
+      status = serf_context_run(sess->context, sess->timeout, iterpool);
 
       err = sess->pending_error;
       sess->pending_error = SVN_NO_ERROR;
@@ -709,6 +654,7 @@ svn_ra_serf__context_run_wait(svn_boolea
          serf_debug__closed_conn(sess->conns[i]->bkt_alloc);
         }
     }
+  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }
@@ -1508,34 +1454,11 @@ handle_response(serf_request_t *request,
                                         ctx->session->pool));
       ctx->session->auth_attempts = 0;
       ctx->session->auth_state = NULL;
-      ctx->session->realm = NULL;
     }
 
   ctx->conn->last_status_code = sl.code;
 
-  if (sl.code == 401 || sl.code == 407)
-    {
-      /* 401 Authorization or 407 Proxy-Authentication required */
-      status = svn_ra_serf__response_discard_handler(request, response, NULL, pool);
-
-      /* Don't bother handling the authentication request if the response
-         wasn't received completely yet. Serf will call handle_response
-         again when more data is received. */
-      if (APR_STATUS_IS_EAGAIN(status))
-        {
-          *serf_status = status;
-          return SVN_NO_ERROR;
-        }
-
-      SVN_ERR(svn_ra_serf__handle_auth(sl.code, ctx,
-                                       request, response, pool));
-
-      svn_ra_serf__priority_request_create(ctx);
-
-      *serf_status = status;
-      return SVN_NO_ERROR;
-    }
-  else if (sl.code == 409 || sl.code >= 500)
+  if (sl.code == 409 || sl.code >= 500)
     {
       /* 409 Conflict: can indicate a hook error.
          5xx (Internal) Server error. */
@@ -1554,28 +1477,6 @@ handle_response(serf_request_t *request,
     {
       svn_error_t *err;
 
-      /* Validate this response message. */
-      if (ctx->session->auth_protocol ||
-          ctx->session->proxy_auth_protocol)
-        {
-          const svn_ra_serf__auth_protocol_t *prot;
-
-          if (ctx->session->auth_protocol)
-            prot = ctx->session->auth_protocol;
-          else
-            prot = ctx->session->proxy_auth_protocol;
-
-          err = prot->validate_response_func(ctx, request, response, pool);
-          if (err)
-            {
-              svn_ra_serf__response_discard_handler(request, response, NULL,
-                                                    pool);
-              /* Ignore serf status code, just return the real error */
-
-              return svn_error_return(err);
-            }
-        }
-
       err = ctx->response_handler(request,response, ctx->response_baton, pool);
 
       if (err
@@ -1732,13 +1633,6 @@ svn_ra_serf__request_create(svn_ra_serf_
                                         setup_request_cb, handler);
 }
 
-serf_request_t *
-svn_ra_serf__priority_request_create(svn_ra_serf__handler_t *handler)
-{
-  return serf_connection_priority_request_create(handler->conn->conn,
-                                                 setup_request_cb, handler);
-}
-
 svn_error_t *
 svn_ra_serf__discover_vcc(const char **vcc_url,
                           svn_ra_serf__session_t *session,
@@ -1805,12 +1699,10 @@ svn_ra_serf__discover_vcc(const char **v
               /* Okay, strip off a component from PATH. */
               path = svn_urlpath__dirname(path, pool);
 
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
               /* An error occurred on conns. serf 0.4.0 remembers that
                  the connection had a problem. We need to reset it, in
                  order to use it again.  */
               serf_connection_reset(conn->conn);
-#endif
             }
         }
     }

Modified: subversion/branches/performance/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_ra_svn/marshal.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/performance/subversion/libsvn_ra_svn/marshal.c Sun Feb 20 07:45:48 2011
@@ -99,7 +99,7 @@ svn_ra_svn_conn_t *svn_ra_svn_create_con
                                           apr_pool_t *pool)
 {
   return svn_ra_svn_create_conn2(sock, in_file, out_file, 
-                                 SVNDIFF1_COMPRESS_LEVEL, pool);
+                                 SVN_DEFAULT_COMPRESSION_LEVEL, pool);
 }
 
 svn_error_t *svn_ra_svn_set_capabilities(svn_ra_svn_conn_t *conn,

Modified: subversion/branches/performance/subversion/libsvn_repos/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_repos/authz.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/performance/subversion/libsvn_repos/authz.c Sun Feb 20 07:45:48 2011
@@ -746,7 +746,7 @@ svn_repos_authz_read(svn_authz_t **authz
   baton.err = SVN_NO_ERROR;
 
   /* Load the rule file. */
-  SVN_ERR(svn_config_read(&authz->cfg, file, must_exist, pool));
+  SVN_ERR(svn_config_read2(&authz->cfg, file, must_exist, TRUE, pool));
   baton.config = authz->cfg;
 
   /* Step through the entire rule file, stopping on error. */

Modified: subversion/branches/performance/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_repos/commit.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/performance/subversion/libsvn_repos/commit.c Sun Feb 20 07:45:48 2011
@@ -568,16 +568,9 @@ close_file(void *file_baton,
                                      text_digest, pool));
 
       if (!svn_checksum_match(text_checksum, checksum))
-        {
-          return svn_error_createf
-            (SVN_ERR_CHECKSUM_MISMATCH, NULL,
-             apr_psprintf(pool, "%s:\n%s\n%s\n",
-                          _("Checksum mismatch for resulting fulltext\n(%s)"),
-                          _("   expected:  %s"),
-                          _("     actual:  %s")),
-             fb->path, svn_checksum_to_cstring_display(text_checksum, pool),
-             svn_checksum_to_cstring_display(checksum, pool));
-        }
+        return svn_checksum_mismatch_err(text_checksum, checksum, pool,
+                            _("Checksum mismatch for resulting fulltext\n(%s)"),
+                            fb->path);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/performance/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_repos/load-fs-vtable.c?rev=1072522&r1=1072521&r2=1072522&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/performance/subversion/libsvn_repos/load-fs-vtable.c Sun Feb 20 07:45:48 2011
@@ -516,18 +516,11 @@ maybe_add_with_history(struct node_baton
           SVN_ERR(svn_fs_file_checksum(&checksum, svn_checksum_md5, copy_root,
                                        nb->copyfrom_path, TRUE, pool));
           if (!svn_checksum_match(nb->copy_source_checksum, checksum))
-            return svn_error_createf
-              (SVN_ERR_CHECKSUM_MISMATCH,
-               NULL,
-               apr_psprintf(pool, "%s:\n%s\n%s\n",
-                            _("Copy source checksum mismatch on copy from '%s'@%ld\n"
-                              "to '%s' in rev based on r%ld"),
-                            _("   expected:  %s"),
-                            _("     actual:  %s")),
-               nb->copyfrom_path, src_rev,
-               nb->path, rb->rev,
-               svn_checksum_to_cstring_display(nb->copy_source_checksum, pool),
-               svn_checksum_to_cstring_display(checksum, pool));
+            return svn_checksum_mismatch_err(nb->copy_source_checksum,
+                      checksum, pool,
+                      _("Copy source checksum mismatch on copy from '%s'@%ld\n"
+                        "to '%s' in rev based on r%ld"),
+                      nb->copyfrom_path, src_rev, nb->path, rb->rev);
         }
 
       SVN_ERR(svn_fs_copy(copy_root, nb->copyfrom_path,