You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/03/21 03:39:00 UTC
svn commit: r1303257 [3/4] - in /subversion/branches/inheritable-props: ./
build/ac-macros/ notes/ notes/directory-index/ notes/wc-ng/
subversion/bindings/swig/ruby/test/ subversion/include/
subversion/include/private/ subversion/libsvn_client/ subvers...
Modified: subversion/branches/inheritable-props/subversion/libsvn_delta/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_delta/editor.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_delta/editor.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_delta/editor.c Wed Mar 21 02:38:58 2012
@@ -55,6 +55,8 @@ struct svn_editor_t
apr_pool_t *scratch_pool;
#ifdef ENABLE_ORDERING_CHECK
+ svn_boolean_t within_callback;
+
apr_hash_t *pending_incomplete_children;
apr_hash_t *completed_nodes;
svn_boolean_t finished;
@@ -63,8 +65,17 @@ struct svn_editor_t
#endif
};
+
#ifdef ENABLE_ORDERING_CHECK
+#define START_CALLBACK(editor) \
+ do { \
+ svn_editor_t *editor__tmp_e = (editor); \
+ SVN_ERR_ASSERT(!editor__tmp_e->within_callback); \
+ editor__tmp_e->within_callback = TRUE; \
+ } while (0)
+#define END_CALLBACK(editor) ((editor)->within_callback = FALSE)
+
/* Marker to indicate no further changes are allowed on this node. */
static const int marker_done;
#define MARKER_DONE (&marker_done)
@@ -161,6 +172,9 @@ check_unknown_child(const svn_editor_t *
end up with "statement with no effect" warnings. Obviously, this
depends upon particular usage, which is easy to verify. */
+#define START_CALLBACK(editor) /* empty */
+#define END_CALLBACK(editor) /* empty */
+
#define MARK_FINISHED(editor) /* empty */
#define SHOULD_NOT_BE_FINISHED(editor) /* empty */
@@ -364,6 +378,22 @@ svn_editor_setcb_many(svn_editor_t *edit
}
+static svn_error_t *
+check_cancel(svn_editor_t *editor)
+{
+ svn_error_t *err = NULL;
+
+ if (editor->cancel_func)
+ {
+ START_CALLBACK(editor);
+ err = editor->cancel_func(editor->cancel_baton);
+ END_CALLBACK(editor);
+ }
+
+ return err;
+}
+
+
svn_error_t *
svn_editor_add_directory(svn_editor_t *editor,
const char *relpath,
@@ -379,13 +409,16 @@ svn_editor_add_directory(svn_editor_t *e
SHOULD_ALLOW_ADD(editor, relpath);
CHECK_UNKNOWN_CHILD(editor, relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_add_directory)
- err = editor->funcs.cb_add_directory(editor->baton, relpath, children,
- props, replaces_rev,
- editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_add_directory(editor->baton, relpath, children,
+ props, replaces_rev,
+ editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_ADDED_DIR(editor, relpath);
CLEAR_INCOMPLETE(editor, relpath);
@@ -428,13 +461,16 @@ svn_editor_add_file(svn_editor_t *editor
SHOULD_ALLOW_ADD(editor, relpath);
CHECK_UNKNOWN_CHILD(editor, relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_add_file)
- err = editor->funcs.cb_add_file(editor->baton, relpath,
- checksum, contents, props,
- replaces_rev, editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_add_file(editor->baton, relpath,
+ checksum, contents, props,
+ replaces_rev, editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_COMPLETED(editor, relpath);
CLEAR_INCOMPLETE(editor, relpath);
@@ -458,12 +494,15 @@ svn_editor_add_symlink(svn_editor_t *edi
SHOULD_ALLOW_ADD(editor, relpath);
CHECK_UNKNOWN_CHILD(editor, relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_add_symlink)
- err = editor->funcs.cb_add_symlink(editor->baton, relpath, target, props,
- replaces_rev, editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_add_symlink(editor->baton, relpath, target, props,
+ replaces_rev, editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_COMPLETED(editor, relpath);
CLEAR_INCOMPLETE(editor, relpath);
@@ -485,12 +524,15 @@ svn_editor_add_absent(svn_editor_t *edit
SHOULD_ALLOW_ADD(editor, relpath);
CHECK_UNKNOWN_CHILD(editor, relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_add_absent)
- err = editor->funcs.cb_add_absent(editor->baton, relpath, kind,
- replaces_rev, editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_add_absent(editor->baton, relpath, kind,
+ replaces_rev, editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_COMPLETED(editor, relpath);
CLEAR_INCOMPLETE(editor, relpath);
@@ -512,13 +554,16 @@ svn_editor_alter_directory(svn_editor_t
SHOULD_NOT_BE_FINISHED(editor);
SHOULD_ALLOW_ALTER(editor, relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_alter_directory)
- err = editor->funcs.cb_alter_directory(editor->baton,
- relpath, revision, props,
- editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_alter_directory(editor->baton,
+ relpath, revision, props,
+ editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_COMPLETED(editor, relpath);
@@ -545,14 +590,17 @@ svn_editor_alter_file(svn_editor_t *edit
SHOULD_NOT_BE_FINISHED(editor);
SHOULD_ALLOW_ALTER(editor, relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_alter_file)
- err = editor->funcs.cb_alter_file(editor->baton,
- relpath, revision, props,
- checksum, contents,
- editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_alter_file(editor->baton,
+ relpath, revision, props,
+ checksum, contents,
+ editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_COMPLETED(editor, relpath);
@@ -574,14 +622,17 @@ svn_editor_alter_symlink(svn_editor_t *e
SHOULD_NOT_BE_FINISHED(editor);
SHOULD_ALLOW_ALTER(editor, relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_alter_symlink)
- err = editor->funcs.cb_alter_symlink(editor->baton,
- relpath, revision, props,
- target,
- editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_alter_symlink(editor->baton,
+ relpath, revision, props,
+ target,
+ editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_COMPLETED(editor, relpath);
@@ -600,12 +651,15 @@ svn_editor_delete(svn_editor_t *editor,
SHOULD_NOT_BE_FINISHED(editor);
SHOULD_NOT_BE_COMPLETED(editor, relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_delete)
- err = editor->funcs.cb_delete(editor->baton, relpath, revision,
- editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_delete(editor->baton, relpath, revision,
+ editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_COMPLETED(editor, relpath);
@@ -626,13 +680,16 @@ svn_editor_copy(svn_editor_t *editor,
SHOULD_NOT_BE_FINISHED(editor);
SHOULD_ALLOW_ADD(editor, dst_relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_copy)
- err = editor->funcs.cb_copy(editor->baton, src_relpath, src_revision,
- dst_relpath, replaces_rev,
- editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_copy(editor->baton, src_relpath, src_revision,
+ dst_relpath, replaces_rev,
+ editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_ALLOW_ALTER(editor, dst_relpath);
CLEAR_INCOMPLETE(editor, dst_relpath);
@@ -655,13 +712,16 @@ svn_editor_move(svn_editor_t *editor,
SHOULD_NOT_BE_COMPLETED(editor, src_relpath);
SHOULD_ALLOW_ADD(editor, dst_relpath);
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_move)
- err = editor->funcs.cb_move(editor->baton, src_relpath, src_revision,
- dst_relpath, replaces_rev,
- editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_move(editor->baton, src_relpath, src_revision,
+ dst_relpath, replaces_rev,
+ editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_ALLOW_ADD(editor, src_relpath);
MARK_ALLOW_ALTER(editor, dst_relpath);
@@ -691,12 +751,15 @@ svn_editor_rotate(svn_editor_t *editor,
}
#endif
- if (editor->cancel_func)
- SVN_ERR(editor->cancel_func(editor->cancel_baton));
+ SVN_ERR(check_cancel(editor));
if (editor->funcs.cb_rotate)
- err = editor->funcs.cb_rotate(editor->baton, relpaths, revisions,
- editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_rotate(editor->baton, relpaths, revisions,
+ editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
#ifdef ENABLE_ORDERING_CHECK
{
@@ -725,7 +788,11 @@ svn_editor_complete(svn_editor_t *editor
#endif
if (editor->funcs.cb_complete)
- err = editor->funcs.cb_complete(editor->baton, editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_complete(editor->baton, editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_FINISHED(editor);
@@ -742,7 +809,11 @@ svn_editor_abort(svn_editor_t *editor)
SHOULD_NOT_BE_FINISHED(editor);
if (editor->funcs.cb_abort)
- err = editor->funcs.cb_abort(editor->baton, editor->scratch_pool);
+ {
+ START_CALLBACK(editor);
+ err = editor->funcs.cb_abort(editor->baton, editor->scratch_pool);
+ END_CALLBACK(editor);
+ }
MARK_FINISHED(editor);
Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.c Wed Mar 21 02:38:58 2012
@@ -1296,3 +1296,27 @@ svn_fs_fs__dag_get_copyfrom_path(const c
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_fs_fs__dag_update_ancestry(dag_node_t *target,
+ dag_node_t *source,
+ apr_pool_t *pool)
+{
+ node_revision_t *source_noderev, *target_noderev;
+
+ if (! svn_fs_fs__dag_check_mutable(target))
+ return svn_error_createf
+ (SVN_ERR_FS_NOT_MUTABLE, NULL,
+ _("Attempted to update ancestry of non-mutable node"));
+
+ SVN_ERR(get_node_revision(&source_noderev, source, pool));
+ SVN_ERR(get_node_revision(&target_noderev, target, pool));
+
+ target_noderev->predecessor_id = source->id;
+ target_noderev->predecessor_count = source_noderev->predecessor_count;
+ if (target_noderev->predecessor_count != -1)
+ target_noderev->predecessor_count++;
+
+ return svn_fs_fs__put_node_revision(target->fs, target->id, target_noderev,
+ FALSE, pool);
+}
Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.h?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.h Wed Mar 21 02:38:58 2012
@@ -603,6 +603,12 @@ svn_error_t *svn_fs_fs__dag_get_copyfrom
dag_node_t *node,
apr_pool_t *pool);
+/* Update *TARGET so that SOURCE is it's predecessor.
+ */
+svn_error_t *
+svn_fs_fs__dag_update_ancestry(dag_node_t *target,
+ dag_node_t *source,
+ apr_pool_t *pool);
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.h?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.h Wed Mar 21 02:38:58 2012
@@ -256,7 +256,7 @@ typedef struct fs_fs_data_t
/* If set, there are or have been more than one concurrent transaction */
svn_boolean_t concurrent_transactions;
- /* Tempoary cache for changed directories yet to be committed; maps from
+ /* Temporary cache for changed directories yet to be committed; maps from
unparsed FS ID to ###x. NULL outside transactions. */
svn_cache__t *txn_dir_cache;
Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/tree.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/tree.c Wed Mar 21 02:38:58 2012
@@ -1180,30 +1180,6 @@ get_root(dag_node_t **node, svn_fs_root_
}
-static svn_error_t *
-update_ancestry(svn_fs_t *fs,
- const svn_fs_id_t *source_id,
- const svn_fs_id_t *target_id,
- const char *target_path,
- int source_pred_count,
- apr_pool_t *pool)
-{
- node_revision_t *noderev;
-
- if (svn_fs_fs__id_txn_id(target_id) == NULL)
- return svn_error_createf
- (SVN_ERR_FS_NOT_MUTABLE, NULL,
- _("Unexpected immutable node at '%s'"), target_path);
-
- SVN_ERR(svn_fs_fs__get_node_revision(&noderev, fs, target_id, pool));
- noderev->predecessor_id = source_id;
- noderev->predecessor_count = source_pred_count;
- if (noderev->predecessor_count != -1)
- noderev->predecessor_count++;
- return svn_fs_fs__put_node_revision(fs, target_id, noderev, FALSE, pool);
-}
-
-
/* Set the contents of CONFLICT_PATH to PATH, and return an
SVN_ERR_FS_CONFLICT error that indicates that there was a conflict
at PATH. Perform all allocations in POOL (except the allocation of
@@ -1255,7 +1231,6 @@ merge(svn_stringbuf_t *conflict_p,
apr_hash_index_t *hi;
svn_fs_t *fs;
apr_pool_t *iterpool;
- int pred_count;
apr_int64_t mergeinfo_increment = 0;
/* Make sure everyone comes from the same filesystem. */
@@ -1579,9 +1554,7 @@ merge(svn_stringbuf_t *conflict_p,
}
svn_pool_destroy(iterpool);
- SVN_ERR(svn_fs_fs__dag_get_predecessor_count(&pred_count, source, pool));
- SVN_ERR(update_ancestry(fs, source_id, target_id, target_path,
- pred_count, pool));
+ SVN_ERR(svn_fs_fs__dag_update_ancestry(target, source, pool));
if (svn_fs_fs__fs_supports_mergeinfo(fs))
SVN_ERR(svn_fs_fs__dag_increment_mergeinfo_count(target,
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/blame.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/blame.c Wed Mar 21 02:38:58 2012
@@ -39,6 +39,8 @@
#include "svn_private_config.h"
+#include "private/svn_string_private.h"
+
#include "ra_serf.h"
#include "../libsvn_ra/ra_loader.h"
@@ -85,10 +87,7 @@ typedef struct blame_info_t {
/* The currently collected value as we build it up */
const char *prop_name;
- const char *prop_attr;
- apr_size_t prop_attr_len;
-
- svn_string_t *prop_string;
+ svn_stringbuf_t *prop_value;
/* Merged revision flag */
svn_boolean_t merged_revision;
@@ -125,18 +124,16 @@ push_state(svn_ra_serf__xml_parser_t *pa
{
blame_info_t *info;
- info = apr_palloc(parser->state->pool, sizeof(*info));
+ info = apr_pcalloc(parser->state->pool, sizeof(*info));
info->pool = parser->state->pool;
info->rev = SVN_INVALID_REVNUM;
- info->path = NULL;
info->rev_props = apr_hash_make(info->pool);
info->prop_diffs = apr_array_make(info->pool, 0, sizeof(svn_prop_t));
- info->stream = NULL;
- info->merged_revision = FALSE;
+ info->prop_value = svn_stringbuf_create_empty(info->pool);
parser->state->private = info;
}
@@ -147,24 +144,15 @@ push_state(svn_ra_serf__xml_parser_t *pa
static const svn_string_t *
create_propval(blame_info_t *info)
{
- const svn_string_t *s;
-
- if (!info->prop_attr)
- {
- return svn_string_create_empty(info->pool);
- }
- else
- {
- info->prop_attr = apr_pmemdup(info->pool, info->prop_attr,
- info->prop_attr_len + 1);
- }
-
- s = svn_string_ncreate(info->prop_attr, info->prop_attr_len, info->pool);
if (info->prop_base64)
{
- s = svn_base64_decode_string(s, info->pool);
+ const svn_string_t *morph;
+
+ morph = svn_stringbuf__morph_into_string(info->prop_value);
+ return svn_base64_decode_string(morph, info->pool);
}
- return s;
+
+ return svn_string_create_from_buf(info->prop_value, info->pool);
}
static svn_error_t *
@@ -240,8 +228,7 @@ start_blame(svn_ra_serf__xml_parser_t *p
case REMOVE_PROP:
info->prop_name = apr_pstrdup(info->pool,
svn_xml_get_attr_value("name", attrs));
- info->prop_attr = NULL;
- info->prop_attr_len = 0;
+ svn_stringbuf_setempty(info->prop_value);
enc = svn_xml_get_attr_value("encoding", attrs);
if (enc && strcmp(enc, "base64") == 0)
@@ -360,8 +347,7 @@ cdata_blame(svn_ra_serf__xml_parser_t *p
{
case REV_PROP:
case SET_PROP:
- svn_ra_serf__expand_string(&info->prop_attr, &info->prop_attr_len,
- data, len, parser->state->pool);
+ svn_stringbuf_appendbytes(info->prop_value, data, len);
break;
case TXDELTA:
if (info->stream)
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/commit.c Wed Mar 21 02:38:58 2012
@@ -2217,7 +2217,10 @@ close_edit(void *edit_baton,
if (svn_ra_serf__merge_get_status(merge_ctx) != 200)
{
- SVN_ERR_MALFUNCTION();
+ return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+ _("MERGE request failed: returned %d "
+ "(during commit)"),
+ svn_ra_serf__merge_get_status(merge_ctx));
}
/* Inform the WC that we did a commit. */
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/getdate.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/getdate.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/getdate.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/getdate.c Wed Mar 21 02:38:58 2012
@@ -51,15 +51,8 @@ typedef enum date_state_e {
VERSION_NAME
} date_state_e;
-typedef struct date_info_t {
- /* The currently collected value as we build it up */
- const char *tmp;
- apr_size_t tmp_len;
-} date_info_t;
typedef struct date_context_t {
- apr_pool_t *pool;
-
/* The time asked about. */
apr_time_t time;
@@ -71,25 +64,6 @@ typedef struct date_context_t {
} date_context_t;
-
-static date_info_t *
-push_state(svn_ra_serf__xml_parser_t *parser,
- date_context_t *date_ctx,
- date_state_e state)
-{
- svn_ra_serf__xml_push_state(parser, state);
-
- if (state == VERSION_NAME)
- {
- date_info_t *info;
-
- info = apr_pcalloc(parser->state->pool, sizeof(*info));
-
- parser->state->private = info;
- }
-
- return parser->state->private;
-}
static svn_error_t *
start_getdate(svn_ra_serf__xml_parser_t *parser,
@@ -98,14 +72,16 @@ start_getdate(svn_ra_serf__xml_parser_t
const char **attrs)
{
date_context_t *date_ctx = userData;
- date_state_e state;
+ date_state_e state = parser->state->current_state;
- state = parser->state->current_state;
+ UNUSED_CTX(date_ctx);
if (state == NONE &&
strcmp(name.name, SVN_DAV__VERSION_NAME) == 0)
{
- push_state(parser, date_ctx, VERSION_NAME);
+ svn_ra_serf__xml_push_state(parser, VERSION_NAME);
+
+ parser->state->private = svn_stringbuf_create_empty(parser->state->pool);
}
return SVN_NO_ERROR;
@@ -117,16 +93,14 @@ end_getdate(svn_ra_serf__xml_parser_t *p
svn_ra_serf__dav_props_t name)
{
date_context_t *date_ctx = userData;
- date_state_e state;
- date_info_t *info;
-
- state = parser->state->current_state;
- info = parser->state->private;
+ date_state_e state = parser->state->current_state;
if (state == VERSION_NAME &&
strcmp(name.name, SVN_DAV__VERSION_NAME) == 0)
{
- *date_ctx->revision = SVN_STR_TO_REV(info->tmp);
+ const svn_stringbuf_t *datebuf = parser->state->private;
+
+ *date_ctx->revision = SVN_STR_TO_REV(datebuf->data);
svn_ra_serf__xml_pop_state(parser);
}
@@ -140,19 +114,16 @@ cdata_getdate(svn_ra_serf__xml_parser_t
apr_size_t len)
{
date_context_t *date_ctx = userData;
- date_state_e state;
- date_info_t *info;
+ date_state_e state = parser->state->current_state;
+ svn_stringbuf_t *datebuf;
UNUSED_CTX(date_ctx);
- state = parser->state->current_state;
- info = parser->state->private;
-
switch (state)
{
case VERSION_NAME:
- svn_ra_serf__expand_string(&info->tmp, &info->tmp_len,
- data, len, parser->state->pool);
+ datebuf = parser->state->private;
+ svn_stringbuf_appendbytes(datebuf, data, len);
break;
default:
break;
@@ -202,8 +173,7 @@ svn_ra_serf__get_dated_revision(svn_ra_s
const char *report_target;
int status_code;
- date_ctx = apr_pcalloc(pool, sizeof(*date_ctx));
- date_ctx->pool = pool;
+ date_ctx = apr_palloc(pool, sizeof(*date_ctx));
date_ctx->time = tm;
date_ctx->revision = revision;
date_ctx->done = FALSE;
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/getlocks.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/getlocks.c Wed Mar 21 02:38:58 2012
@@ -65,8 +65,7 @@ typedef struct lock_info_t {
svn_lock_t *lock;
/* The currently collected value as we build it up */
- const char *tmp;
- apr_size_t tmp_len;
+ svn_stringbuf_t *cdata;
} lock_info_t;
@@ -101,7 +100,7 @@ push_state(svn_ra_serf__xml_parser_t *pa
info->pool = lock_ctx->pool;
info->lock = svn_lock_create(lock_ctx->pool);
- info->lock->path =
+ info->cdata = svn_stringbuf_create_empty(info->pool);
parser->state->private = info;
}
@@ -212,46 +211,50 @@ end_getlocks(svn_ra_serf__xml_parser_t *
else if (state == PATH &&
strcmp(name.name, "path") == 0)
{
- info->lock->path = apr_pstrmemdup(info->pool, info->tmp, info->tmp_len);
- info->tmp_len = 0;
+ info->lock->path = apr_pstrmemdup(info->pool,
+ info->cdata->data, info->cdata->len);
+ svn_stringbuf_setempty(info->cdata);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == TOKEN &&
strcmp(name.name, "token") == 0)
{
- info->lock->token = apr_pstrmemdup(info->pool, info->tmp, info->tmp_len);
- info->tmp_len = 0;
+ info->lock->token = apr_pstrmemdup(info->pool,
+ info->cdata->data, info->cdata->len);
+ svn_stringbuf_setempty(info->cdata);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == OWNER &&
strcmp(name.name, "owner") == 0)
{
- info->lock->owner = apr_pstrmemdup(info->pool, info->tmp, info->tmp_len);
- info->tmp_len = 0;
+ info->lock->owner = apr_pstrmemdup(info->pool,
+ info->cdata->data, info->cdata->len);
+ svn_stringbuf_setempty(info->cdata);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == COMMENT &&
strcmp(name.name, "comment") == 0)
{
info->lock->comment = apr_pstrmemdup(info->pool,
- info->tmp, info->tmp_len);
- info->tmp_len = 0;
+ info->cdata->data,
+ info->cdata->len);
+ svn_stringbuf_setempty(info->cdata);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == CREATION_DATE &&
strcmp(name.name, SVN_DAV__CREATIONDATE) == 0)
{
SVN_ERR(svn_time_from_cstring(&info->lock->creation_date,
- info->tmp, info->pool));
- info->tmp_len = 0;
+ info->cdata->data, info->pool));
+ svn_stringbuf_setempty(info->cdata);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == EXPIRATION_DATE &&
strcmp(name.name, "expirationdate") == 0)
{
SVN_ERR(svn_time_from_cstring(&info->lock->expiration_date,
- info->tmp, info->pool));
- info->tmp_len = 0;
+ info->cdata->data, info->pool));
+ svn_stringbuf_setempty(info->cdata);
svn_ra_serf__xml_pop_state(parser);
}
@@ -281,8 +284,7 @@ cdata_getlocks(svn_ra_serf__xml_parser_t
case COMMENT:
case CREATION_DATE:
case EXPIRATION_DATE:
- svn_ra_serf__expand_string(&info->tmp, &info->tmp_len,
- data, len, parser->state->pool);
+ svn_stringbuf_appendbytes(info->cdata, data, len);
break;
default:
break;
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/locks.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/locks.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/locks.c Wed Mar 21 02:38:58 2012
@@ -58,11 +58,6 @@ typedef enum lock_state_e {
COMMENT
} lock_state_e;
-typedef struct lock_prop_info_t {
- const char *data;
- apr_size_t len;
-} lock_prop_info_t;
-
typedef struct lock_info_t {
apr_pool_t *pool;
@@ -88,7 +83,7 @@ typedef struct lock_info_t {
} lock_info_t;
-static lock_prop_info_t*
+static svn_stringbuf_t *
push_state(svn_ra_serf__xml_parser_t *parser,
lock_info_t *lock_ctx,
lock_state_e state)
@@ -102,8 +97,8 @@ push_state(svn_ra_serf__xml_parser_t *pa
case TIMEOUT:
case LOCK_TOKEN:
case COMMENT:
- parser->state->private = apr_pcalloc(parser->state->pool,
- sizeof(lock_prop_info_t));
+ parser->state->private =
+ svn_stringbuf_create_empty(parser->state->pool);
break;
default:
break;
@@ -239,7 +234,7 @@ end_lock(svn_ra_serf__xml_parser_t *pars
else if (state == TIMEOUT &&
strcmp(name.name, "timeout") == 0)
{
- lock_prop_info_t *info = parser->state->private;
+ svn_stringbuf_t *info = parser->state->private;
if (strcmp(info->data, "Infinite") == 0)
{
@@ -255,12 +250,12 @@ end_lock(svn_ra_serf__xml_parser_t *pars
else if (state == LOCK_TOKEN &&
strcmp(name.name, "locktoken") == 0)
{
- lock_prop_info_t *info = parser->state->private;
+ svn_stringbuf_t *info = parser->state->private;
if (!ctx->lock->token && info->len)
{
- apr_collapse_spaces((char*)info->data, info->data);
- ctx->lock->token = apr_pstrndup(ctx->pool, info->data, info->len);
+ apr_collapse_spaces(info->data, info->data);
+ ctx->lock->token = apr_pstrmemdup(ctx->pool, info->data, info->len);
}
/* We don't actually need the lock token. */
svn_ra_serf__xml_pop_state(parser);
@@ -268,11 +263,12 @@ end_lock(svn_ra_serf__xml_parser_t *pars
else if (state == COMMENT &&
strcmp(name.name, "owner") == 0)
{
- lock_prop_info_t *info = parser->state->private;
+ svn_stringbuf_t *info = parser->state->private;
if (info->len)
{
- ctx->lock->comment = apr_pstrndup(ctx->pool, info->data, info->len);
+ ctx->lock->comment = apr_pstrmemdup(ctx->pool,
+ info->data, info->len);
}
svn_ra_serf__xml_pop_state(parser);
}
@@ -288,7 +284,7 @@ cdata_lock(svn_ra_serf__xml_parser_t *pa
{
lock_info_t *lock_ctx = userData;
lock_state_e state;
- lock_prop_info_t *info;
+ svn_stringbuf_t *info;
UNUSED_CTX(lock_ctx);
@@ -303,9 +299,9 @@ cdata_lock(svn_ra_serf__xml_parser_t *pa
case TIMEOUT:
case LOCK_TOKEN:
case COMMENT:
- svn_ra_serf__expand_string(&info->data, &info->len,
- data, len, parser->state->pool);
+ svn_stringbuf_appendbytes(info, data, len);
break;
+
default:
break;
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/log.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/log.c Wed Mar 21 02:38:58 2012
@@ -39,6 +39,7 @@
#include "svn_props.h"
#include "private/svn_dav_protocol.h"
+#include "private/svn_string_private.h"
#include "svn_private_config.h"
#include "ra_serf.h"
@@ -71,8 +72,7 @@ typedef struct log_info_t {
/* The currently collected value as we build it up, and its wire
* encoding (if any).
*/
- const char *tmp;
- apr_size_t tmp_len;
+ svn_stringbuf_t *tmp;
const char *tmp_encoding;
/* Temporary change path - ultimately inserted into changed_paths hash. */
@@ -130,6 +130,7 @@ push_state(svn_ra_serf__xml_parser_t *pa
info = apr_pcalloc(info_pool, sizeof(*info));
info->pool = info_pool;
+ info->tmp = svn_stringbuf_create_empty(info_pool);
info->log_entry = svn_log_entry_create(info_pool);
info->log_entry->revision = SVN_INVALID_REVNUM;
@@ -218,15 +219,15 @@ start_log(svn_ra_serf__xml_parser_t *par
}
else if (strcmp(name.name, "creator-displayname") == 0)
{
- info = push_state(parser, log_ctx, CREATOR, attrs);
+ push_state(parser, log_ctx, CREATOR, attrs);
}
else if (strcmp(name.name, "date") == 0)
{
- info = push_state(parser, log_ctx, DATE, attrs);
+ push_state(parser, log_ctx, DATE, attrs);
}
else if (strcmp(name.name, "comment") == 0)
{
- info = push_state(parser, log_ctx, COMMENT, attrs);
+ push_state(parser, log_ctx, COMMENT, attrs);
}
else if (strcmp(name.name, "revprop") == 0)
{
@@ -321,11 +322,12 @@ static svn_error_t *
maybe_decode_log_cdata(const svn_string_t **decoded_cdata,
log_info_t *info)
{
+
if (info->tmp_encoding)
{
- svn_string_t in;
- in.data = info->tmp;
- in.len = info->tmp_len;
+ const svn_string_t *morph;
+
+ morph = svn_stringbuf__morph_into_string(info->tmp);
/* Check for a known encoding type. This is easy -- there's
only one. */
@@ -336,12 +338,11 @@ maybe_decode_log_cdata(const svn_string_
info->tmp_encoding);
}
- *decoded_cdata = svn_base64_decode_string(&in, info->pool);
+ *decoded_cdata = svn_base64_decode_string(morph, info->pool);
}
else
{
- *decoded_cdata = svn_string_ncreate(info->tmp, info->tmp_len,
- info->pool);
+ *decoded_cdata = svn_string_create_from_buf(info->tmp, info->pool);
}
return SVN_NO_ERROR;
}
@@ -393,8 +394,8 @@ end_log(svn_ra_serf__xml_parser_t *parse
else if (state == VERSION &&
strcmp(name.name, SVN_DAV__VERSION_NAME) == 0)
{
- info->log_entry->revision = SVN_STR_TO_REV(info->tmp);
- info->tmp_len = 0;
+ info->log_entry->revision = SVN_STR_TO_REV(info->tmp->data);
+ svn_stringbuf_setempty(info->tmp);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == CREATOR &&
@@ -407,7 +408,7 @@ end_log(svn_ra_serf__xml_parser_t *parse
apr_hash_set(info->log_entry->revprops, SVN_PROP_REVISION_AUTHOR,
APR_HASH_KEY_STRING, decoded_cdata);
}
- info->tmp_len = 0;
+ svn_stringbuf_setempty(info->tmp);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == DATE &&
@@ -420,7 +421,7 @@ end_log(svn_ra_serf__xml_parser_t *parse
apr_hash_set(info->log_entry->revprops, SVN_PROP_REVISION_DATE,
APR_HASH_KEY_STRING, decoded_cdata);
}
- info->tmp_len = 0;
+ svn_stringbuf_setempty(info->tmp);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == COMMENT &&
@@ -433,7 +434,7 @@ end_log(svn_ra_serf__xml_parser_t *parse
apr_hash_set(info->log_entry->revprops, SVN_PROP_REVISION_LOG,
APR_HASH_KEY_STRING, decoded_cdata);
}
- info->tmp_len = 0;
+ svn_stringbuf_setempty(info->tmp);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == REVPROP)
@@ -442,7 +443,7 @@ end_log(svn_ra_serf__xml_parser_t *parse
SVN_ERR(maybe_decode_log_cdata(&decoded_cdata, info));
apr_hash_set(info->log_entry->revprops, info->revprop_name,
APR_HASH_KEY_STRING, decoded_cdata);
- info->tmp_len = 0;
+ svn_stringbuf_setempty(info->tmp);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == HAS_CHILDREN &&
@@ -468,8 +469,8 @@ end_log(svn_ra_serf__xml_parser_t *parse
{
char *path;
- path = apr_pstrmemdup(info->pool, info->tmp, info->tmp_len);
- info->tmp_len = 0;
+ path = apr_pstrmemdup(info->pool, info->tmp->data, info->tmp->len);
+ svn_stringbuf_setempty(info->tmp);
apr_hash_set(info->log_entry->changed_paths2, path, APR_HASH_KEY_STRING,
info->tmp_path);
@@ -505,9 +506,9 @@ cdata_log(svn_ra_serf__xml_parser_t *par
case REPLACED_PATH:
case DELETED_PATH:
case MODIFIED_PATH:
- svn_ra_serf__expand_string(&info->tmp, &info->tmp_len,
- data, len, info->pool);
+ svn_stringbuf_appendbytes(info->tmp, data, len);
break;
+
default:
break;
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/merge.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/merge.c Wed Mar 21 02:38:58 2012
@@ -80,8 +80,8 @@ typedef struct merge_info_t {
const char *prop_ns;
const char *prop_name;
- const char *prop_val;
- apr_size_t prop_val_len;
+ svn_stringbuf_t *prop_value;
+
} merge_info_t;
/* Structure associated with a MERGE request. */
@@ -119,6 +119,7 @@ push_state(svn_ra_serf__xml_parser_t *pa
info = apr_palloc(parser->state->pool, sizeof(*info));
info->pool = parser->state->pool;
info->props = apr_hash_make(info->pool);
+ info->prop_value = svn_stringbuf_create_empty(info->pool);
parser->state->private = info;
}
@@ -163,9 +164,8 @@ start_merge(svn_ra_serf__xml_parser_t *p
info = push_state(parser, ctx, PROP_VAL);
info->prop_ns = name.namespace;
- info->prop_name = apr_pstrdup(info->pool, name.name);
- info->prop_val = NULL;
- info->prop_val_len = 0;
+ info->prop_name = "href";
+ svn_stringbuf_setempty(info->prop_value);
}
else if (state == RESPONSE &&
strcmp(name.name, "propstat") == 0)
@@ -206,11 +206,9 @@ start_merge(svn_ra_serf__xml_parser_t *p
strcmp(name.name, "checked-in") == 0)
{
info = push_state(parser, ctx, IGNORE_PROP_NAME);
-
info->prop_ns = name.namespace;
- info->prop_name = apr_pstrdup(info->pool, name.name);
- info->prop_val = NULL;
- info->prop_val_len = 0;
+ info->prop_name = "checked-in";
+ svn_stringbuf_setempty(info->prop_value);
}
else if (state == PROP)
{
@@ -225,8 +223,7 @@ start_merge(svn_ra_serf__xml_parser_t *p
info = push_state(parser, ctx, PROP_VAL);
info->prop_ns = name.namespace;
info->prop_name = apr_pstrdup(info->pool, name.name);
- info->prop_val = NULL;
- info->prop_val_len = 0;
+ svn_stringbuf_setempty(info->prop_value);
}
else
{
@@ -349,24 +346,27 @@ end_merge(svn_ra_serf__xml_parser_t *par
}
else if (state == PROP_VAL)
{
+ const char *value;
+
if (!info->prop_name)
{
+ /* ### gstein sez: dunno what this is about. */
info->prop_name = apr_pstrdup(info->pool, name.name);
}
- info->prop_val = apr_pstrmemdup(info->pool, info->prop_val,
- info->prop_val_len);
+
if (strcmp(info->prop_name, "href") == 0)
- info->prop_val = svn_urlpath__canonicalize(info->prop_val,
- info->pool);
+ value = svn_urlpath__canonicalize(info->prop_value->data, info->pool);
+ else
+ value = apr_pstrmemdup(info->pool,
+ info->prop_value->data, info->prop_value->len);
/* Set our property. */
apr_hash_set(info->props, info->prop_name, APR_HASH_KEY_STRING,
- info->prop_val);
+ value);
info->prop_ns = NULL;
info->prop_name = NULL;
- info->prop_val = NULL;
- info->prop_val_len = 0;
+ svn_stringbuf_setempty(info->prop_value);
svn_ra_serf__xml_pop_state(parser);
}
@@ -390,10 +390,7 @@ cdata_merge(svn_ra_serf__xml_parser_t *p
info = parser->state->private;
if (state == PROP_VAL)
- {
- svn_ra_serf__expand_string(&info->prop_val, &info->prop_val_len,
- data, len, parser->state->pool);
- }
+ svn_stringbuf_appendbytes(info->prop_value, data, len);
return SVN_NO_ERROR;
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/options.c Wed Mar 21 02:38:58 2012
@@ -66,8 +66,8 @@ struct svn_ra_serf__options_context_t {
/* pool to allocate memory from */
apr_pool_t *pool;
- const char *attr_val;
- apr_size_t attr_val_len;
+ /* Buffer for the activity-collection */
+ svn_stringbuf_t *acbuf;
svn_boolean_t collect_cdata;
/* Current state we're in */
@@ -187,7 +187,7 @@ end_options(svn_ra_serf__xml_parser_t *p
{
options_ctx->collect_cdata = FALSE;
options_ctx->activity_collection =
- svn_urlpath__canonicalize(options_ctx->attr_val, options_ctx->pool);
+ svn_urlpath__canonicalize(options_ctx->acbuf->data, options_ctx->pool);
pop_state(options_ctx);
}
@@ -201,11 +201,9 @@ cdata_options(svn_ra_serf__xml_parser_t
apr_size_t len)
{
svn_ra_serf__options_context_t *ctx = userData;
+
if (ctx->collect_cdata)
- {
- svn_ra_serf__expand_string(&ctx->attr_val, &ctx->attr_val_len,
- data, len, ctx->pool);
- }
+ svn_stringbuf_appendbytes(ctx->acbuf, data, len);
return SVN_NO_ERROR;
}
@@ -448,6 +446,8 @@ svn_ra_serf__create_options_req(svn_ra_s
new_ctx->pool = pool;
+ new_ctx->acbuf = svn_stringbuf_create_empty(pool);
+
new_ctx->path = path;
new_ctx->youngest_rev = SVN_INVALID_REVNUM;
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/property.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/property.c Wed Mar 21 02:38:58 2012
@@ -33,6 +33,7 @@
#include "private/svn_dav_protocol.h"
#include "private/svn_fspath.h"
+#include "private/svn_string_private.h"
#include "svn_private_config.h"
#include "ra_serf.h"
@@ -51,11 +52,8 @@ typedef struct prop_info_t {
/* Current ns, attribute name, and value of the property we're parsing */
const char *ns;
-
const char *name;
-
- const char *val;
- apr_size_t val_len;
+ svn_stringbuf_t *value;
const char *encoding;
@@ -243,6 +241,7 @@ push_state(svn_ra_serf__xml_parser_t *pa
info = apr_pcalloc(parser->state->pool, sizeof(*info));
info->pool = parser->state->pool;
+ info->value = svn_stringbuf_create_empty(info->pool);
parser->state->private = info;
}
@@ -273,7 +272,7 @@ start_propfind(svn_ra_serf__xml_parser_t
{
info = push_state(parser, ctx, PROPVAL);
info->ns = name.namespace;
- info->name = apr_pstrdup(info->pool, name.name);
+ info->name = "href";
}
else if (state == RESPONSE && strcmp(name.name, "prop") == 0)
{
@@ -316,24 +315,20 @@ end_propfind(svn_ra_serf__xml_parser_t *
}
else if (state == PROPVAL)
{
- const char *ns, *pname, *val;
- svn_string_t *val_str;
+ const char *ns;
+ const char *pname;
+ const svn_string_t *val_str = NULL;
/* if we didn't see a CDATA element, we may want the tag name
* as long as it isn't equivalent to the property name.
*/
- if (!info->val)
+ /* ### gstein sez: I have no idea what this is about. */
+ if (*info->value->data == '\0')
{
if (strcmp(info->name, name.name) != 0)
- {
- info->val = name.name;
- info->val_len = strlen(info->val);
- }
+ val_str = svn_string_create(name.name, ctx->pool);
else
- {
- info->val = "";
- info->val_len = 0;
- }
+ val_str = svn_string_create_empty(ctx->pool);
}
if (parser->state->prev->current_state == RESPONSE &&
@@ -342,7 +337,7 @@ end_propfind(svn_ra_serf__xml_parser_t *
if (strcmp(ctx->depth, "1") == 0)
{
ctx->current_path =
- svn_urlpath__canonicalize(info->val, ctx->pool);
+ svn_urlpath__canonicalize(info->value->data, ctx->pool);
}
else
{
@@ -353,15 +348,10 @@ end_propfind(svn_ra_serf__xml_parser_t *
{
if (strcmp(info->encoding, "base64") == 0)
{
- svn_string_t encoded;
- const svn_string_t *decoded;
-
- encoded.data = info->val;
- encoded.len = info->val_len;
+ const svn_string_t *morph;
- decoded = svn_base64_decode_string(&encoded, parser->state->pool);
- info->val = decoded->data;
- info->val_len = decoded->len;
+ morph = svn_stringbuf__morph_into_string(info->value);
+ val_str = svn_base64_decode_string(morph, ctx->pool);
}
else
{
@@ -372,10 +362,13 @@ end_propfind(svn_ra_serf__xml_parser_t *
}
}
+ /* ### there may be better logic to ensure this is set above, but just
+ ### going for the easy win here. */
+ if (val_str == NULL)
+ val_str = svn_string_create_from_buf(info->value, ctx->pool);
+
ns = apr_pstrdup(ctx->pool, info->ns);
pname = apr_pstrdup(ctx->pool, info->name);
- val = apr_pmemdup(ctx->pool, info->val, info->val_len);
- val_str = svn_string_ncreate(val, info->val_len, ctx->pool);
/* set the return props and update our cache too. */
svn_ra_serf__set_ver_prop(ctx->ret_props,
@@ -410,10 +403,7 @@ cdata_propfind(svn_ra_serf__xml_parser_t
info = parser->state->private;
if (state == PROPVAL)
- {
- svn_ra_serf__expand_string(&info->val, &info->val_len, data, len,
- info->pool);
- }
+ svn_stringbuf_appendbytes(info->value, data, len);
return SVN_NO_ERROR;
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/ra_serf.h Wed Mar 21 02:38:58 2012
@@ -39,6 +39,7 @@
#include "svn_dirent_uri.h"
#include "private/svn_dav_protocol.h"
+#include "private/svn_subr_private.h"
#include "blncache.h"
@@ -70,6 +71,10 @@ typedef struct svn_ra_serf__connection_t
/* Our connection to a server. */
serf_connection_t *conn;
+ /* The server is not Apache/mod_dav_svn (directly) and only supports
+ HTTP/1.0. Thus, we cannot send chunked requests. */
+ svn_boolean_t http10;
+
/* Bucket allocator for this connection. */
serf_bucket_alloc_t *bkt_alloc;
@@ -1463,6 +1468,18 @@ svn_ra_serf__register_editor_shim_callba
svn_delta_shim_callbacks_t *callbacks);
+svn_error_t *
+svn_ra_serf__copy_into_spillbuf(svn_spillbuf_t **spillbuf,
+ serf_bucket_t *bkt,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+serf_bucket_t *
+svn_ra_serf__create_sb_bucket(svn_spillbuf_t *spillbuf,
+ serf_bucket_alloc_t *allocator,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/replay.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/replay.c Wed Mar 21 02:38:58 2012
@@ -40,6 +40,8 @@
#include "svn_path.h"
#include "svn_private_config.h"
+#include "private/svn_string_private.h"
+
#include "ra_serf.h"
@@ -83,8 +85,7 @@ typedef struct prop_info_t {
const char *name;
svn_boolean_t del_prop;
- const char *data;
- apr_size_t len;
+ svn_stringbuf_t *prop_value;
replay_info_t *parent;
} prop_info_t;
@@ -165,6 +166,7 @@ push_state(svn_ra_serf__xml_parser_t *pa
info->pool = replay_ctx->dst_rev_pool;
info->parent = parser->state->private;
+ info->prop_value = svn_stringbuf_create_empty(info->pool);
parser->state->private = info;
}
@@ -477,8 +479,6 @@ end_replay(svn_ra_serf__xml_parser_t *pa
replay_context_t *ctx = userData;
replay_state_e state;
- UNUSED_CTX(ctx);
-
state = parser->state->current_state;
if (state == REPORT &&
@@ -535,15 +535,14 @@ end_replay(svn_ra_serf__xml_parser_t *pa
}
else
{
- svn_string_t tmp_prop;
+ const svn_string_t *morph;
- tmp_prop.data = info->data;
- tmp_prop.len = info->len;
+ morph = svn_stringbuf__morph_into_string(info->prop_value);
if (strcmp(name.name, "change-file-prop") == 0)
- prop_val = svn_base64_decode_string(&tmp_prop, ctx->file_pool);
+ prop_val = svn_base64_decode_string(morph, ctx->file_pool);
else
- prop_val = svn_base64_decode_string(&tmp_prop, ctx->dst_rev_pool);
+ prop_val = svn_base64_decode_string(morph, ctx->dst_rev_pool);
}
SVN_ERR(info->change(info->parent->baton, info->name, prop_val,
@@ -584,8 +583,7 @@ cdata_replay(svn_ra_serf__xml_parser_t *
{
prop_info_t *info = parser->state->private;
- svn_ra_serf__expand_string(&info->data, &info->len,
- data, len, parser->state->pool);
+ svn_stringbuf_appendbytes(info->prop_value, data, len);
}
return SVN_NO_ERROR;
@@ -845,7 +843,26 @@ svn_ra_serf__replay_range(svn_ra_session
/* Run the serf loop, send outgoing and process incoming requests.
This request will block when there are no more requests to send or
- responses to receive, so we have to be careful on our bookkeeping. */
+ responses to receive, so we have to be careful on our bookkeeping.
+
+ ### we should probably adjust this timeout. if we get (say) 3
+ ### requests completed, then we want to exit immediately rather
+ ### than block for a few seconds. that will allow us to clear up
+ ### those 3 requests. if we have queued all of our revisions,
+ ### then we may want to block until timeout since we really don't
+ ### have much work other than destroying memory. (though that
+ ### is important, as we could end up with 50 src_rev_pool pools)
+
+ ### idea: when a revision is marked DONE, we can probably destroy
+ ### most of the memory. that will reduce pressue to have serf
+ ### return control to us, to complete the major memory disposal.
+
+ ### theoretically, we should use an iterpool here, but it turns
+ ### out that serf doesn't even use the pool param. if we grow
+ ### an iterpool in this loop for other purposes, then yeah: go
+ ### ahead and apply it here, too, in case serf eventually uses
+ ### that parameter.
+ */
status = serf_context_run(session->context, session->timeout,
pool);
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/serf.c Wed Mar 21 02:38:58 2012
@@ -397,16 +397,16 @@ svn_ra_serf__open(svn_ra_session_t *sess
serf_sess->conns[0] = apr_pcalloc(serf_sess->pool,
sizeof(*serf_sess->conns[0]));
+ serf_sess->conns[0]->http10 = TRUE; /* until we confirm HTTP/1.1 */
+ serf_sess->conns[0]->http10 = FALSE; /* ### don't change behavior yet */
serf_sess->conns[0]->bkt_alloc =
serf_bucket_allocator_create(serf_sess->pool, NULL, NULL);
serf_sess->conns[0]->session = serf_sess;
serf_sess->conns[0]->last_status_code = -1;
serf_sess->conns[0]->using_ssl = serf_sess->using_ssl;
- serf_sess->conns[0]->server_cert_failures = 0;
serf_sess->conns[0]->using_compression = serf_sess->using_compression;
serf_sess->conns[0]->hostname = url.hostname;
- serf_sess->conns[0]->useragent = NULL;
/* create the user agent string */
if (callbacks->get_client_string)
@@ -1197,6 +1197,7 @@ svn_ra_serf__init(const svn_version_t *l
|| serf_minor < SERF_MINOR_VERSION)
{
return svn_error_createf(
+ /* ### should return a unique error */
SVN_ERR_VERSION_MISMATCH, NULL,
_("ra_serf was compiled for serf %d.%d.%d but loaded "
"an incompatible %d.%d.%d library"),
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/update.c Wed Mar 21 02:38:58 2012
@@ -2226,16 +2226,17 @@ open_connection_if_needed(svn_ra_serf__s
int cur = sess->num_conns;
apr_status_t status;
- sess->conns[cur] = apr_palloc(sess->pool, sizeof(*sess->conns[cur]));
+ sess->conns[cur] = apr_pcalloc(sess->pool, sizeof(*sess->conns[cur]));
+ sess->conns[cur]->http10 = TRUE; /* until we confirm HTTP/1.1 */
+ sess->conns[cur]->http10 = FALSE; /* ### don't change behavior yet */
sess->conns[cur]->bkt_alloc = serf_bucket_allocator_create(sess->pool,
NULL, NULL);
sess->conns[cur]->hostname = sess->conns[0]->hostname;
sess->conns[cur]->using_ssl = sess->conns[0]->using_ssl;
sess->conns[cur]->using_compression = sess->conns[0]->using_compression;
- sess->conns[cur]->useragent = sess->conns[0]->useragent;
sess->conns[cur]->last_status_code = -1;
- sess->conns[cur]->ssl_context = NULL;
sess->conns[cur]->session = sess;
+ sess->conns[cur]->useragent = sess->conns[0]->useragent;
status = serf_connection_create2(&sess->conns[cur]->conn,
sess->context,
sess->session_url,
Modified: subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_ra_serf/util.c Wed Mar 21 02:38:58 2012
@@ -103,75 +103,7 @@ struct svn_ra_serf__pending_t {
into a temporary file. */
#define SPILL_SIZE 1000000
-/* See notes/ra-serf-testing.txt for some information on testing this
- new "paused" feature (aka network pushback).
- Define PBTEST_ACTIVE, if you would like to run the pushback tests. */
-#undef PBTEST_ACTIVE
-#ifdef PBTEST_ACTIVE
-
-static int pbtest_step = 0;
-
-/* Note: this cannot resolve states 5 and 7. */
-#define PBTEST_STATE(p) \
- ((p) == NULL ? 1 \
- : ((p)->spill == NULL ? ((p)->head == NULL ? 2 : 3) \
- : ((p)->head == NULL ? 6 : 4)))
-
-/* Note: INJECT and COMPLETED are only used for debug output. */
-typedef struct {
- svn_boolean_t paused; /* pause the parser on this step? */
- svn_boolean_t inject; /* inject pending content on this step? */
- int when_next; /* when to move to the next step? */
- const char *completed; /* what test was completed? */
-} pbtest_desc_t;
-
-static const pbtest_desc_t pbtest_description[] = {
- { 0 }, /* unused */
- { TRUE, FALSE, 3, "1.1" },
- { TRUE, FALSE, 3, "1.3" },
- { FALSE, FALSE, 3, "2.3" },
- { FALSE, TRUE, 2, "3.3" }, /* WHEN_NEXT is ignored due to INJECT */
- { TRUE, FALSE, 3, "1.2" },
- { TRUE, FALSE, 4, NULL },
- { TRUE, FALSE, 4, "1.4" },
- { FALSE, FALSE, 4, "2.4" },
- { FALSE, TRUE, 6, "3.4" }, /* WHEN_NEXT is ignored due to INJECT */
- { TRUE, FALSE, 6, "1.6" },
- { FALSE, FALSE, 6, "2.6" },
- { FALSE, TRUE, 7, "3.6" }, /* WHEN_NEXT is ignored due to INJECT */
- { TRUE, FALSE, 6, "1.7" },
- { 0 } /* unused */
-};
-
-#define PBTEST_SET_PAUSED(ctx) \
- (PBTEST_THIS_REQ(ctx) && pbtest_step < 14 \
- ? (ctx)->paused = pbtest_description[pbtest_step].paused \
- : FALSE)
-
-#define PBTEST_MAYBE_STEP(ctx, force) maybe_next_step(ctx, force)
-
-#define PBTEST_FORCE_SPILL(ctx) (PBTEST_THIS_REQ(ctx) && pbtest_step == 6)
-
-#define PBTEST_THIS_REQ(ctx) \
- ((ctx)->response_type != NULL \
- && strcmp((ctx)->response_type, "update-report") == 0)
-
-#else /* PBTEST_ACTIVE */
-
-/* Be wary with the definition of these macros so that we don't
- end up with "statement with no effect" warnings. Obviously, this
- depends upon particular usage, which is easy to verify. */
-#define PBTEST_SET_PAUSED(ctx) /* empty */
-#define PBTEST_MAYBE_STEP(ctx, force) /* empty */
-
-#define PBTEST_FORCE_SPILL(ctx) FALSE
-#define PBTEST_THIS_REQ(ctx) FALSE
-
-#endif /* PBTEST_ACTIVE */
-
-
-
static const apr_uint32_t serf_failure_map[][2] =
{
{ SERF_SSL_CERT_NOTYETVALID, SVN_AUTH_SSL_NOTYETVALID },
@@ -706,13 +638,50 @@ svn_ra_serf__setup_serf_req(serf_request
const char *method, const char *url,
serf_bucket_t *body_bkt, const char *content_type)
{
+ serf_bucket_alloc_t *allocator = serf_request_get_alloc(request);
serf_bucket_t *hdrs_bkt;
+#if SERF_VERSION_AT_LEAST(1, 1, 0)
+ svn_spillbuf_t *buf;
+
+ /* ### this should be passed */
+ apr_pool_t *scratch_pool = conn->session->pool;
+
+ if (conn->http10 && body_bkt != NULL)
+ {
+ /* Ugh. Use HTTP/1.0 to talk to the server because we don't know if
+ it speaks HTTP/1.1 (and thus, chunked requests), or because the
+ server actually responded as only supporting HTTP/1.0.
+
+ We'll take the existing body_bkt, spool it into a spillbuf, and
+ then wrap a bucket around that spillbuf. The spillbuf will give
+ us the Content-Length value. */
+ SVN_ERR(svn_ra_serf__copy_into_spillbuf(&buf, body_bkt,
+ conn->session->pool,
+ scratch_pool));
+ body_bkt = svn_ra_serf__create_sb_bucket(buf, allocator,
+ conn->session->pool,
+ scratch_pool);
+ }
+#endif
+
/* Create a request bucket. Note that this sucker is kind enough to
add a "Host" header for us. */
*req_bkt =
serf_request_bucket_request_create(request, method, url, body_bkt,
- serf_request_get_alloc(request));
+ allocator);
+
+ /* Set the Content-Length value. This will also trigger an HTTP/1.0
+ request (rather than the default chunked request). */
+#if SERF_VERSION_AT_LEAST(1, 1, 0)
+ if (conn->http10)
+ {
+ if (body_bkt == NULL)
+ serf_bucket_request_set_CL(*req_bkt, 0);
+ else
+ serf_bucket_request_set_CL(*req_bkt, svn_spillbuf__get_size(buf));
+ }
+#endif
hdrs_bkt = serf_bucket_request_get_headers(*req_bkt);
serf_bucket_headers_setn(hdrs_bkt, "User-Agent", conn->useragent);
@@ -1319,54 +1288,6 @@ add_done_item(svn_ra_serf__xml_parser_t
}
-#ifdef PBTEST_ACTIVE
-
-/* Determine whether we should move to the next step. Print out the
- transition for debugging purposes. If FORCE is TRUE, then we
- definitely make a step (injection has completed). */
-static void
-maybe_next_step(svn_ra_serf__xml_parser_t *parser, svn_boolean_t force)
-{
- const pbtest_desc_t *desc;
- int state;
-
- /* This would fail the state transition, but for clarity... just return
- when the testing has completed. */
- if (pbtest_step == 14)
- return;
-
- /* If this is not the request running the test, then exit. */
- if (!PBTEST_THIS_REQ(parser))
- return;
-
- desc = &pbtest_description[pbtest_step];
- state = PBTEST_STATE(parser->pending);
-
- /* Forced? ... or reached target state? */
- if (force || state == desc->when_next)
- {
- ++pbtest_step;
-
- if (desc->completed != NULL)
- SVN_DBG(("PBTEST: completed TEST %s\n", desc->completed));
-
- /* Pause the parser based on the new step's config. */
- ++desc;
- parser->paused = desc->paused;
-
- SVN_DBG(("PBTEST: advanced: step=%d paused=%d inject=%d state=%d\n",
- pbtest_step, desc->paused, desc->inject, state));
- }
- else
- {
- SVN_DBG(("PBTEST: step[%d]: state=%d waiting_for=%d\n",
- pbtest_step, state, desc->when_next));
- }
-}
-
-#endif /* PBTEST_ACTIVE */
-
-
/* Get a buffer from the parsing context. It will come from the free list,
or allocated as necessary. */
static struct pending_buffer_t *
@@ -1410,18 +1331,10 @@ write_to_pending(svn_ra_serf__xml_parser
/* We do not (yet) have a spill file, but the amount stored in memory
has grown too large. Create the file and place the pending data into
- the temporary file.
-
- For testing purposes, there are points when we may want to
- create the spill file, regardless. */
- if (PBTEST_FORCE_SPILL(ctx)
- || (ctx->pending->spill == NULL
- && ctx->pending->memory_size > SPILL_SIZE))
- {
-#ifdef PBTEST_ACTIVE
- /* Only allow a spill file for steps 6 or later. */
- if (!PBTEST_THIS_REQ(ctx) || pbtest_step >= 6)
-#endif
+ the temporary file. */
+ if (ctx->pending->spill == NULL
+ && ctx->pending->memory_size > SPILL_SIZE)
+ {
SVN_ERR(svn_io_open_unique_file3(&ctx->pending->spill,
NULL /* temp_path */,
NULL /* dirpath */,
@@ -1496,10 +1409,6 @@ inject_to_parser(svn_ra_serf__xml_parser
if (ctx->error && !ctx->ignore_errors)
return svn_error_trace(ctx->error);
- /* We may want to ignore the callbacks choice for the PAUSED flag.
- Set this value, as appropriate. */
- PBTEST_SET_PAUSED(ctx);
-
return SVN_NO_ERROR;
}
@@ -1527,19 +1436,6 @@ svn_ra_serf__process_pending(svn_ra_serf
svn_error_t *err;
apr_off_t output_unused;
- /* We may need to repair the PAUSED state when testing. */
- PBTEST_SET_PAUSED(parser);
-
-#ifdef PBTEST_ACTIVE
- /* If this step should not inject content, then fast-path exit. */
- if (PBTEST_THIS_REQ(parser)
- && pbtest_step < 14 && !pbtest_description[pbtest_step].inject)
- {
- SVN_DBG(("PBTEST: process: injection disabled\n"));
- return SVN_NO_ERROR;
- }
-#endif
-
/* Fast path exit: already paused, nothing to do, or already done. */
if (parser->paused || parser->pending == NULL || *parser->done)
return SVN_NO_ERROR;
@@ -1577,18 +1473,6 @@ svn_ra_serf__process_pending(svn_ra_serf
return SVN_NO_ERROR;
}
-#ifdef PBTEST_ACTIVE
- /* For steps 4 and 9, we wait until all of the memory content has been
- injected. At that point, we can take another step which will pause
- the parser, and we'll need to exit. */
- if (PBTEST_THIS_REQ(parser)
- && (pbtest_step == 4 || pbtest_step == 9))
- {
- PBTEST_MAYBE_STEP(parser, TRUE);
- return SVN_NO_ERROR;
- }
-#endif
-
/* If we don't have a spill file, then we've exhausted all
pending content. */
if (parser->pending->spill == NULL)
@@ -1643,11 +1527,6 @@ svn_ra_serf__process_pending(svn_ra_serf
the network, then we're completely done with the parsing. */
if (parser->pending->network_eof)
{
-#ifdef PBTEST_ACTIVE
- if (PBTEST_THIS_REQ(parser))
- SVN_DBG(("process: terminating parse.\n"));
-#endif
-
SVN_ERR_ASSERT(parser->xmlp != NULL);
/* Tell the parser that no more content will be parsed. Ignore the
@@ -1659,10 +1538,6 @@ svn_ra_serf__process_pending(svn_ra_serf
add_done_item(parser);
}
- /* For testing step 12, we have written all of the disk content. This
- will advance to step 13 and pause the parser again. */
- PBTEST_MAYBE_STEP(parser, TRUE);
-
return SVN_NO_ERROR;
}
@@ -1738,13 +1613,6 @@ svn_ra_serf__handle_xml_parser(serf_requ
{
XML_SetCharacterDataHandler(ctx->xmlp, cdata_xml);
}
-
- /* This is the first invocation. If we're looking at an update
- report, then move to step 1 of the testing sequence. */
-#ifdef PBTEST_ACTIVE
- if (PBTEST_THIS_REQ(ctx))
- PBTEST_MAYBE_STEP(ctx, TRUE);
-#endif
}
/* If we are storing content into a spill file, then move to the end of
@@ -1800,24 +1668,6 @@ svn_ra_serf__handle_xml_parser(serf_requ
ctx->skip_size = 0;
}
- /* Ensure that the parser's PAUSED state is correct before we test
- the flag. */
- PBTEST_SET_PAUSED(ctx);
-
-#ifdef PBTEST_ACTIVE
- if (PBTEST_THIS_REQ(ctx))
- {
- SVN_DBG(("response: len=%d paused=%d status=%08x\n",
- (int)len, ctx->paused, status));
-#if 0
- /* ### DATA is not necessarily NUL-terminated, but this
- ### generally works. so if you want to see content... */
- if (len > 0)
- SVN_DBG(("content=%s\n", data));
-#endif
- }
-#endif
-
/* Note: once the callbacks invoked by inject_to_parser() sets the
PAUSED flag, then it will not be cleared. write_to_pending() will
only save the content. Logic outside of serf_context_run() will
@@ -1830,13 +1680,6 @@ svn_ra_serf__handle_xml_parser(serf_requ
if (ctx->paused || HAS_PENDING_DATA(ctx->pending))
{
err = write_to_pending(ctx, data, len, pool);
-
- /* We may have a transition to a next step.
-
- Note: this only happens on writing to PENDING. If the
- parser is unpaused, then we will never change state within
- this network-reading loop. */
- PBTEST_MAYBE_STEP(ctx, FALSE);
}
else
{
@@ -1866,20 +1709,10 @@ svn_ra_serf__handle_xml_parser(serf_requ
if (ctx->pending != NULL)
ctx->pending->network_eof = TRUE;
-#ifdef PBTEST_ACTIVE
- if (PBTEST_THIS_REQ(ctx))
- SVN_DBG(("network: reached EOF.\n"));
-#endif
-
/* We just hit the end of the network content. If we have nothing
in the PENDING structures, then we're completely done. */
if (!HAS_PENDING_DATA(ctx->pending))
{
-#ifdef PBTEST_ACTIVE
- if (PBTEST_THIS_REQ(ctx))
- SVN_DBG(("network: terminating parse.\n"));
-#endif
-
SVN_ERR_ASSERT(ctx->xmlp != NULL);
/* Ignore the return status. We just don't care. */
Modified: subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_repos/fs-wrap.c Wed Mar 21 02:38:58 2012
@@ -162,7 +162,7 @@ svn_repos__validate_prop(const char *nam
const svn_string_t *value,
apr_pool_t *pool)
{
- svn_prop_kind_t kind = svn_property_kind(NULL, name);
+ svn_prop_kind_t kind = svn_property_kind2(name);
/* Disallow setting non-regular properties. */
if (kind != svn_prop_regular_kind)
Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/properties.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/properties.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/properties.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/properties.c Wed Mar 21 02:38:58 2012
@@ -62,31 +62,42 @@ svn_prop_has_svn_prop(const apr_hash_t *
}
+#define SIZEOF_WC_PREFIX (sizeof(SVN_PROP_WC_PREFIX) - 1)
+#define SIZEOF_ENTRY_PREFIX (sizeof(SVN_PROP_ENTRY_PREFIX) - 1)
+
+svn_prop_kind_t
+svn_property_kind2(const char *prop_name)
+{
+
+ if (strncmp(prop_name, SVN_PROP_WC_PREFIX, SIZEOF_WC_PREFIX) == 0)
+ return svn_prop_wc_kind;
+
+ if (strncmp(prop_name, SVN_PROP_ENTRY_PREFIX, SIZEOF_ENTRY_PREFIX) == 0)
+ return svn_prop_entry_kind;
+
+ return svn_prop_regular_kind;
+}
+
+
+/* NOTE: this function is deprecated, but we cannot move it to deprecated.c
+ because we need the SIZEOF_*_PREFIX constant symbols defined above. */
svn_prop_kind_t
svn_property_kind(int *prefix_len,
const char *prop_name)
{
- apr_size_t wc_prefix_len = sizeof(SVN_PROP_WC_PREFIX) - 1;
- apr_size_t entry_prefix_len = sizeof(SVN_PROP_ENTRY_PREFIX) - 1;
+ svn_prop_kind_t kind = svn_property_kind2(prop_name);
- if (strncmp(prop_name, SVN_PROP_WC_PREFIX, wc_prefix_len) == 0)
- {
- if (prefix_len)
- *prefix_len = (int) wc_prefix_len;
- return svn_prop_wc_kind;
- }
-
- if (strncmp(prop_name, SVN_PROP_ENTRY_PREFIX, entry_prefix_len) == 0)
+ if (prefix_len)
{
- if (prefix_len)
- *prefix_len = (int) entry_prefix_len;
- return svn_prop_entry_kind;
+ if (kind == svn_prop_wc_kind)
+ *prefix_len = SIZEOF_WC_PREFIX;
+ else if (kind == svn_prop_entry_kind)
+ *prefix_len = SIZEOF_ENTRY_PREFIX;
+ else
+ *prefix_len = 0;
}
- /* else... */
- if (prefix_len)
- *prefix_len = 0;
- return svn_prop_regular_kind;
+ return kind;
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/spillbuf.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/spillbuf.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/spillbuf.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/spillbuf.c Wed Mar 21 02:38:58 2012
@@ -579,7 +579,8 @@ write_handler_spillbuf(void *baton, cons
{
struct spillbuf_baton *sb = baton;
- SVN_ERR(svn_spillbuf__reader_write(sb->reader, data, *len, sb->scratch_pool));
+ SVN_ERR(svn_spillbuf__reader_write(sb->reader, data, *len,
+ sb->scratch_pool));
svn_pool_clear(sb->scratch_pool);
return SVN_NO_ERROR;
@@ -592,7 +593,7 @@ svn_stream__from_spillbuf(apr_size_t blo
apr_pool_t *result_pool)
{
svn_stream_t *stream;
- struct spillbuf_baton *sb = apr_pcalloc(result_pool, sizeof(*sb));
+ struct spillbuf_baton *sb = apr_palloc(result_pool, sizeof(*sb));
sb->reader = svn_spillbuf__reader_create(blocksize, maxsize, result_pool);
sb->scratch_pool = svn_pool_create(result_pool);
@@ -602,6 +603,5 @@ svn_stream__from_spillbuf(apr_size_t blo
svn_stream_set_read(stream, read_handler_spillbuf);
svn_stream_set_write(stream, write_handler_spillbuf);
-
return stream;
}
Modified: subversion/branches/inheritable-props/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_subr/svn_string.c?rev=1303257&r1=1303256&r2=1303257&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_subr/svn_string.c Wed Mar 21 02:38:58 2012
@@ -259,8 +259,8 @@ svn_stringbuf__morph_into_string(svn_str
#endif
/* Both, svn_string_t and svn_stringbuf_t are public API structures
- * since a couple of releases now. Thus, we can rely on their precise
- * layout not to change.
+ * since the svn epoch. Thus, we can rely on their precise layout not
+ * to change.
*
* It just so happens that svn_string_t is structurally equivalent
* to the (data, len) sub-set of svn_stringbuf_t. There is also no