You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/02/21 21:40:50 UTC
svn commit: r1073138 [3/9] - in /subversion/branches/ignore-mergeinfo-log:
./ build/ build/ac-macros/ build/generator/ build/generator/templates/
notes/ notes/wc-ng/ subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversio...
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/caching.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/caching.c Mon Feb 21 20:40:44 2011
@@ -24,138 +24,13 @@
#include "fs_fs.h"
#include "id.h"
#include "dag.h"
+#include "temp_serializer.h"
#include "../libsvn_fs/fs-loader.h"
#include "svn_config.h"
#include "svn_private_config.h"
-/*** Dup/serialize/deserialize functions. ***/
-
-
-/** Caching SVN_FS_ID_T values. **/
-/* Implements svn_cache__dup_func_t */
-static svn_error_t *
-dup_id(void **out,
- const void *in,
- apr_pool_t *pool)
-{
- const svn_fs_id_t *id = in;
- *out = svn_fs_fs__id_copy(id, pool);
- return SVN_NO_ERROR;
-}
-
-/* Implements svn_cache__serialize_func_t */
-static svn_error_t *
-serialize_id(char **data,
- apr_size_t *data_len,
- void *in,
- apr_pool_t *pool)
-{
- svn_fs_id_t *id = in;
- svn_string_t *id_str = svn_fs_fs__id_unparse(id, pool);
- *data = (char *) id_str->data;
- *data_len = id_str->len;
-
- return SVN_NO_ERROR;
-}
-
-
-/* Implements svn_cache__deserialize_func_t */
-static svn_error_t *
-deserialize_id(void **out,
- const char *data,
- apr_size_t data_len,
- apr_pool_t *pool)
-{
- svn_fs_id_t *id = svn_fs_fs__id_parse(data, data_len, pool);
- if (id == NULL)
- {
- return svn_error_create(SVN_ERR_FS_NOT_ID, NULL,
- _("Bad ID in cache"));
- }
-
- *out = id;
- return SVN_NO_ERROR;
-}
-
-
-/** Caching directory listings. **/
-/* Implements svn_cache__dup_func_t */
-static svn_error_t *
-dup_dir_listing(void **out,
- const void *in,
- apr_pool_t *pool)
-{
- apr_hash_t *new_entries = apr_hash_make(pool);
- apr_hash_t *entries = (void*)in; /* Cast away const only */
- apr_hash_index_t *hi;
-
- for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
- {
- svn_fs_dirent_t *dirent = svn__apr_hash_index_val(hi);
- svn_fs_dirent_t *new_dirent;
-
- new_dirent = apr_palloc(pool, sizeof(*new_dirent));
- new_dirent->name = apr_pstrdup(pool, dirent->name);
- new_dirent->kind = dirent->kind;
- new_dirent->id = svn_fs_fs__id_copy(dirent->id, pool);
- apr_hash_set(new_entries, new_dirent->name, APR_HASH_KEY_STRING,
- new_dirent);
- }
-
- *out = new_entries;
- return SVN_NO_ERROR;
-}
-
-
-/** Caching packed rev offsets. **/
-/* Implements svn_cache__serialize_func_t */
-static svn_error_t *
-manifest_serialize(char **data,
- apr_size_t *data_len,
- void *in,
- apr_pool_t *pool)
-{
- apr_array_header_t *manifest = in;
-
- *data_len = sizeof(apr_off_t) * manifest->nelts;
- *data = apr_palloc(pool, *data_len);
- memcpy(*data, manifest->elts, *data_len);
-
- return SVN_NO_ERROR;
-}
-
-/* Implements svn_cache__deserialize_func_t */
-static svn_error_t *
-manifest_deserialize(void **out,
- const char *data,
- apr_size_t data_len,
- apr_pool_t *pool)
-{
- apr_array_header_t *manifest = apr_array_make(pool,
- (int) (data_len / sizeof(apr_off_t)),
- sizeof(apr_off_t));
- memcpy(manifest->elts, data, data_len);
- manifest->nelts = (int) (data_len / sizeof(apr_off_t));
- *out = manifest;
-
- return SVN_NO_ERROR;
-}
-
-/* Implements svn_cache__dup_func_t */
-static svn_error_t *
-dup_pack_manifest(void **out,
- const void *in,
- apr_pool_t *pool)
-{
- const apr_array_header_t *manifest = in;
-
- *out = apr_array_copy(pool, manifest);
- return SVN_NO_ERROR;
-}
-
-
/* Return a memcache in *MEMCACHE_P for FS if it's configured to use
memcached, or NULL otherwise. Also, sets *FAIL_STOP to a boolean
indicating whether cache errors should be returned to the caller or
@@ -212,38 +87,41 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
* id_private_t + 3 strings for value, and the cache_entry); the
* default pool size is 8192, so about a hundred should fit
* comfortably. */
- if (memcache)
- SVN_ERR(svn_cache__create_memcache(&(ffd->rev_root_id_cache),
- memcache,
- serialize_id,
- deserialize_id,
- sizeof(svn_revnum_t),
- apr_pstrcat(pool, prefix, "RRI",
- (char *)NULL),
- fs->pool));
+ if (svn_fs__get_global_membuffer_cache())
+ SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->rev_root_id_cache),
+ svn_fs__get_global_membuffer_cache(),
+ svn_fs_fs__serialize_id,
+ svn_fs_fs__deserialize_id,
+ sizeof(svn_revnum_t),
+ apr_pstrcat(pool, prefix, "RRI",
+ (char *)NULL),
+ fs->pool));
else
- SVN_ERR(svn_cache__create_inprocess(&(ffd->rev_root_id_cache),
- dup_id, sizeof(svn_revnum_t),
- 1, 100, FALSE, fs->pool));
+ SVN_ERR(svn_cache__create_inprocess(&(ffd->rev_root_id_cache),
+ svn_fs_fs__serialize_id,
+ svn_fs_fs__deserialize_id,
+ sizeof(svn_revnum_t),
+ 1, 100, FALSE, fs->pool));
if (! no_handler)
- SVN_ERR(svn_cache__set_error_handler(ffd->rev_root_id_cache,
- warn_on_cache_errors, fs, pool));
+ SVN_ERR(svn_cache__set_error_handler(ffd->rev_root_id_cache,
+ warn_on_cache_errors, fs, pool));
/* Rough estimate: revision DAG nodes have size around 320 bytes, so
* let's put 16 on a page. */
- if (memcache)
- SVN_ERR(svn_cache__create_memcache(&(ffd->rev_node_cache),
- memcache,
- svn_fs_fs__dag_serialize,
- svn_fs_fs__dag_deserialize,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool, prefix, "DAG",
- (char *)NULL),
- fs->pool));
+ if (svn_fs__get_global_membuffer_cache())
+ SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->rev_node_cache),
+ svn_fs__get_global_membuffer_cache(),
+ svn_fs_fs__dag_serialize,
+ svn_fs_fs__dag_deserialize,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "DAG",
+ (char *)NULL),
+ fs->pool));
else
SVN_ERR(svn_cache__create_inprocess(&(ffd->rev_node_cache),
- svn_fs_fs__dag_dup_for_cache,
+ svn_fs_fs__dag_serialize,
+ svn_fs_fs__dag_deserialize,
APR_HASH_KEY_STRING,
1024, 16, FALSE, fs->pool));
if (! no_handler)
@@ -252,18 +130,20 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
/* Very rough estimate: 1K per directory. */
- if (memcache)
- SVN_ERR(svn_cache__create_memcache(&(ffd->dir_cache),
- memcache,
- svn_fs_fs__dir_entries_serialize,
- svn_fs_fs__dir_entries_deserialize,
- APR_HASH_KEY_STRING,
- apr_pstrcat(pool, prefix, "DIR",
- (char *)NULL),
- fs->pool));
+ if (svn_fs__get_global_membuffer_cache())
+ SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->dir_cache),
+ svn_fs__get_global_membuffer_cache(),
+ svn_fs_fs__serialize_dir_entries,
+ svn_fs_fs__deserialize_dir_entries,
+ APR_HASH_KEY_STRING,
+ apr_pstrcat(pool, prefix, "DIR",
+ (char *)NULL),
+ fs->pool));
else
SVN_ERR(svn_cache__create_inprocess(&(ffd->dir_cache),
- dup_dir_listing, APR_HASH_KEY_STRING,
+ svn_fs_fs__serialize_dir_entries,
+ svn_fs_fs__deserialize_dir_entries,
+ APR_HASH_KEY_STRING,
1024, 8, FALSE, fs->pool));
if (! no_handler)
@@ -272,24 +152,27 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
/* Only 16 bytes per entry (a revision number + the corresponding offset).
Since we want ~8k pages, that means 512 entries per page. */
- if (memcache)
- SVN_ERR(svn_cache__create_memcache(&(ffd->packed_offset_cache),
- memcache,
- manifest_serialize,
- manifest_deserialize,
- sizeof(svn_revnum_t),
- apr_pstrcat(pool, prefix, "PACK-MANIFEST",
- (char *)NULL),
- fs->pool));
+ if (svn_fs__get_global_membuffer_cache())
+ SVN_ERR(svn_cache__create_membuffer_cache(&(ffd->packed_offset_cache),
+ svn_fs__get_global_membuffer_cache(),
+ svn_fs_fs__serialize_manifest,
+ svn_fs_fs__deserialize_manifest,
+ sizeof(svn_revnum_t),
+ apr_pstrcat(pool, prefix, "PACK-MANIFEST",
+ (char *)NULL),
+ fs->pool));
else
SVN_ERR(svn_cache__create_inprocess(&(ffd->packed_offset_cache),
- dup_pack_manifest, sizeof(svn_revnum_t),
+ svn_fs_fs__serialize_manifest,
+ svn_fs_fs__deserialize_manifest,
+ sizeof(svn_revnum_t),
32, 1, FALSE, fs->pool));
if (! no_handler)
SVN_ERR(svn_cache__set_error_handler(ffd->packed_offset_cache,
warn_on_cache_errors, fs, pool));
+ /* initialize fulltext cache as configured */
if (memcache)
{
SVN_ERR(svn_cache__create_memcache(&(ffd->fulltext_cache),
@@ -310,7 +193,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
NULL, NULL,
APR_HASH_KEY_STRING,
apr_pstrcat(pool, prefix, "TEXT",
- NULL),
+ (char *)NULL),
fs->pool));
}
else
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/dag.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/dag.c Mon Feb 21 20:40:44 2011
@@ -38,6 +38,8 @@
#include "private/svn_fspath.h"
#include "svn_private_config.h"
+#include "private/svn_temp_serializer.h"
+#include "temp_serializer.h"
/* Initializing a filesystem. */
@@ -1022,16 +1024,9 @@ svn_fs_fs__dag_finalize_edits(dag_node_t
SVN_ERR(svn_fs_fs__dag_file_checksum(&file_checksum, file,
checksum->kind, pool));
if (!svn_checksum_match(checksum, file_checksum))
- return svn_error_createf(SVN_ERR_CHECKSUM_MISMATCH, NULL,
- apr_psprintf(pool, "%s:\n%s\n%s\n",
- _("Checksum mismatch for '%s'"),
- _(" expected: %s"),
- _(" actual: %s")),
- file->created_path,
- svn_checksum_to_cstring_display(checksum,
- pool),
- svn_checksum_to_cstring_display(file_checksum,
- pool));
+ return svn_checksum_mismatch_err(checksum, file_checksum, pool,
+ _("Checksum mismatch for '%s'"),
+ file->created_path);
}
return SVN_NO_ERROR;
@@ -1063,59 +1058,38 @@ svn_fs_fs__dag_dup(const dag_node_t *nod
}
svn_error_t *
-svn_fs_fs__dag_dup_for_cache(void **out,
- const void *in,
- apr_pool_t *pool)
-{
- const dag_node_t *in_node = in;
- dag_node_t *out_node;
-
- out_node = svn_fs_fs__dag_dup(in_node, pool);
- out_node->fs = NULL;
- *out = out_node;
- return SVN_NO_ERROR;
-}
-
-/* The cache serialization format is:
- *
- * - For mutable nodes: the character 'M', then 'F' for files or 'D'
- * for directories, then the ID, then '\n', then the created path.
- *
- * - For immutable nodes: the character 'I' followed by the noderev
- * hash dump (the other fields can be reconstructed from this). (We
- * assume that, once constructed, immutable nodes always contain
- * their noderev.)
- */
-
-svn_error_t *
svn_fs_fs__dag_serialize(char **data,
apr_size_t *data_len,
void *in,
apr_pool_t *pool)
{
dag_node_t *node = in;
- svn_stringbuf_t *buf = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *serialized;
- if (svn_fs_fs__dag_check_mutable(node))
- {
- svn_stringbuf_appendcstr(buf, "M");
- svn_stringbuf_appendcstr(buf, (node->kind == svn_node_file ? "F" : "D"));
- svn_stringbuf_appendcstr(buf, svn_fs_fs__id_unparse(node->id,
- pool)->data);
- svn_stringbuf_appendcstr(buf, "\n");
- svn_stringbuf_appendcstr(buf, node->created_path);
- }
+ /* create an serialization context and serialize the dag node as root */
+ svn_temp_serializer__context_t *context =
+ svn_temp_serializer__init(node,
+ sizeof(*node),
+ 503,
+ pool);
+
+ /* for mutable nodes, we will _never_ cache the noderev */
+ if (node->node_revision && !svn_fs_fs__dag_check_mutable(node))
+ svn_fs_fs__noderev_serialize(context, &node->node_revision);
else
- {
- fs_fs_data_t *ffd = node->fs->fsap_data;
- svn_stringbuf_appendcstr(buf, "I");
- SVN_ERR(svn_fs_fs__write_noderev(svn_stream_from_stringbuf(buf, pool),
- node->node_revision, ffd->format,
- TRUE, pool));
- }
+ svn_temp_serializer__set_null(context,
+ (const void * const *)&node->node_revision);
+
+ /* serialize other sub-structures */
+ svn_fs_fs__id_serialize(context, (const svn_fs_id_t **)&node->id);
+ svn_fs_fs__id_serialize(context, &node->fresh_root_predecessor_id);
+ svn_temp_serializer__add_string(context, &node->created_path);
+
+ /* return serialized data */
+ serialized = svn_temp_serializer__get(context);
+ *data = serialized->data;
+ *data_len = serialized->len;
- *data = buf->data;
- *data_len = buf->len;
return SVN_NO_ERROR;
}
@@ -1125,74 +1099,23 @@ svn_fs_fs__dag_deserialize(void **out,
apr_size_t data_len,
apr_pool_t *pool)
{
- dag_node_t *node = apr_pcalloc(pool, sizeof(*node));
-
+ dag_node_t *node = (dag_node_t *)data;
if (data_len == 0)
return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
_("Empty noderev in cache"));
- if (*data == 'M')
- {
- const char *newline;
- size_t id_len;
-
- data++; data_len--;
- if (data_len == 0)
- return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
- _("Kindless noderev in cache"));
- if (*data == 'F')
- node->kind = svn_node_file;
- else if (*data == 'D')
- node->kind = svn_node_dir;
- else
- return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
- _("Unknown kind for noderev in cache: '%c'"),
- *data);
-
- data++; data_len--;
- newline = memchr(data, '\n', data_len);
- if (!newline)
- return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
- _("Unterminated ID in cache"));
- id_len = newline - 1 - data;
- node->id = svn_fs_fs__id_parse(data, id_len, pool);
- if (! node->id)
- return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
- _("Bogus ID '%s' in cache"),
- apr_pstrndup(pool, data, id_len));
-
- data += id_len; data_len -= id_len;
- data++; data_len--;
- if (data_len == 0)
- return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
- _("No created path"));
- node->created_path = apr_pstrndup(pool, data, data_len);
- }
- else if (*data == 'I')
- {
- node_revision_t *noderev;
- apr_pool_t *subpool = svn_pool_create(pool);
- svn_stream_t *stream =
- svn_stream_from_stringbuf(svn_stringbuf_ncreate(data + 1,
- data_len - 1,
- subpool),
- subpool);
- SVN_ERR(svn_fs_fs__read_noderev(&noderev, stream, pool));
- node->kind = noderev->kind;
- node->id = svn_fs_fs__id_copy(noderev->id, pool);
- node->created_path = apr_pstrdup(pool, noderev->created_path);
-
- if (noderev->is_fresh_txn_root)
- node->fresh_root_predecessor_id = noderev->predecessor_id;
+ /* Copy the _full_ buffer as it also contains the sub-structures. */
+ node->fs = NULL;
- node->node_revision = noderev;
+ /* fixup all references to sub-structures */
+ svn_fs_fs__id_deserialize(node, &node->id);
+ svn_fs_fs__id_deserialize(node,
+ (svn_fs_id_t **)&node->fresh_root_predecessor_id);
+ svn_fs_fs__noderev_deserialize(node, &node->node_revision);
- svn_pool_destroy(subpool);
- }
- else
- return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
- _("Unknown node type in cache: '%c'"), *data);
+ svn_temp_deserializer__resolve(node, (void**)&node->created_path);
+ /* return result */
*out = node;
return SVN_NO_ERROR;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/dag.h?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/dag.h Mon Feb 21 20:40:44 2011
@@ -78,13 +78,6 @@ dag_node_t *
svn_fs_fs__dag_dup(const dag_node_t *node,
apr_pool_t *pool);
-/* Like svn_fs_fs__dag_dup, but implementing the svn_cache__dup_func_t
- prototype, and NULLing the FS field. */
-svn_error_t *
-svn_fs_fs__dag_dup_for_cache(void **out,
- const void *in,
- apr_pool_t *pool);
-
/* Serialize a DAG node.
Implements svn_cache__serialize_func_t */
svn_error_t *
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/fs_fs.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/fs_fs.c Mon Feb 21 20:40:44 2011
@@ -1074,9 +1074,9 @@ read_config(svn_fs_t *fs,
{
fs_fs_data_t *ffd = fs->fsap_data;
- SVN_ERR(svn_config_read(&ffd->config,
- svn_dirent_join(fs->path, PATH_CONFIG, pool),
- FALSE, fs->pool));
+ SVN_ERR(svn_config_read2(&ffd->config,
+ svn_dirent_join(fs->path, PATH_CONFIG, pool),
+ FALSE, FALSE, fs->pool));
/* Initialize ffd->rep_sharing_allowed. */
if (ffd->format >= SVN_FS_FS__MIN_REP_SHARING_FORMAT)
@@ -3049,7 +3049,8 @@ create_rep_state_body(struct rep_state *
return SVN_NO_ERROR;
/* We are dealing with a delta, find out what version. */
- SVN_ERR(svn_io_file_read_full(rs->file, buf, sizeof(buf), NULL, pool));
+ SVN_ERR(svn_io_file_read_full2(rs->file, buf, sizeof(buf),
+ NULL, NULL, pool));
if (! ((buf[0] == 'S') && (buf[1] == 'V') && (buf[2] == 'N')))
return svn_error_create
(SVN_ERR_FS_CORRUPT, NULL,
@@ -3214,7 +3215,9 @@ rep_read_get_baton(struct rep_read_baton
b->filehandle_pool = svn_pool_create(pool);
if (fulltext_cache_key)
- b->current_fulltext = svn_stringbuf_create("", b->filehandle_pool);
+ b->current_fulltext = svn_stringbuf_create_ensure
+ ((apr_size_t)rep->expanded_size,
+ b->filehandle_pool);
else
b->current_fulltext = NULL;
@@ -3336,8 +3339,8 @@ get_contents(struct rep_read_baton *rb,
rs = rb->src_state;
if (((apr_off_t) copy_len) > rs->end - rs->off)
copy_len = (apr_size_t) (rs->end - rs->off);
- SVN_ERR(svn_io_file_read_full(rs->file, cur, copy_len, NULL,
- rb->pool));
+ SVN_ERR(svn_io_file_read_full2(rs->file, cur, copy_len, NULL,
+ NULL, rb->pool));
rs->off += copy_len;
*len = copy_len;
return SVN_NO_ERROR;
@@ -3412,9 +3415,9 @@ get_contents(struct rep_read_baton *rb,
SVN_ERR(svn_io_file_seek(rs->file, APR_SET, &rs->off,
rb->pool));
}
- SVN_ERR(svn_io_file_read_full(rs->file, sbuf,
- lwindow->sview_len,
- NULL, rb->pool));
+ SVN_ERR(svn_io_file_read_full2(rs->file, sbuf,
+ lwindow->sview_len,
+ NULL, NULL, rb->pool));
rs->off += lwindow->sview_len;
}
else
@@ -3494,14 +3497,11 @@ rep_read_contents(void *baton,
SVN_ERR(svn_checksum_final(&md5_checksum, rb->md5_checksum_ctx,
rb->pool));
if (!svn_checksum_match(md5_checksum, rb->md5_checksum))
- return svn_error_createf
- (SVN_ERR_FS_CORRUPT, NULL,
- apr_psprintf(rb->pool, "%s:\n%s\n%s\n",
- _("Checksum mismatch while reading representation"),
- _(" expected: %s"),
- _(" actual: %s")),
- svn_checksum_to_cstring_display(rb->md5_checksum, rb->pool),
- svn_checksum_to_cstring_display(md5_checksum, rb->pool));
+ return svn_error_create(SVN_ERR_FS_CORRUPT,
+ svn_checksum_mismatch_err(rb->md5_checksum, md5_checksum,
+ rb->pool,
+ _("Checksum mismatch while reading representation")),
+ NULL);
}
}
@@ -3748,26 +3748,6 @@ unparse_dir_entries(apr_hash_t **str_ent
}
-svn_error_t *
-svn_fs_fs__dir_entries_serialize(char **data,
- apr_size_t *data_len,
- void *in,
- apr_pool_t *pool)
-{
- apr_hash_t *entries = in;
- svn_stringbuf_t *buf = svn_stringbuf_create("", pool);
- svn_stream_t *stream = svn_stream_from_stringbuf(buf, pool);
-
- SVN_ERR(unparse_dir_entries(&entries, entries, pool));
- SVN_ERR(svn_hash_write2(entries, stream, SVN_HASH_TERMINATOR, pool));
-
- *data = buf->data;
- *data_len = buf->len;
-
- return SVN_NO_ERROR;
-}
-
-
/* Given a hash STR_ENTRIES with values as svn_string_t as specified
in an FSFS directory contents listing, return a hash of dirents in
*ENTRIES_P. Perform allocations in POOL. */
@@ -3824,24 +3804,6 @@ parse_dir_entries(apr_hash_t **entries_p
}
svn_error_t *
-svn_fs_fs__dir_entries_deserialize(void **out,
- const char *data,
- apr_size_t data_len,
- apr_pool_t *pool)
-{
- apr_hash_t *entries = apr_hash_make(pool);
- svn_stringbuf_t *buf = svn_stringbuf_ncreate(data, data_len, pool);
- svn_stream_t *stream = svn_stream_from_stringbuf(buf, pool);
-
- SVN_ERR(svn_hash_read2(entries, stream, SVN_HASH_TERMINATOR, pool));
- SVN_ERR(parse_dir_entries(&entries, entries, pool));
-
- *out = entries;
- return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
svn_fs_fs__rep_contents_dir(apr_hash_t **entries_p,
svn_fs_t *fs,
node_revision_t *noderev,
@@ -6697,8 +6659,8 @@ read_handler_recover(void *baton, char *
bytes_to_read = b->remaining;
b->remaining -= bytes_to_read;
- return svn_io_file_read_full(b->file, buffer, (apr_size_t) bytes_to_read,
- len, b->pool);
+ return svn_io_file_read_full2(b->file, buffer, (apr_size_t) bytes_to_read,
+ len, NULL, b->pool);
}
/* Part of the recovery procedure. Read the directory noderev at offset
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/fs_fs.h?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/fs_fs.h Mon Feb 21 20:40:44 2011
@@ -99,22 +99,6 @@ svn_error_t *svn_fs_fs__rev_get_root(svn
svn_revnum_t rev,
apr_pool_t *pool);
-/* Serialize a directory contents hash.
- Implements svn_cache__serialize_func_t */
-svn_error_t *
-svn_fs_fs__dir_entries_serialize(char **data,
- apr_size_t *data_len,
- void *in,
- apr_pool_t *pool);
-
-/* Deserialize a directory contents hash.
- Implements svn_cache__deserialize_func_t */
-svn_error_t *
-svn_fs_fs__dir_entries_deserialize(void **out,
- const char *data,
- apr_size_t data_len,
- apr_pool_t *pool);
-
/* Set *ENTRIES to an apr_hash_t of dirent structs that contain the
directory entries of node-revision NODEREV in filesystem FS. The
returned table (and its keys and values) is allocated in POOL,
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/id.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/id.c Mon Feb 21 20:40:44 2011
@@ -25,7 +25,7 @@
#include "id.h"
#include "../libsvn_fs/fs-loader.h"
-
+#include "private/svn_temp_serializer.h"
typedef struct id_private_t {
@@ -187,6 +187,7 @@ svn_fs_fs__id_txn_create(const char *nod
pvt->txn_id = apr_pstrdup(pool, txn_id);
pvt->rev = SVN_INVALID_REVNUM;
pvt->offset = -1;
+
id->vtable = &id_vtable;
id->fsap_data = pvt;
return id;
@@ -208,6 +209,7 @@ svn_fs_fs__id_rev_create(const char *nod
pvt->txn_id = NULL;
pvt->rev = rev;
pvt->offset = offset;
+
id->vtable = &id_vtable;
id->fsap_data = pvt;
return id;
@@ -226,6 +228,7 @@ svn_fs_fs__id_copy(const svn_fs_id_t *id
new_pvt->txn_id = pvt->txn_id ? apr_pstrdup(pool, pvt->txn_id) : NULL;
new_pvt->rev = pvt->rev;
new_pvt->offset = pvt->offset;
+
new_id->vtable = &id_vtable;
new_id->fsap_data = new_pvt;
return new_id;
@@ -309,3 +312,88 @@ svn_fs_fs__id_parse(const char *data,
return id;
}
+
+/* (de-)serialization support */
+
+/* Serialization of the PVT sub-structure within the CONTEXT.
+ */
+static void
+serialize_id_private(svn_temp_serializer__context_t *context,
+ const id_private_t * const *pvt)
+{
+ const id_private_t *private = *pvt;
+
+ /* serialize the pvt data struct itself */
+ svn_temp_serializer__push(context,
+ (const void * const *)pvt,
+ sizeof(*private));
+
+ /* append the referenced strings */
+ svn_temp_serializer__add_string(context, &private->node_id);
+ svn_temp_serializer__add_string(context, &private->copy_id);
+ svn_temp_serializer__add_string(context, &private->txn_id);
+
+ /* return to caller's nesting level */
+ svn_temp_serializer__pop(context);
+}
+
+/* Serialize an ID within the serialization CONTECT.
+ */
+void
+svn_fs_fs__id_serialize(svn_temp_serializer__context_t *context,
+ const struct svn_fs_id_t * const *id)
+{
+ /* nothing to do for NULL ids */
+ if (*id == NULL)
+ return;
+
+ /* serialize the id data struct itself */
+ svn_temp_serializer__push(context,
+ (const void * const *)id,
+ sizeof(**id));
+
+ /* serialize the id_private_t data sub-struct */
+ serialize_id_private(context,
+ (const id_private_t * const *)&(*id)->fsap_data);
+
+ /* return to caller's nesting level */
+ svn_temp_serializer__pop(context);
+}
+
+/* Deserialization of the PVT sub-structure in BUFFER.
+ */
+static void
+deserialize_id_private(void *buffer, id_private_t **pvt)
+{
+ /* fixup the reference to the only sub-structure */
+ id_private_t *private;
+ svn_temp_deserializer__resolve(buffer, (void**)pvt);
+
+ /* fixup the sub-structure itself */
+ private = *pvt;
+ svn_temp_deserializer__resolve(private, (void**)&private->node_id);
+ svn_temp_deserializer__resolve(private, (void**)&private->copy_id);
+ svn_temp_deserializer__resolve(private, (void**)&private->txn_id);
+}
+
+/* Deserialize an ID inside the BUFFER.
+ */
+void
+svn_fs_fs__id_deserialize(void *buffer, svn_fs_id_t **id)
+{
+ /* The id maybe all what is in the whole buffer.
+ * Don't try to fixup the pointer in that case*/
+ if (*id != buffer)
+ svn_temp_deserializer__resolve(buffer, (void**)id);
+
+ /* no id, no sub-structure fixup necessary */
+ if (*id == NULL)
+ return;
+
+ /* the stored vtable is bogus at best -> set the right one */
+ (*id)->vtable = &id_vtable;
+
+ /* handle sub-structures */
+ deserialize_id_private(*id, (id_private_t **)&(*id)->fsap_data);
+}
+
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/id.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/id.h?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/id.h (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/id.h Mon Feb 21 20:40:44 2011
@@ -90,6 +90,25 @@ svn_fs_id_t *svn_fs_fs__id_parse(const c
apr_size_t len,
apr_pool_t *pool);
+
+/* (de-)serialization support*/
+
+struct svn_temp_serializer__context_t;
+
+/**
+ * Serialize an @a id within the serialization @a context.
+ */
+void
+svn_fs_fs__id_serialize(struct svn_temp_serializer__context_t *context,
+ const svn_fs_id_t * const *id);
+
+/**
+ * Deserialize an @a id within the @a buffer.
+ */
+void
+svn_fs_fs__id_deserialize(void *buffer,
+ svn_fs_id_t **id);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/tree.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_fs/tree.c Mon Feb 21 20:40:44 2011
@@ -2454,16 +2454,9 @@ apply_textdelta(void *baton, apr_pool_t
SVN_ERR(svn_fs_fs__dag_file_checksum(&checksum, tb->node,
tb->base_checksum->kind, pool));
if (!svn_checksum_match(tb->base_checksum, checksum))
- return svn_error_createf
- (SVN_ERR_CHECKSUM_MISMATCH,
- NULL,
- apr_psprintf(pool, "%s:\n%s\n%s\n",
- _("Base checksum mismatch on '%s'"),
- _(" expected: %s"),
- _(" actual: %s")),
- tb->path,
- svn_checksum_to_cstring_display(tb->base_checksum, pool),
- svn_checksum_to_cstring_display(checksum, pool));
+ return svn_checksum_mismatch_err(tb->base_checksum, checksum, pool,
+ _("Base checksum mismatch on '%s'"),
+ tb->path);
}
/* Make a readable "source" stream out of the current contents of
@@ -3511,16 +3504,17 @@ crawl_directory_dag_for_mergeinfo(svn_fs
const char *this_path,
dag_node_t *dir_dag,
svn_mergeinfo_catalog_t result_catalog,
- apr_pool_t *pool,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
apr_hash_t *entries;
apr_hash_index_t *hi;
- apr_pool_t *iterpool = svn_pool_create(pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, dir_dag, pool, pool));
+ SVN_ERR(svn_fs_fs__dag_dir_entries(&entries, dir_dag,
+ scratch_pool, scratch_pool));
- for (hi = apr_hash_first(pool, entries);
+ for (hi = apr_hash_first(scratch_pool, entries);
hi;
hi = apr_hash_next(hi))
{
@@ -3572,8 +3566,8 @@ crawl_directory_dag_for_mergeinfo(svn_fs
kid_path,
kid_dag,
result_catalog,
- iterpool,
- result_pool));
+ result_pool,
+ iterpool));
}
svn_pool_destroy(iterpool);
@@ -3621,19 +3615,19 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
const char *path,
svn_mergeinfo_inheritance_t inherit,
svn_boolean_t validate_inherited_mergeinfo,
- apr_pool_t *pool,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
parent_path_t *parent_path, *nearest_ancestor;
apr_hash_t *proplist;
svn_string_t *mergeinfo_string;
- apr_pool_t *iterpool = svn_pool_create(pool);
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
*mergeinfo = NULL;
- path = svn_fs__canonicalize_abspath(path, pool);
+ path = svn_fs__canonicalize_abspath(path, scratch_pool);
- SVN_ERR(open_path(&parent_path, rev_root, path, 0, NULL, pool));
+ SVN_ERR(open_path(&parent_path, rev_root, path, 0, NULL, scratch_pool));
if (inherit == svn_mergeinfo_nearest_ancestor && ! parent_path->parent)
return SVN_NO_ERROR;
@@ -3671,14 +3665,15 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
}
}
- SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, nearest_ancestor->node, pool));
+ SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, nearest_ancestor->node,
+ scratch_pool));
mergeinfo_string = apr_hash_get(proplist, SVN_PROP_MERGEINFO,
APR_HASH_KEY_STRING);
if (!mergeinfo_string)
return svn_error_createf
(SVN_ERR_FS_CORRUPT, NULL,
_("Node-revision '%s@%ld' claims to have mergeinfo but doesn't"),
- parent_path_path(nearest_ancestor, pool), rev_root->rev);
+ parent_path_path(nearest_ancestor, scratch_pool), rev_root->rev);
if (nearest_ancestor == parent_path)
{
@@ -3699,22 +3694,23 @@ get_mergeinfo_for_path(svn_mergeinfo_t *
SVN_ERR(svn_mergeinfo_parse(&temp_mergeinfo,
mergeinfo_string->data,
- pool));
+ scratch_pool));
SVN_ERR(svn_mergeinfo_inheritable(&temp_mergeinfo,
temp_mergeinfo,
NULL, SVN_INVALID_REVNUM,
- SVN_INVALID_REVNUM, pool));
+ SVN_INVALID_REVNUM, scratch_pool));
SVN_ERR(append_to_merged_froms(mergeinfo,
temp_mergeinfo,
parent_path_relpath(parent_path,
nearest_ancestor,
- pool),
+ scratch_pool),
result_pool));
if (validate_inherited_mergeinfo)
SVN_ERR(svn_fs_fs__validate_mergeinfo(mergeinfo, rev_root->fs,
- *mergeinfo, pool, iterpool));
+ *mergeinfo, result_pool,
+ iterpool));
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -3727,23 +3723,23 @@ static svn_error_t *
add_descendant_mergeinfo(svn_mergeinfo_catalog_t result_catalog,
svn_fs_root_t *root,
const char *path,
- apr_pool_t *pool,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
dag_node_t *this_dag;
svn_boolean_t go_down;
- SVN_ERR(get_dag(&this_dag, root, path, pool));
+ SVN_ERR(get_dag(&this_dag, root, path, scratch_pool));
SVN_ERR(svn_fs_fs__dag_has_descendants_with_mergeinfo(&go_down,
this_dag,
- pool));
+ scratch_pool));
if (go_down)
SVN_ERR(crawl_directory_dag_for_mergeinfo(root,
path,
this_dag,
result_catalog,
- pool,
- result_pool));
+ result_pool,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -3776,13 +3772,13 @@ get_mergeinfos_for_paths(svn_fs_root_t *
SVN_ERR(get_mergeinfo_for_path(&path_mergeinfo, root, path,
inherit, validate_inherited_mergeinfo,
- iterpool, pool));
+ pool, iterpool));
if (path_mergeinfo)
apr_hash_set(result_catalog, path, APR_HASH_KEY_STRING,
path_mergeinfo);
if (include_descendants)
- SVN_ERR(add_descendant_mergeinfo(result_catalog, root, path, iterpool,
- pool));
+ SVN_ERR(add_descendant_mergeinfo(result_catalog, root, path, pool,
+ iterpool));
}
svn_pool_destroy(iterpool);
@@ -3917,9 +3913,10 @@ make_txn_root(svn_fs_root_t **root_p,
Note that since dag_node_cache_invalidate uses svn_cache__iter,
this *cannot* be a memcache-based cache. */
SVN_ERR(svn_cache__create_inprocess(&(frd->txn_node_cache),
- svn_fs_fs__dag_dup_for_cache,
- APR_HASH_KEY_STRING,
- 32, 20, FALSE, root->pool));
+ svn_fs_fs__dag_serialize,
+ svn_fs_fs__dag_deserialize,
+ APR_HASH_KEY_STRING,
+ 32, 20, FALSE, root->pool));
root->fsap_data = frd;
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_util/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_util/caching.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_util/caching.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_fs_util/caching.c Mon Feb 21 20:40:44 2011
@@ -33,14 +33,44 @@
static svn_fs_cache_config_t cache_settings =
{
/* default configuration:
+ *
+ * Please note that the resources listed below will be allocated
+ * PER PROCESS. Thus, the defaults chosen here are kept deliberately
+ * low to still make a difference yet to ensure that pre-fork servers
+ * on machines with small amounts of RAM aren't severely impacted.
*/
- 0x1000000, /* 16 MB for caches */
- 16, /* up to 16 files kept open */
- TRUE, /* cache fulltexts */
- FALSE, /* don't cache text deltas */
-
+ 0x1000000, /* 16 MB for caches.
+ * If you are running a single server process,
+ * you may easily increase that to 50+% of your RAM
+ * using svn_fs_set_cache_config().
+ */
+ 16, /* up to 16 files kept open.
+ * Most OS restrict the number of open file handles to
+ * about 1000. To minimize I/O and OS overhead, values
+ * of 500+ can be beneficial (use svn_fs_set_cache_config()
+ * to change the configuration).
+ * When running with a huge in-process cache, this number
+ * has little impact on performance and a more modest
+ * value (< 100) may be more suitable.
+ */
+ TRUE, /* cache fulltexts.
+ * Most SVN tools care about reconstructed file content.
+ * Thus, this is a reasonable default.
+ * SVN admin tools may set that to FALSE because fulltexts
+ * won't be re-used rendering the cache less effective
+ * by squeezing wanted data out.
+ */
+ FALSE, /* don't cache text deltas.
+ * Once we reconstructed the fulltexts from the deltas,
+ * these deltas are rarely re-used. Therefore, only tools
+ * like svnadmin will activate this to speed up operations
+ * dump and verify.
+ */
#ifdef APR_HAS_THREADS
- FALSE /* assume multi-threaded operation */
+ FALSE /* assume multi-threaded operation.
+ * Because this simply activates proper synchronization
+ * between threads, it is a safe default.
+ */
#else
TRUE /* single-threaded is the only supported mode of operation */
#endif
@@ -66,10 +96,12 @@ svn_fs__get_global_membuffer_cache(void)
apr_uint64_t cache_size = cache_settings.cache_size;
if (!cache && cache_size)
{
+ svn_error_t *err;
+
svn_membuffer_t *old_cache = NULL;
svn_membuffer_t *new_cache = NULL;
- /* auto-allocate cache*/
+ /* auto-allocate cache */
apr_allocator_t *allocator = NULL;
apr_pool_t *pool = NULL;
@@ -81,16 +113,49 @@ svn_fs__get_global_membuffer_cache(void)
* in its full size, the create() function will clear the pool
* explicitly. The allocator will make sure that any memory no
* longer used by the pool will actually be returned to the OS.
+ *
+ * Please note that this pool and allocator is used *only* to
+ * allocate the large membuffer. All later dynamic allocations
+ * come from other, temporary pools and allocators.
*/
apr_allocator_max_free_set(allocator, 1);
- pool = svn_pool_create_ex(NULL, allocator);
- svn_error_clear(svn_cache__membuffer_cache_create(
+ /* don't terminate upon OOM but make pool return a NULL pointer
+ * instead so we can disable caching gracefully and continue
+ * operation without membuffer caches.
+ */
+ apr_pool_create_ex(&pool, NULL, NULL, allocator);
+ if (pool == NULL)
+ return NULL;
+
+ err = svn_cache__membuffer_cache_create(
&new_cache,
(apr_size_t)cache_size,
(apr_size_t)(cache_size / 16),
! svn_fs_get_cache_config()->single_threaded,
- pool));
+ pool);
+
+ /* Some error occured. Most likely it's an OOM error but we don't
+ * really care. Simply release all cache memory and disable caching
+ */
+ if (err)
+ {
+ /* Memory and error cleanup */
+ svn_error_clear(err);
+ apr_pool_destroy(pool);
+
+ /* Prevent future attempts to create the cache. However, an
+ * existing cache instance (see next comment) remains valid.
+ */
+ cache_settings.cache_size = 0;
+
+ /* The current caller won't get the cache object.
+ * However, a concurrent call might have succeeded in creating
+ * the cache object. That call and all following ones will then
+ * use the successfully created cache instance.
+ */
+ return NULL;
+ }
/* Handle race condition: if we are the first to create a
* cache object, make it our global singleton. Otherwise,
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_local/ra_plugin.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_local/ra_plugin.c Mon Feb 21 20:40:44 2011
@@ -1020,6 +1020,7 @@ svn_ra_local__get_file(svn_ra_session_t
svn_revnum_t youngest_rev;
svn_ra_local__session_baton_t *sess = session->priv;
const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
+ svn_node_kind_t node_kind;
/* Open the revision's root. */
if (! SVN_IS_VALID_REVNUM(revision))
@@ -1032,6 +1033,18 @@ svn_ra_local__get_file(svn_ra_session_t
else
SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));
+ SVN_ERR(svn_fs_check_path(&node_kind, root, abs_path, pool));
+ if (node_kind == svn_node_none)
+ {
+ return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
+ _("'%s' path not found"), abs_path);
+ }
+ else if (node_kind != svn_node_file)
+ {
+ return svn_error_createf(SVN_ERR_FS_NOT_FILE, NULL,
+ _("'%s' is not a file"), abs_path);
+ }
+
if (stream)
{
/* Get a stream representing the file's contents. */
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/fetch.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/fetch.c Mon Feb 21 20:40:44 2011
@@ -654,6 +654,12 @@ filter_props(apr_hash_t *props,
return SVN_NO_ERROR;
}
+static const ne_propname restype_props[] =
+{
+ { "DAV:", "resourcetype" },
+ { NULL }
+};
+
svn_error_t *svn_ra_neon__get_file(svn_ra_session_t *session,
const char *path,
svn_revnum_t revision,
@@ -691,6 +697,22 @@ svn_error_t *svn_ra_neon__get_file(svn_r
*fetched_rev = got_rev;
}
+ SVN_ERR(svn_ra_neon__get_props_resource(&rsrc, ras, final_url,
+ NULL,
+ props ? NULL : restype_props,
+ pool));
+ if (rsrc->is_collection)
+ {
+ return svn_error_create(SVN_ERR_FS_NOT_FILE, NULL,
+ _("Can't get text contents of a directory"));
+ }
+
+ if (props)
+ {
+ *props = apr_hash_make(pool);
+ SVN_ERR(filter_props(*props, rsrc, TRUE, pool));
+ }
+
if (stream)
{
svn_error_t *err;
@@ -754,15 +776,6 @@ svn_error_t *svn_ra_neon__get_file(svn_r
}
}
- if (props)
- {
- SVN_ERR(svn_ra_neon__get_props_resource(&rsrc, ras, final_url,
- NULL, NULL /* all props */,
- pool));
- *props = apr_hash_make(pool);
- SVN_ERR(filter_props(*props, rsrc, TRUE, pool));
- }
-
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/options.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_neon/options.c Mon Feb 21 20:40:44 2011
@@ -191,31 +191,29 @@ parse_capabilities(ne_request *req,
slightly more efficiently, but that wouldn't be worth it
until we have many more capabilities. */
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_DEPTH, vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_DEPTH, vals))
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_DEPTH,
APR_HASH_KEY_STRING, capability_yes);
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
/* The server doesn't know what repository we're referring
to, so it can't just say capability_yes. */
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
APR_HASH_KEY_STRING, capability_server_yes);
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_LOG_REVPROPS,
APR_HASH_KEY_STRING, capability_yes);
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS, vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS, vals))
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
APR_HASH_KEY_STRING, capability_yes);
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_IGNORE_PROP_MODS,
- vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_IGNORE_PROP_MODS, vals))
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_IGNORE_PROP_MODS,
APR_HASH_KEY_STRING, capability_yes);
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY,
- vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY, vals))
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_PARTIAL_REPLAY,
APR_HASH_KEY_STRING, capability_yes);
}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/commit.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/commit.c Mon Feb 21 20:40:44 2011
@@ -529,7 +529,7 @@ get_version_url(const char **checked_in_
SVN_ERR(svn_ra_serf__deliver_props(&propfind_ctx, props, session, conn,
propfind_url, base_revision, "0",
- checked_in_props, FALSE, NULL, pool));
+ checked_in_props, NULL, pool));
SVN_ERR(svn_ra_serf__wait_for_props(propfind_ctx, session, pool));
@@ -1544,11 +1544,9 @@ delete_entry(const char *path,
{
svn_error_clear(err);
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
/* An error has been registered on the connection. Reset the thing
so that we can use it again. */
serf_connection_reset(handler->conn->conn);
-#endif
handler->body_delegate = create_delete_body;
handler->body_delegate_baton = delete_ctx;
@@ -2250,11 +2248,9 @@ abort_edit(void *edit_baton,
if (! (ctx->activity_url || ctx->txn_url))
return SVN_NO_ERROR;
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
/* An error occurred on conns[0]. serf 0.4.0 remembers that the connection
had a problem. We need to reset it, in order to use it again. */
serf_connection_reset(ctx->session->conns[0]->conn);
-#endif
/* DELETE our aborted activity */
handler = apr_pcalloc(pool, sizeof(*handler));
@@ -2406,7 +2402,7 @@ svn_ra_serf__change_rev_prop(svn_ra_sess
propfind_ctx = NULL;
SVN_ERR(svn_ra_serf__deliver_props(&propfind_ctx, props, commit->session,
commit->conn, vcc_url, rev, "0",
- checked_in_props, FALSE, NULL, pool));
+ checked_in_props, NULL, pool));
SVN_ERR(svn_ra_serf__wait_for_props(propfind_ctx, commit->session, pool));
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/options.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/options.c Mon Feb 21 20:40:44 2011
@@ -295,40 +295,37 @@ capabilities_headers_iterator_callback(v
efficiently, but that wouldn't be worth it until we have many
more capabilities. */
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_DEPTH, vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_DEPTH, vals))
{
apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_DEPTH,
APR_HASH_KEY_STRING, capability_yes);
}
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
{
/* The server doesn't know what repository we're referring
to, so it can't just say capability_yes. */
apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
APR_HASH_KEY_STRING, capability_server_yes);
}
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS,
- vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
{
apr_hash_set(orc->session->capabilities,
SVN_RA_CAPABILITY_LOG_REVPROPS,
APR_HASH_KEY_STRING, capability_yes);
}
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS,
- vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS, vals))
{
apr_hash_set(orc->session->capabilities,
SVN_RA_CAPABILITY_ATOMIC_REVPROPS,
APR_HASH_KEY_STRING, capability_yes);
}
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_IGNORE_PROP_MODS,
- vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_IGNORE_PROP_MODS, vals))
{
apr_hash_set(orc->session->capabilities,
SVN_RA_CAPABILITY_IGNORE_PROP_MODS,
APR_HASH_KEY_STRING, capability_yes);
}
- if (svn_cstring_match_glob_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY, vals))
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY, vals))
{
apr_hash_set(orc->session->capabilities,
SVN_RA_CAPABILITY_PARTIAL_REPLAY,
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/property.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/property.c Mon Feb 21 20:40:44 2011
@@ -87,9 +87,6 @@ struct svn_ra_serf__propfind_context_t {
/* the list of requested properties */
const svn_ra_serf__dav_props_t *find_props;
- /* should we cache the values of this propfind in our session? */
- svn_boolean_t cache_props;
-
/* hash table that will be updated with the properties
*
* This can be shared between multiple svn_ra_serf__propfind_context_t
@@ -385,18 +382,6 @@ end_propfind(svn_ra_serf__xml_parser_t *
ctx->current_path, ctx->rev,
ns, pname, val_str,
ctx->pool);
- if (ctx->cache_props)
- {
- ns = apr_pstrdup(ctx->sess->pool, info->ns);
- pname = apr_pstrdup(ctx->sess->pool, info->name);
- val = apr_pmemdup(ctx->sess->pool, info->val, info->val_len);
- val_str = svn_string_ncreate(val, info->val_len, ctx->sess->pool);
-
- svn_ra_serf__set_ver_prop(ctx->sess->cached_props,
- ctx->current_path, ctx->rev,
- ns, pname, val_str,
- ctx->sess->pool);
- }
svn_ra_serf__xml_pop_state(parser);
}
@@ -533,40 +518,6 @@ create_propfind_body(serf_bucket_t **bkt
return SVN_NO_ERROR;
}
-static svn_boolean_t
-check_cache(apr_hash_t *ret_props,
- svn_ra_serf__session_t *sess,
- const char *path,
- svn_revnum_t rev,
- const svn_ra_serf__dav_props_t *find_props,
- apr_pool_t *pool)
-{
- svn_boolean_t cache_hit = TRUE;
- const svn_ra_serf__dav_props_t *prop;
-
- /* check to see if we have any of this information cached */
- prop = find_props;
- while (prop && prop->namespace)
- {
- const svn_string_t *val;
-
- val = svn_ra_serf__get_ver_prop_string(sess->cached_props, path, rev,
- prop->namespace, prop->name);
- if (val)
- {
- svn_ra_serf__set_ver_prop(ret_props, path, rev,
- prop->namespace, prop->name, val, pool);
- }
- else
- {
- cache_hit = FALSE;
- }
- prop++;
- }
-
- return cache_hit;
-}
-
/*
* This function will deliver a PROP_CTX PROPFIND request in the SESS
* serf context for the properties listed in LOOKUP_PROPS at URL for
@@ -586,7 +537,6 @@ svn_ra_serf__deliver_props(svn_ra_serf__
svn_revnum_t rev,
const char *depth,
const svn_ra_serf__dav_props_t *find_props,
- svn_boolean_t cache_props,
svn_ra_serf__list_t **done_list,
apr_pool_t *pool)
{
@@ -597,25 +547,10 @@ svn_ra_serf__deliver_props(svn_ra_serf__
svn_ra_serf__handler_t *handler;
svn_ra_serf__xml_parser_t *parser_ctx;
- if (cache_props)
- {
- svn_boolean_t cache_satisfy;
-
- cache_satisfy = check_cache(ret_props, sess, path, rev, find_props,
- pool);
-
- if (cache_satisfy)
- {
- *prop_ctx = NULL;
- return SVN_NO_ERROR;
- }
- }
-
new_prop_ctx = apr_pcalloc(pool, sizeof(*new_prop_ctx));
new_prop_ctx->pool = apr_hash_pool_get(ret_props);
new_prop_ctx->path = path;
- new_prop_ctx->cache_props = cache_props;
new_prop_ctx->find_props = find_props;
new_prop_ctx->ret_props = ret_props;
new_prop_ctx->depth = depth;
@@ -742,7 +677,7 @@ svn_ra_serf__retrieve_props(apr_hash_t *
svn_ra_serf__propfind_context_t *prop_ctx = NULL;
SVN_ERR(svn_ra_serf__deliver_props(&prop_ctx, prop_vals, sess, conn, url,
- rev, depth, props, TRUE, NULL, pool));
+ rev, depth, props, NULL, pool));
if (prop_ctx)
{
SVN_ERR(svn_ra_serf__wait_for_props(prop_ctx, sess, pool));
@@ -959,6 +894,50 @@ svn_ra_serf__set_bare_props(void *baton,
ns, ns_len, name, name_len, val, pool);
}
+static svn_error_t *
+retrieve_baseline_info(svn_revnum_t *actual_revision,
+ const char **basecoll_url_p,
+ svn_ra_serf__session_t *session,
+ svn_ra_serf__connection_t *conn,
+ const char *baseline_url,
+ svn_revnum_t revision,
+ apr_pool_t *pool)
+{
+ apr_hash_t *props = apr_hash_make(pool);
+ const char *basecoll_url;
+ const char *version_name;
+
+ SVN_ERR(svn_ra_serf__retrieve_props(props, session, conn,
+ baseline_url, revision, "0",
+ baseline_props, pool));
+
+ basecoll_url = svn_ra_serf__get_ver_prop(props, baseline_url, revision,
+ "DAV:",
+ "baseline-collection");
+
+ if (!basecoll_url)
+ {
+ return svn_error_create(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL,
+ _("The PROPFIND response did not include "
+ "the requested baseline-collection value"));
+ }
+
+ *basecoll_url_p = svn_urlpath__canonicalize(basecoll_url, pool);
+
+ version_name = svn_ra_serf__get_ver_prop(props, baseline_url, revision,
+ "DAV:", SVN_DAV__VERSION_NAME);
+ if (!version_name)
+ {
+ return svn_error_create(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL,
+ _("The PROPFIND response did not include "
+ "the requested version-name value"));
+ }
+
+ *actual_revision = SVN_STR_TO_REV(version_name);
+
+ return SVN_NO_ERROR;
+}
+
svn_error_t *
svn_ra_serf__get_baseline_info(const char **bc_url,
const char **bc_relative,
@@ -991,35 +970,42 @@ svn_ra_serf__get_baseline_info(const cha
if (latest_revnum)
{
- svn_ra_serf__options_context_t *opt_ctx;
+ if (SVN_IS_VALID_REVNUM(revision))
+ {
+ *latest_revnum = revision;
+ }
+ else
+ {
+ svn_ra_serf__options_context_t *opt_ctx;
- SVN_ERR(svn_ra_serf__create_options_req(&opt_ctx, session, conn,
+ SVN_ERR(svn_ra_serf__create_options_req(&opt_ctx, session, conn,
session->repos_url.path,
pool));
- SVN_ERR(svn_ra_serf__context_run_wait(
- svn_ra_serf__get_options_done_ptr(opt_ctx), session, pool));
+ SVN_ERR(svn_ra_serf__context_run_wait(
+ svn_ra_serf__get_options_done_ptr(opt_ctx), session, pool));
- *latest_revnum = svn_ra_serf__options_get_youngest_rev(opt_ctx);
- if (! SVN_IS_VALID_REVNUM(*latest_revnum))
- return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
- _("The OPTIONS response did not include "
- "the youngest revision"));
+ *latest_revnum = svn_ra_serf__options_get_youngest_rev(opt_ctx);
+ if (! SVN_IS_VALID_REVNUM(*latest_revnum))
+ return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
+ _("The OPTIONS response did not include "
+ "the youngest revision"));
+ }
}
}
/* Otherwise, we fall back to the old VCC_URL PROPFIND hunt. */
else
{
+ svn_revnum_t actual_revision;
+
SVN_ERR(svn_ra_serf__discover_vcc(&vcc_url, session, conn, pool));
if (revision != SVN_INVALID_REVNUM)
{
- SVN_ERR(svn_ra_serf__retrieve_props(props, session, conn,
- vcc_url, revision, "0",
- baseline_props, pool));
- basecoll_url = svn_ra_serf__get_ver_prop(props, vcc_url, revision,
- "DAV:",
- "baseline-collection");
+ SVN_ERR(retrieve_baseline_info(&actual_revision, &basecoll_url,
+ session, conn,
+ vcc_url, revision,
+ pool));
}
else
{
@@ -1037,38 +1023,14 @@ svn_ra_serf__get_baseline_info(const cha
baseline_url = svn_urlpath__canonicalize(baseline_url, pool);
- SVN_ERR(svn_ra_serf__retrieve_props(props, session, conn,
- baseline_url, revision, "0",
- baseline_props, pool));
- basecoll_url = svn_ra_serf__get_ver_prop(props, baseline_url,
- revision, "DAV:",
- "baseline-collection");
+ SVN_ERR(retrieve_baseline_info(&actual_revision, &basecoll_url,
+ session, conn,
+ baseline_url, revision, pool));
}
- if (!basecoll_url)
- {
- return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
- _("The OPTIONS response did not include the "
- "requested baseline-collection value"));
- }
-
- basecoll_url = svn_urlpath__canonicalize(basecoll_url, pool);
-
if (latest_revnum)
{
- const char *version_name;
-
- version_name = svn_ra_serf__get_prop(props, baseline_url,
- "DAV:", SVN_DAV__VERSION_NAME);
-
- if (!version_name)
- {
- return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
- _("The OPTIONS response did not include "
- "the requested version-name value"));
- }
-
- *latest_revnum = SVN_STR_TO_REV(version_name);
+ *latest_revnum = actual_revision;
}
}
@@ -1081,3 +1043,33 @@ svn_ra_serf__get_baseline_info(const cha
return SVN_NO_ERROR;
}
+
+svn_error_t *
+svn_ra_serf__get_resource_type(svn_node_kind_t *kind,
+ apr_hash_t *props,
+ const char *url,
+ svn_revnum_t revision)
+{
+ const char *res_type;
+
+ res_type = svn_ra_serf__get_ver_prop(props, url, revision,
+ "DAV:", "resourcetype");
+ if (!res_type)
+ {
+ /* How did this happen? */
+ return svn_error_create(SVN_ERR_RA_DAV_PROPS_NOT_FOUND, NULL,
+ _("The PROPFIND response did not include the "
+ "requested resourcetype value"));
+ }
+
+ if (strcmp(res_type, "collection") == 0)
+ {
+ *kind = svn_node_dir;
+ }
+ else
+ {
+ *kind = svn_node_file;
+ }
+
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/ra_serf.h?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/ra_serf.h Mon Feb 21 20:40:44 2011
@@ -46,8 +46,8 @@ extern "C" {
/* Enforce the minimum version of serf. */
-#if !SERF_VERSION_AT_LEAST(0, 3, 0)
-#error Please update your version of serf to at least 0.3.0.
+#if !SERF_VERSION_AT_LEAST(0, 7, 1)
+#error Please update your version of serf to at least 0.7.1.
#endif
/** Use this to silence compiler warnings about unused parameters. */
@@ -59,24 +59,9 @@ extern "C" {
APR_STRINGIFY(SERF_MINOR_VERSION) "." \
APR_STRINGIFY(SERF_PATCH_VERSION)
-#ifdef WIN32
-#define SVN_RA_SERF_SSPI_ENABLED
-#endif
-
/* Forward declarations. */
typedef struct svn_ra_serf__session_t svn_ra_serf__session_t;
-typedef struct svn_ra_serf__auth_protocol_t svn_ra_serf__auth_protocol_t;
-
-typedef enum svn_ra_serf__authn_types
-{
- svn_ra_serf__authn_none = 0x00,
- svn_ra_serf__authn_basic = 0x01,
- svn_ra_serf__authn_digest = 0x02,
- svn_ra_serf__authn_ntlm = 0x04,
- svn_ra_serf__authn_negotiate = 0x08,
- svn_ra_serf__authn_all = 0xFF,
-} svn_ra_serf__authn_types;
/* A serf connection and optionally associated SSL context. */
typedef struct svn_ra_serf__connection_t {
@@ -89,9 +74,6 @@ typedef struct svn_ra_serf__connection_t
/* Host name */
const char *hostinfo;
- /* The address where the connections are made to */
- apr_sockaddr_t *address;
-
/* Are we using ssl */
svn_boolean_t using_ssl;
@@ -101,12 +83,6 @@ typedef struct svn_ra_serf__connection_t
/* What was the last HTTP status code we got on this connection? */
int last_status_code;
- /* Current authorization header used for this connection; may be NULL */
- const char *auth_header;
-
- /* Current authorization value used for this connection; may be NULL */
- const char *auth_value;
-
/* Optional SSL context for this connection. */
serf_ssl_context_t *ssl_context;
svn_auth_iterstate_t *ssl_client_auth_state;
@@ -114,18 +90,6 @@ typedef struct svn_ra_serf__connection_t
svn_ra_serf__session_t *session;
- /* Baton used to store connection specific authn/authz data */
- void *auth_context;
-
- /* Baton used to store proxy specific authn/authz data */
- void *proxy_auth_context;
-
- /* Current authorization header used for the proxy server; may be NULL */
- const char *proxy_auth_header;
-
- /* Current authorization value used for the proxy server; may be NULL */
- const char *proxy_auth_value;
-
/* user agent string */
const char *useragent;
@@ -168,13 +132,7 @@ struct svn_ra_serf__session_t {
/* Our Version-Controlled-Configuration; may be NULL until we know it. */
const char *vcc_url;
- /* Cached properties */
- apr_hash_t *cached_props;
-
/* Authentication related properties. */
- const char *realm;
- const char *auth_header;
- const char *auth_value;
svn_auth_iterstate_t *auth_state;
int auth_attempts;
@@ -189,11 +147,8 @@ struct svn_ra_serf__session_t {
/* Error that we've received but not yet returned upstream. */
svn_error_t *pending_error;
- /* vtable and info object handling the authentication */
- const svn_ra_serf__auth_protocol_t *auth_protocol;
-
/* List of authn types supported by the client.*/
- svn_ra_serf__authn_types authn_types;
+ int authn_types;
/* Maps SVN_RA_CAPABILITY_foo keys to "yes" or "no" values.
If a capability is not yet discovered, it is absent from the table.
@@ -207,11 +162,6 @@ struct svn_ra_serf__session_t {
/* Are we using a proxy? */
int using_proxy;
- /* Proxy Authentication related properties */
- const char *proxy_auth_header;
- const char *proxy_auth_value;
- const svn_ra_serf__auth_protocol_t *proxy_auth_protocol;
-
const char *proxy_username;
const char *proxy_password;
int proxy_auth_attempts;
@@ -349,19 +299,12 @@ static const svn_ra_serf__dav_props_t hr
/** Serf utility functions **/
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
apr_status_t
svn_ra_serf__conn_setup(apr_socket_t *sock,
serf_bucket_t **read_bkt,
serf_bucket_t **write_bkt,
void *baton,
apr_pool_t *pool);
-#else
-serf_bucket_t *
-svn_ra_serf__conn_setup(apr_socket_t *sock,
- void *baton,
- apr_pool_t *pool);
-#endif
serf_bucket_t*
svn_ra_serf__accept_response(serf_request_t *request,
@@ -530,9 +473,6 @@ typedef struct svn_ra_serf__handler_t {
serf_request_t*
svn_ra_serf__request_create(svn_ra_serf__handler_t *handler);
-serf_request_t*
-svn_ra_serf__priority_request_create(svn_ra_serf__handler_t *handler);
-
/* XML helper callbacks. */
typedef struct svn_ra_serf__xml_state_t {
@@ -795,13 +735,6 @@ const char *
svn_ra_serf__response_get_location(serf_bucket_t *response,
apr_pool_t *pool);
-/* Canonicalize URI, in the general sense. URI might be a full,
- * absolute, schema-ful URL. It might be just the path portion of a
- * URL. Or it might be a relative path. Whatever the case, it is a
- * URI-encoded identifier of *some sort*, as will be the returned form
- * thereof.
- */
-
/** XML helper functions. **/
/*
@@ -932,9 +865,7 @@ svn_ra_serf__propfind_status_code(svn_ra
* serf context for the properties listed in LOOKUP_PROPS at URL for
* DEPTH ("0","1","infinity").
*
- * This function will not block waiting for the response. If the
- * request can be satisfied from a local cache, set PROP_CTX to NULL
- * as a signal to callers of that fact. Otherwise, callers are
+ * This function will not block waiting for the response. Callers are
* expected to call svn_ra_serf__wait_for_props().
*/
svn_error_t *
@@ -946,7 +877,6 @@ svn_ra_serf__deliver_props(svn_ra_serf__
svn_revnum_t rev,
const char *depth,
const svn_ra_serf__dav_props_t *lookup_props,
- svn_boolean_t cache_props,
svn_ra_serf__list_t **done_list,
apr_pool_t *pool);
@@ -1073,6 +1003,13 @@ svn_ra_serf__set_prop(apr_hash_t *props,
const char *ns, const char *name,
const svn_string_t *val, apr_pool_t *pool);
+svn_error_t *
+svn_ra_serf__get_resource_type(svn_node_kind_t *kind,
+ apr_hash_t *props,
+ const char *url,
+ svn_revnum_t revision);
+
+
/** MERGE-related functions **/
typedef struct svn_ra_serf__merge_context_t svn_ra_serf__merge_context_t;
@@ -1445,105 +1382,6 @@ svn_ra_serf__credentials_callback(char *
int code, const char *authn_type,
const char *realm,
apr_pool_t *pool);
-/**
- * For each authentication protocol we need a handler function of type
- * svn_serf__auth_handler_func_t. This function will be called when an
- * authentication challenge is received in a session.
- */
-typedef svn_error_t *
-(*svn_serf__auth_handler_func_t)(svn_ra_serf__handler_t *ctx,
- serf_request_t *request,
- serf_bucket_t *response,
- const char *auth_hdr,
- const char *auth_attr,
- apr_pool_t *pool);
-
-/**
- * For each authentication protocol we need an initialization function of type
- * svn_serf__init_conn_func_t. This function will be called when a new
- * connection is opened.
- */
-typedef svn_error_t *
-(*svn_serf__init_conn_func_t)(svn_ra_serf__session_t *session,
- svn_ra_serf__connection_t *conn,
- apr_pool_t *pool);
-
-/**
- * For each authentication protocol we need a setup_request function of type
- * svn_serf__setup_request_func_t. This function will be called when a
- * new serf_request_t object is created and should fill in the correct
- * authentication headers (if needed).
- */
-typedef svn_error_t *
-(*svn_serf__setup_request_func_t)(svn_ra_serf__connection_t *conn,
- const char *method,
- const char *uri,
- serf_bucket_t *hdrs_bkt);
-
-/**
- * This function will be called when a response is received, so that the
- * protocol handler can validate the Authentication related response headers
- * (if needed).
- */
-typedef svn_error_t *
-(*svn_serf__validate_response_func_t)(svn_ra_serf__handler_t *ctx,
- serf_request_t *request,
- serf_bucket_t *response,
- apr_pool_t *pool);
-
-/**
- * svn_ra_serf__auth_protocol_t: vtable for an authn protocol provider.
- *
- */
-struct svn_ra_serf__auth_protocol_t {
- /* The http status code that's handled by this authentication protocol.
- Normal values are 401 for server authentication and 407 for proxy
- authentication */
- int code;
-
- /* The name of this authentication protocol. This should be a case
- sensitive match of the string sent in the HTTP authentication header. */
- const char *auth_name;
-
- /* Internal code used for this authn type. */
- svn_ra_serf__authn_types auth_type;
-
- /* The initialization function if any; otherwise, NULL */
- svn_serf__init_conn_func_t init_conn_func;
-
- /* The authentication handler function */
- svn_serf__auth_handler_func_t handle_func;
-
- /* Function to set up the authentication header of a request */
- svn_serf__setup_request_func_t setup_request_func;
-
- /* Function to validate the authentication header of a response */
- svn_serf__validate_response_func_t validate_response_func;
-};
-
-/**
- * This function will be called when an authentication challenge is
- * received. Based on the challenge, handle_auth will pick the needed
- * authn implementation and forward the call to its authn handler.
- */
-svn_error_t *
-svn_ra_serf__handle_auth(int code,
- svn_ra_serf__handler_t *ctx,
- serf_request_t *request,
- serf_bucket_t *response,
- apr_pool_t *pool);
-
-/**
- * encode_auth_header: base64 encodes the authentication data and builds an
- * authentication header in this format:
- * [PROTOCOL] [BASE64 AUTH DATA]
- */
-void
-svn_ra_serf__encode_auth_header(const char *protocol,
- const char **header,
- const char *data,
- apr_size_t data_len,
- apr_pool_t *pool);
/*** General utility functions ***/
Modified: subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/replay.c?rev=1073138&r1=1073137&r2=1073138&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/ignore-mergeinfo-log/subversion/libsvn_ra_serf/replay.c Mon Feb 21 20:40:44 2011
@@ -781,7 +781,7 @@ svn_ra_serf__replay_range(svn_ra_session
replay_ctx->revprop_target,
replay_ctx->revprop_rev,
"0", all_props,
- TRUE, NULL,
+ NULL,
replay_ctx->src_rev_pool));
replay_ctx->prop_ctx = prop_ctx;