You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pr...@apache.org on 2013/06/05 11:22:51 UTC
svn commit: r1489765 [8/22] - in /subversion/branches/verify-keep-going: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/hook-scripts/ contrib/server-side/fsfsfixer/
contrib/server-side/fsfsfixer/fixer/ notes/ subversion/...
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c Wed Jun 5 09:22:43 2013
@@ -186,7 +186,7 @@ typedef struct cache_lock_t
{
/* pool holding the lock */
apr_pool_t *pool;
-
+
/* cache being locked */
fs_fs_dag_cache_t *cache;
@@ -201,7 +201,7 @@ typedef struct cache_lock_t
When the number of INSERTIONS (i.e. objects created form that pool)
exceeds a certain threshold, the pool will be cleared and the cache
with it.
-
+
To ensure that nodes returned from this structure remain valid, the
cache will get locked for the lifetime of the _receiving_ pools (i.e.
those in which we would allocate the node if there was no cache.).
@@ -272,7 +272,7 @@ svn_fs_fs__create_dag_cache(apr_pool_t *
result,
unregister_locks,
apr_pool_cleanup_null);
-
+
return result;
}
@@ -355,7 +355,7 @@ cache_lookup( fs_fs_dag_cache_t *cache
(HASH_VALUE has been initialized to REVISION). */
for (i = 0; i + 4 <= path_len; i += 4)
hash_value = hash_value * 0xd1f3da69 + *(const apr_uint32_t*)(path + i);
-
+
for (; i < path_len; ++i)
hash_value = hash_value * 33 + path[i];
@@ -416,7 +416,7 @@ locate_cache(svn_cache__t **cache,
/* Return NODE for PATH from ROOT's node cache, or NULL if the node
isn't cached; read it from the FS. *NODE remains valid until either
- POOL or the FS gets cleared or destroyed (whichever comes first).
+ POOL or the FS gets cleared or destroyed (whichever comes first).
Since locking can be expensive and POOL may be long-living, for
nodes that will not need to survive the next call to this function,
@@ -438,7 +438,7 @@ dag_node_cache_get(dag_node_t **node_p,
if (!root->is_txn_root)
{
/* immutable DAG node. use the global caches for it */
-
+
fs_fs_data_t *ffd = root->fs->fsap_data;
cache_entry_t *bucket;
@@ -470,7 +470,7 @@ dag_node_cache_get(dag_node_t **node_p,
else
{
/* DAG is mutable / may become invalid. Use the TXN-local cache */
-
+
locate_cache(&cache, &key, root, path, pool);
SVN_ERR(svn_cache__get((void **) &node, &found, cache, key, pool));
@@ -904,38 +904,46 @@ open_path(parent_path_t **parent_path_p,
dag_node_t *here = NULL; /* The directory we're currently looking at. */
parent_path_t *parent_path; /* The path from HERE up to the root. */
const char *rest; /* The portion of PATH we haven't traversed yet. */
-
- /* ensure a canonical path representation */
- const char *path_so_far = "/";
apr_pool_t *iterpool = svn_pool_create(pool);
+ /* path to the currently processed entry without trailing '/'.
+ We will reuse this across iterations by simply putting a NUL terminator
+ at the respective position and replacing that with a '/' in the next
+ iteration. This is correct as we assert() PATH to be canonical. */
+ svn_stringbuf_t *path_so_far = svn_stringbuf_create(path, pool);
+
/* callers often traverse the tree in some path-based order. That means
a sibling of PATH has been presently accessed. Try to start the lookup
directly at the parent node, if the caller did not requested the full
parent chain. */
- const char *directory;
assert(svn_fs__is_canonical_abspath(path));
+ path_so_far->len = 0; /* "" */
if (flags & open_path_node_only)
{
- directory = svn_dirent_dirname(path, pool);
+ const char *directory = svn_dirent_dirname(path, pool);
if (directory[1] != 0) /* root nodes are covered anyway */
- SVN_ERR(dag_node_cache_get(&here, root, directory, TRUE, pool));
+ {
+ SVN_ERR(dag_node_cache_get(&here, root, directory, TRUE, pool));
+ /* did the shortcut work? */
+ if (here)
+ {
+ apr_size_t dirname_len = strlen(directory);
+ path_so_far->len = dirname_len;
+ rest = path + dirname_len + 1;
+ }
+ }
}
/* did the shortcut work? */
- if (here)
- {
- path_so_far = directory;
- rest = path + strlen(directory) + 1;
- }
- else
+ if (!here)
{
/* Make a parent_path item for the root node, using its own current
copy id. */
SVN_ERR(root_node(&here, root, pool));
rest = path + 1; /* skip the leading '/', it saves in iteration */
}
-
+
+ path_so_far->data[path_so_far->len] = '\0';
parent_path = make_parent_path(here, 0, 0, pool);
parent_path->copy_inherit = copy_id_inherit_self;
@@ -955,8 +963,10 @@ open_path(parent_path_t **parent_path_p,
/* Parse out the next entry from the path. */
entry = svn_fs__next_entry_name(&next, rest, pool);
- /* Calculate the path traversed thus far. */
- path_so_far = svn_fspath__join(path_so_far, entry, pool);
+ /* Update the path traversed thus far. */
+ path_so_far->data[path_so_far->len] = '/';
+ path_so_far->len += strlen(entry) + 1;
+ path_so_far->data[path_so_far->len] = '\0';
if (*entry == '\0')
{
@@ -979,7 +989,7 @@ open_path(parent_path_t **parent_path_p,
element if we already know the lookup to fail for the
complete path. */
if (next || !(flags & open_path_uncached))
- SVN_ERR(dag_node_cache_get(&cached_node, root, path_so_far,
+ SVN_ERR(dag_node_cache_get(&cached_node, root, path_so_far->data,
TRUE, pool));
if (cached_node)
child = cached_node;
@@ -1033,7 +1043,8 @@ open_path(parent_path_t **parent_path_p,
/* Cache the node we found (if it wasn't already cached). */
if (! cached_node)
- SVN_ERR(dag_node_cache_set(root, path_so_far, child, iterpool));
+ SVN_ERR(dag_node_cache_set(root, path_so_far->data, child,
+ iterpool));
}
/* Are we finished traversing the path? */
@@ -1042,7 +1053,7 @@ open_path(parent_path_t **parent_path_p,
/* The path isn't finished yet; we'd better be in a directory. */
if (svn_fs_fs__dag_node_kind(child) != svn_node_dir)
- SVN_ERR_W(SVN_FS__ERR_NOT_DIRECTORY(fs, path_so_far),
+ SVN_ERR_W(SVN_FS__ERR_NOT_DIRECTORY(fs, path_so_far->data),
apr_psprintf(iterpool, _("Failure opening '%s'"), path));
rest = next;
@@ -2178,53 +2189,6 @@ fs_dir_entries(apr_hash_t **table_p,
return svn_fs_fs__dag_dir_entries(table_p, node, pool);
}
-/* Return a copy of PATH, allocated from POOL, for which newlines
- have been escaped using the form \NNN (where NNN is the
- octal representation of the byte's ordinal value). */
-static const char *
-escape_newline(const char *path, apr_pool_t *pool)
-{
- svn_stringbuf_t *retstr;
- apr_size_t i, copied = 0;
- int c;
-
- /* At least one control character:
- strlen - 1 (control) + \ + N + N + N + null . */
- retstr = svn_stringbuf_create_ensure(strlen(path) + 4, pool);
- for (i = 0; path[i]; i++)
- {
- c = (unsigned char)path[i];
- if (c != '\n')
- continue;
-
- /* First things first, copy all the good stuff that we haven't
- yet copied into our output buffer. */
- if (i - copied)
- svn_stringbuf_appendbytes(retstr, path + copied,
- i - copied);
-
- /* Make sure buffer is big enough for '\' 'N' 'N' 'N' (and NUL) */
- svn_stringbuf_ensure(retstr, retstr->len + 4);
- /*### The backslash separator doesn't work too great with Windows,
- but it's what we'll use for consistency with invalid utf8
- formatting (until someone has a better idea) */
- apr_snprintf(retstr->data + retstr->len, 5, "\\%03o", (unsigned char)c);
- retstr->len += 4;
-
- /* Finally, update our copy counter. */
- copied = i + 1;
- }
-
- /* Anything left to copy? */
- if (i - copied)
- svn_stringbuf_appendbytes(retstr, path + copied, i - copied);
-
- /* retstr is null-terminated either by apr_snprintf or the svn_stringbuf
- functions. */
-
- return retstr->data;
-}
-
/* Raise an error if PATH contains a newline because FSFS cannot handle
* such paths. See issue #4340. */
static svn_error_t *
@@ -2235,7 +2199,7 @@ check_newline(const char *path, apr_pool
if (c)
return svn_error_createf(SVN_ERR_FS_PATH_SYNTAX, NULL,
_("Invalid control character '0x%02x' in path '%s'"),
- (unsigned char)*c, escape_newline(path, pool));
+ (unsigned char)*c, svn_path_illegal_path_escape(path, pool));
return SVN_NO_ERROR;
}
@@ -3498,26 +3462,17 @@ fs_node_origin_rev(svn_revnum_t *revisio
}
-struct history_prev_args
-{
- svn_fs_history_t **prev_history_p;
- svn_fs_history_t *history;
- svn_boolean_t cross_copies;
- apr_pool_t *pool;
-};
-
-
static svn_error_t *
-history_prev(void *baton, apr_pool_t *pool)
+history_prev(svn_fs_history_t **prev_history,
+ svn_fs_history_t *history,
+ svn_boolean_t cross_copies,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- struct history_prev_args *args = baton;
- svn_fs_history_t **prev_history = args->prev_history_p;
- svn_fs_history_t *history = args->history;
fs_history_data_t *fhd = history->fsap_data;
const char *commit_path, *src_path, *path = fhd->path;
svn_revnum_t commit_rev, src_rev, dst_rev;
svn_revnum_t revision = fhd->revision;
- apr_pool_t *retpool = args->pool;
svn_fs_t *fs = fhd->fs;
parent_path_t *parent_path;
dag_node_t *node;
@@ -3536,21 +3491,21 @@ history_prev(void *baton, apr_pool_t *po
if (fhd->path_hint && SVN_IS_VALID_REVNUM(fhd->rev_hint))
{
reported = FALSE;
- if (! args->cross_copies)
+ if (! cross_copies)
return SVN_NO_ERROR;
path = fhd->path_hint;
revision = fhd->rev_hint;
}
/* Construct a ROOT for the current revision. */
- SVN_ERR(svn_fs_fs__revision_root(&root, fs, revision, pool));
+ SVN_ERR(svn_fs_fs__revision_root(&root, fs, revision, scratch_pool));
/* Open PATH/REVISION, and get its node and a bunch of other
goodies. */
- SVN_ERR(open_path(&parent_path, root, path, 0, NULL, pool));
+ SVN_ERR(open_path(&parent_path, root, path, 0, NULL, scratch_pool));
node = parent_path->node;
commit_path = svn_fs_fs__dag_get_created_path(node);
- SVN_ERR(svn_fs_fs__dag_get_revision(&commit_rev, node, pool));
+ SVN_ERR(svn_fs_fs__dag_get_revision(&commit_rev, node, scratch_pool));
/* The Subversion filesystem is written in such a way that a given
line of history may have at most one interesting history point
@@ -3566,9 +3521,9 @@ history_prev(void *baton, apr_pool_t *po
/* ... we either have not yet reported on this revision (and
need now to do so) ... */
*prev_history = assemble_history(fs,
- apr_pstrdup(retpool, commit_path),
+ apr_pstrdup(result_pool, commit_path),
commit_rev, TRUE, NULL,
- SVN_INVALID_REVNUM, retpool);
+ SVN_INVALID_REVNUM, result_pool);
return SVN_NO_ERROR;
}
else
@@ -3584,16 +3539,16 @@ history_prev(void *baton, apr_pool_t *po
/* Replace NODE and friends with the information from its
predecessor. */
- SVN_ERR(svn_fs_fs__dag_get_node(&node, fs, pred_id, pool));
+ SVN_ERR(svn_fs_fs__dag_get_node(&node, fs, pred_id, scratch_pool));
commit_path = svn_fs_fs__dag_get_created_path(node);
- SVN_ERR(svn_fs_fs__dag_get_revision(&commit_rev, node, pool));
+ SVN_ERR(svn_fs_fs__dag_get_revision(&commit_rev, node, scratch_pool));
}
}
/* Find the youngest copyroot in the path of this node, including
itself. */
SVN_ERR(find_youngest_copyroot(©root_rev, ©root_path, fs,
- parent_path, pool));
+ parent_path, scratch_pool));
/* Initialize some state variables. */
src_path = NULL;
@@ -3607,8 +3562,8 @@ history_prev(void *baton, apr_pool_t *po
svn_fs_root_t *copyroot_root;
SVN_ERR(svn_fs_fs__revision_root(©root_root, fs, copyroot_rev,
- pool));
- SVN_ERR(get_dag(&node, copyroot_root, copyroot_path, FALSE, pool));
+ scratch_pool));
+ SVN_ERR(get_dag(&node, copyroot_root, copyroot_path, FALSE, scratch_pool));
copy_dst = svn_fs_fs__dag_get_created_path(node);
/* If our current path was the very destination of the copy,
@@ -3630,7 +3585,7 @@ history_prev(void *baton, apr_pool_t *po
SVN_ERR(svn_fs_fs__dag_get_copyfrom_path(©_src, node));
dst_rev = copyroot_rev;
- src_path = svn_fspath__join(copy_src, remainder_path, pool);
+ src_path = svn_fspath__join(copy_src, remainder_path, scratch_pool);
}
}
@@ -3647,15 +3602,15 @@ history_prev(void *baton, apr_pool_t *po
if ((dst_rev == revision) && reported)
retry = TRUE;
- *prev_history = assemble_history(fs, apr_pstrdup(retpool, path),
+ *prev_history = assemble_history(fs, apr_pstrdup(result_pool, path),
dst_rev, ! retry,
- src_path, src_rev, retpool);
+ src_path, src_rev, result_pool);
}
else
{
- *prev_history = assemble_history(fs, apr_pstrdup(retpool, commit_path),
+ *prev_history = assemble_history(fs, apr_pstrdup(result_pool, commit_path),
commit_rev, TRUE, NULL,
- SVN_INVALID_REVNUM, retpool);
+ SVN_INVALID_REVNUM, result_pool);
}
return SVN_NO_ERROR;
@@ -3691,16 +3646,12 @@ fs_history_prev(svn_fs_history_t **prev_
}
else
{
- struct history_prev_args args;
prev_history = history;
while (1)
{
- args.prev_history_p = &prev_history;
- args.history = prev_history;
- args.cross_copies = cross_copies;
- args.pool = pool;
- SVN_ERR(history_prev(&args, pool));
+ SVN_ERR(history_prev(&prev_history, prev_history, cross_copies,
+ pool, pool));
if (! prev_history)
break;
@@ -3877,7 +3828,7 @@ mergeinfo_cache_key(const char *path,
number = number * 4
+ (inherit == svn_mergeinfo_nearest_ancestor ? 2 : 0)
+ (adjust_inherited_mergeinfo ? 1 : 0);
-
+
return svn_fs_fs__combine_number_and_string(number, path, pool);
}
@@ -4016,7 +3967,7 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
ffd->mergeinfo_cache,
cache_key, result_pool));
}
-
+
if (! found)
{
SVN_ERR(get_mergeinfo_for_path_internal(mergeinfo, rev_root, path,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra/editor.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra/editor.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra/editor.c Wed Jun 5 09:22:43 2013
@@ -107,7 +107,7 @@ fetch_base(const char **filename,
*filename = apr_pstrdup(result_pool, tmp_filename);
-
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_plugin.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_plugin.c Wed Jun 5 09:22:43 2013
@@ -535,7 +535,8 @@ ignore_warnings(void *baton,
svn_error_t *err)
{
#ifdef SVN_DEBUG
- SVN_DBG(("Ignoring FS warning %d\n", err ? err->apr_err : 0));
+ SVN_DBG(("Ignoring FS warning %s\n",
+ svn_error_symbolic_name(err ? err->apr_err : 0)));
#endif
return;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_local/split_url.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_local/split_url.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_local/split_url.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_local/split_url.c Wed Jun 5 09:22:43 2013
@@ -23,6 +23,7 @@
#include "ra_local.h"
#include <string.h>
+#include "svn_path.h"
#include "svn_dirent_uri.h"
#include "svn_private_config.h"
@@ -37,6 +38,7 @@ svn_ra_local__split_URL(svn_repos_t **re
svn_error_t *err = SVN_NO_ERROR;
const char *repos_dirent;
const char *repos_root_dirent;
+ svn_stringbuf_t *urlbuf;
SVN_ERR(svn_uri_get_dirent_from_file_url(&repos_dirent, URL, pool));
@@ -62,15 +64,31 @@ svn_ra_local__split_URL(svn_repos_t **re
/* = apr_pstrcat(pool,
"/",
svn_dirent_skip_ancestor(repos_root_dirent, repos_dirent),
- (const char *)NULL */
+ (const char *)NULL); */
*fs_path = &repos_dirent[strlen(repos_root_dirent)];
if (**fs_path == '\0')
*fs_path = "/";
- /* Create a url to the repository root. */
- SVN_ERR(svn_uri_get_file_url_from_dirent(repos_root_url, repos_root_dirent,
- pool));
+ /* Remove the path components after the root dirent from the original URL,
+ to get a URL to the repository root.
+
+ We don't use svn_uri_get_file_url_from_dirent() here as that would
+ transform several uris to form a differently formed url than
+ svn_uri_canonicalize would.
+
+ E.g. file://localhost/C:/dir -> file:///C:/dir
+ (a transform that was originally supported directly by this function,
+ before the implementation moved)
+
+ On on Windows:
+ file:///dir -> file:///E:/dir (When E: is the current disk)
+ */
+ urlbuf = svn_stringbuf_create(URL, pool);
+ svn_path_remove_components(urlbuf,
+ svn_path_component_count(repos_dirent)
+ - svn_path_component_count(repos_root_dirent));
+ *repos_root_url = urlbuf->data;
/* Configure hook script environment variables. */
SVN_ERR(svn_repos_hooks_setenv(*repos, NULL, pool));
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/commit.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/commit.c Wed Jun 5 09:22:43 2013
@@ -804,12 +804,22 @@ maybe_set_lock_token_header(serf_bucket_
if (token)
{
const char *token_header;
+ const char *token_uri;
+ apr_uri_t uri = commit_ctx->session->session_url;
- token_header = apr_pstrcat(pool, "(<", token, ">)", (char *)NULL);
+ /* Supplying the optional URI affects apache response when
+ the lock is broken, see issue 4369. When present any URI
+ must be absolute (RFC 2518 9.4). */
+ uri.path = (char *)svn_path_url_add_component2(uri.path, relpath,
+ pool);
+ token_uri = apr_uri_unparse(pool, &uri, 0);
+
+ token_header = apr_pstrcat(pool, "<", token_uri, "> (<", token, ">)",
+ (char *)NULL);
serf_bucket_headers_set(headers, "If", token_header);
}
}
-
+
return SVN_NO_ERROR;
}
@@ -984,12 +994,12 @@ create_put_body(serf_bucket_t **body_bkt
* check the buffer status; but serf will fall through and create a file
* bucket for us on the buffered svndiff handle.
*/
- apr_file_flush(ctx->svndiff);
+ SVN_ERR(svn_io_file_flush(ctx->svndiff, pool));
#if APR_VERSION_AT_LEAST(1, 3, 0)
apr_file_buffer_set(ctx->svndiff, NULL, 0);
#endif
offset = 0;
- apr_file_seek(ctx->svndiff, APR_SET, &offset);
+ SVN_ERR(svn_io_file_seek(ctx->svndiff, APR_SET, &offset, pool));
*body_bkt = serf_bucket_file_create(ctx->svndiff, alloc);
return SVN_NO_ERROR;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/ra_serf.h?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/ra_serf.h Wed Jun 5 09:22:43 2013
@@ -243,7 +243,7 @@ struct svn_ra_serf__session_t {
svn_tristate_t bulk_updates;
/* Indicates if the server wants bulk update requests (Prefer) or only
- accepts skelta requests (Off). If this value is On both options are
+ accepts skelta requests (Off). If this value is On both options are
allowed. */
const char *server_allows_bulk;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/serf.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/serf.c Wed Jun 5 09:22:43 2013
@@ -119,8 +119,9 @@ load_http_auth_types(apr_pool_t *pool, s
*authn_types |= SERF_AUTHN_NEGOTIATE;
else
return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
- _("Invalid config: unknown http auth"
- "type '%s'"), token);
+ _("Invalid config: unknown %s "
+ "'%s'"),
+ SVN_CONFIG_OPTION_HTTP_AUTH_TYPES, token);
}
}
else
@@ -219,10 +220,10 @@ load_config(svn_ra_serf__session_t *sess
svn_tristate_unknown));
/* Load the maximum number of parallel session connections. */
- svn_config_get_int64(config, &session->max_connections,
- SVN_CONFIG_SECTION_GLOBAL,
- SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS,
- SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS);
+ SVN_ERR(svn_config_get_int64(config, &session->max_connections,
+ SVN_CONFIG_SECTION_GLOBAL,
+ SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS,
+ SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS));
if (config)
server_group = svn_config_find_group(config,
@@ -276,9 +277,10 @@ load_config(svn_ra_serf__session_t *sess
/* Load the maximum number of parallel session connections,
overriding global values. */
- svn_config_get_int64(config, &session->max_connections,
- server_group, SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS,
- session->max_connections);
+ SVN_ERR(svn_config_get_int64(config, &session->max_connections,
+ server_group,
+ SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS,
+ session->max_connections));
}
/* Don't allow the http-max-connections value to be larger than our
@@ -450,7 +452,7 @@ svn_ra_serf__open(svn_ra_session_t *sess
/* create the user agent string */
if (callbacks->get_client_string)
- callbacks->get_client_string(callback_baton, &client_string, pool);
+ SVN_ERR(callbacks->get_client_string(callback_baton, &client_string, pool));
if (client_string)
serf_sess->useragent = apr_pstrcat(pool, USER_AGENT, " ",
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/update.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/update.c Wed Jun 5 09:22:43 2013
@@ -94,8 +94,8 @@ typedef enum report_state_e {
We measure outstanding requests as the sum of NUM_ACTIVE_FETCHES and
NUM_ACTIVE_PROPFINDS in the report_context_t structure. */
-#define REQUEST_COUNT_TO_PAUSE 1000
-#define REQUEST_COUNT_TO_RESUME 100
+#define REQUEST_COUNT_TO_PAUSE 50
+#define REQUEST_COUNT_TO_RESUME 40
/* Forward-declare our report context. */
@@ -517,7 +517,7 @@ get_best_connection(report_context_t *ct
### editor implementations (such as svnrdump's dump editor)
### simply can't handle the way ra_serf violates the editor v1
### drive ordering requirements.
- ###
+ ###
### See http://subversion.tigris.org/issues/show_bug.cgi?id=4116.
*/
if (ctx->report_received && (ctx->sess->max_connections > 2))
@@ -1024,26 +1024,6 @@ open_updated_file(report_info_t *info,
if (info->lock_token)
check_lock(info);
- /* Set all of the properties we received */
- SVN_ERR(svn_ra_serf__walk_all_props(info->props,
- info->base_name,
- info->base_rev,
- set_file_props, info,
- scratch_pool));
- SVN_ERR(svn_ra_serf__walk_all_props(info->dir->removed_props,
- info->base_name,
- info->base_rev,
- remove_file_props, info,
- scratch_pool));
- if (info->fetch_props)
- {
- SVN_ERR(svn_ra_serf__walk_all_props(info->props,
- info->url,
- ctx->target_rev,
- set_file_props, info,
- scratch_pool));
- }
-
/* Get (maybe) a textdelta window handler for transmitting file
content changes. */
if (info->fetch_file || force_apply_textdelta)
@@ -1064,6 +1044,28 @@ static svn_error_t *
close_updated_file(report_info_t *info,
apr_pool_t *scratch_pool)
{
+ report_context_t *ctx = info->dir->report_context;
+
+ /* Set all of the properties we received */
+ SVN_ERR(svn_ra_serf__walk_all_props(info->props,
+ info->base_name,
+ info->base_rev,
+ set_file_props, info,
+ scratch_pool));
+ SVN_ERR(svn_ra_serf__walk_all_props(info->dir->removed_props,
+ info->base_name,
+ info->base_rev,
+ remove_file_props, info,
+ scratch_pool));
+ if (info->fetch_props)
+ {
+ SVN_ERR(svn_ra_serf__walk_all_props(info->props,
+ info->url,
+ ctx->target_rev,
+ set_file_props, info,
+ scratch_pool));
+ }
+
/* Close the file via the editor. */
SVN_ERR(info->dir->report_context->update_editor->close_file(
info->file_baton, info->final_checksum, scratch_pool));
@@ -1359,7 +1361,7 @@ maybe_close_dir_chain(report_dir_t *dir)
report_dir_t *cur_dir = dir;
SVN_ERR(ensure_dir_opened(cur_dir));
-
+
while (cur_dir
&& !cur_dir->ref_count
&& cur_dir->tag_closed
@@ -1412,7 +1414,7 @@ handle_propchange_only(report_info_t *in
{
SVN_ERR(open_updated_file(info, FALSE, scratch_pool));
SVN_ERR(close_updated_file(info, scratch_pool));
-
+
/* We're done with our pool. */
svn_pool_destroy(info->pool);
@@ -1503,7 +1505,7 @@ fetch_file(report_context_t *ctx, report
{
svn_error_t *err = NULL;
svn_checksum_t *checksum = NULL;
-
+
/* Parse the optional SHA1 checksum (1.7+) */
err = svn_checksum_parse_hex(&checksum, svn_checksum_sha1,
info->final_sha1_checksum,
@@ -1535,7 +1537,7 @@ fetch_file(report_context_t *ctx, report
{
/* If we'll be doing a PROPFIND for this file... */
if (info->propfind_handler)
- {
+ {
/* ... then we'll just leave ourselves a little "todo"
about that fact (and we'll deal with the file content
stuff later, after we've handled that PROPFIND
@@ -2197,7 +2199,7 @@ end_report(svn_ra_serf__xml_parser_t *pa
if (info->dir->fetch_props)
{
svn_ra_serf__list_t *list_item;
-
+
SVN_ERR(svn_ra_serf__deliver_props(&info->dir->propfind_handler,
info->dir->props, ctx->sess,
get_best_connection(ctx),
@@ -2719,7 +2721,7 @@ create_update_report_body(serf_bucket_t
apr_off_t offset;
offset = 0;
- apr_file_seek(report->body_file, APR_SET, &offset);
+ SVN_ERR(svn_io_file_seek(report->body_file, APR_SET, &offset, pool));
*body_bkt = serf_bucket_file_create(report->body_file, alloc);
@@ -2775,7 +2777,7 @@ finish_report(void *report_baton,
* check the buffer status; but serf will fall through and create a file
* bucket for us on the buffered svndiff handle.
*/
- apr_file_flush(report->body_file);
+ SVN_ERR(svn_io_file_flush(report->body_file, iterpool));
#if APR_VERSION_AT_LEAST(1, 3, 0)
apr_file_buffer_set(report->body_file, NULL, 0);
#endif
@@ -2996,7 +2998,7 @@ finish_report(void *report_baton,
report->num_active_fetches--;
/* See if the parent directory of this fetched item (and
- perhaps even parents of that) can be closed now.
+ perhaps even parents of that) can be closed now.
NOTE: This could delete cur_dir->pool, from which is
allocated the list item in report->done_fetches.
@@ -3447,9 +3449,9 @@ svn_ra_serf__do_switch(svn_ra_session_t
/* Helper svn_ra_serf__get_file(). Attempts to fetch file contents
* using SESSION->wc_callbacks->get_wc_contents() if sha1 property is
* present in PROPS.
- *
+ *
* Sets *FOUND_P to TRUE if file contents was successfuly fetched.
- *
+ *
* Performs all temporary allocations in POOL.
*/
static svn_error_t *
@@ -3502,7 +3504,7 @@ try_get_wc_contents(svn_boolean_t *found
/* Ignore errors for now. */
return SVN_NO_ERROR;
}
-
+
if (wc_stream)
{
SVN_ERR(svn_stream_copy3(wc_stream,
@@ -3565,7 +3567,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
{
which_props = check_path_props;
}
-
+
SVN_ERR(svn_ra_serf__fetch_node_props(&fetch_props, conn, fetch_url,
SVN_INVALID_REVNUM,
which_props,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util.c Wed Jun 5 09:22:43 2013
@@ -497,7 +497,7 @@ svn_ra_serf__conn_closed(serf_connection
err = svn_error_trace(connection_closed(ra_conn, why, pool));
- save_error(ra_conn->session, err);
+ (void) save_error(ra_conn->session, err);
}
@@ -657,7 +657,7 @@ setup_serf_req(serf_request_t *request,
SVN_ERR(svn_ra_serf__copy_into_spillbuf(&buf, body_bkt,
request_pool,
scratch_pool));
- /* Destroy original bucket since it content is already copied
+ /* Destroy original bucket since it content is already copied
to spillbuf. */
serf_bucket_destroy(body_bkt);
@@ -723,7 +723,7 @@ svn_ra_serf__context_run_wait(svn_boolea
{
apr_pool_t *iterpool;
apr_interval_time_t waittime_left = sess->timeout;
-
+
assert(sess->pending_error == SVN_NO_ERROR);
iterpool = svn_pool_create(scratch_pool);
@@ -761,7 +761,7 @@ svn_ra_serf__context_run_wait(svn_boolea
{
waittime_left -= SVN_RA_SERF__CONTEXT_RUN_DURATION;
}
- else
+ else
{
return svn_error_create(SVN_ERR_RA_DAV_CONN_TIMEOUT, NULL,
_("Connection timed out"));
@@ -776,6 +776,8 @@ svn_ra_serf__context_run_wait(svn_boolea
SVN_ERR(err);
if (status)
{
+ /* ### This omits SVN_WARNING, and possibly relies on the fact that
+ ### MAX(SERF_ERROR_*) < SVN_ERR_BAD_CATEGORY_START? */
if (status >= SVN_ERR_BAD_CATEGORY_START && status < SVN_ERR_LAST)
{
/* apr can't translate subversion errors to text */
@@ -1419,7 +1421,7 @@ xml_parser_cleanup(void *baton)
if (*xmlp)
{
- XML_ParserFree(*xmlp);
+ (void) XML_ParserFree(*xmlp);
*xmlp = NULL;
}
@@ -1451,7 +1453,7 @@ svn_ra_serf__process_pending(svn_ra_serf
/* Parsing the pending conten in the spillbuf will result in many disc i/o
operations. This can be so slow that we don't run the network event
processing loop often enough, resulting in timed out connections.
-
+
So we limit the amounts of bytes parsed per iteration.
*/
while (cur_read < PENDING_TO_PARSE)
@@ -1490,7 +1492,7 @@ svn_ra_serf__process_pending(svn_ra_serf
/* Tell the parser that no more content will be parsed. Ignore the
return status. We just don't care. */
- XML_Parse(parser->xmlp, NULL, 0, 1);
+ (void) XML_Parse(parser->xmlp, NULL, 0, 1);
apr_pool_cleanup_run(parser->pool, &parser->xmlp, xml_parser_cleanup);
parser->xmlp = NULL;
@@ -1711,7 +1713,7 @@ svn_ra_serf__handle_xml_parser(serf_requ
SVN_ERR_ASSERT(ctx->xmlp != NULL);
/* Ignore the return status. We just don't care. */
- XML_Parse(ctx->xmlp, NULL, 0, 1);
+ (void) XML_Parse(ctx->xmlp, NULL, 0, 1);
apr_pool_cleanup_run(ctx->pool, &ctx->xmlp, xml_parser_cleanup);
add_done_item(ctx);
@@ -1763,7 +1765,7 @@ svn_ra_serf__credentials_callback(char *
if (err)
{
- save_error(session, err);
+ (void) save_error(session, err);
return err->apr_err;
}
@@ -1772,8 +1774,8 @@ svn_ra_serf__credentials_callback(char *
if (!creds || session->auth_attempts > 4)
{
/* No more credentials. */
- save_error(session,
- svn_error_create(
+ (void) save_error(session,
+ svn_error_create(
SVN_ERR_AUTHN_FAILED, NULL,
_("No more credentials or we tried too many "
"times.\nAuthentication failed")));
@@ -1794,8 +1796,8 @@ svn_ra_serf__credentials_callback(char *
if (!session->proxy_username || session->proxy_auth_attempts > 4)
{
/* No more credentials. */
- save_error(session,
- svn_error_create(
+ (void) save_error(session,
+ svn_error_create(
SVN_ERR_AUTHN_FAILED, NULL,
_("Proxy authentication failed")));
return SVN_ERR_AUTHN_FAILED;
@@ -2217,8 +2219,8 @@ svn_ra_serf__request_create(svn_ra_serf_
/* ### do we need to hold onto the returned request object, or just
### not worry about it (the serf ctx will manage it). */
- serf_connection_request_create(handler->conn->conn,
- setup_request_cb, handler);
+ (void) serf_connection_request_create(handler->conn->conn,
+ setup_request_cb, handler);
}
@@ -2446,7 +2448,7 @@ expat_start(void *userData, const char *
#ifdef EXPAT_HAS_STOPPARSER
if (ectx->inner_error)
- XML_StopParser(ectx->parser, 0 /* resumable */);
+ (void) XML_StopParser(ectx->parser, 0 /* resumable */);
#endif
}
@@ -2465,7 +2467,7 @@ expat_end(void *userData, const char *ra
#ifdef EXPAT_HAS_STOPPARSER
if (ectx->inner_error)
- XML_StopParser(ectx->parser, 0 /* resumable */);
+ (void) XML_StopParser(ectx->parser, 0 /* resumable */);
#endif
}
@@ -2484,7 +2486,7 @@ expat_cdata(void *userData, const char *
#ifdef EXPAT_HAS_STOPPARSER
if (ectx->inner_error)
- XML_StopParser(ectx->parser, 0 /* resumable */);
+ (void) XML_StopParser(ectx->parser, 0 /* resumable */);
#endif
}
@@ -2570,7 +2572,7 @@ expat_response_handler(serf_request_t *r
{
/* Tell expat we've reached the end of the content. Ignore the
return status. We just don't care. */
- XML_Parse(ectx->parser, NULL, 0, 1 /* isFinal */);
+ (void) XML_Parse(ectx->parser, NULL, 0, 1 /* isFinal */);
svn_ra_serf__xml_context_destroy(ectx->xmlctx);
apr_pool_cleanup_run(ectx->cleanup_pool, &ectx->parser,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/xml.c?rev=1489765&r1=1489764&r2=1489765&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/xml.c Wed Jun 5 09:22:43 2013
@@ -219,7 +219,7 @@ svn_ra_serf__expand_ns(svn_ra_serf__dav_
return;
}
}
- }
+ }
/* If the prefix is not found, then the name is NOT within a
namespace. */