You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/09/15 21:23:11 UTC
svn commit: r997466 - in /subversion/trunk/subversion/libsvn_ra_svn:
editorp.c marshal.c ra_svn.h
Author: cmpilato
Date: Wed Sep 15 19:23:11 2010
New Revision: 997466
URL: http://svn.apache.org/viewvc?rev=997466&view=rev
Log:
In svnserve, rather than assuming that an error chain slated for
transmission to the client has but one wrapping error of the
SVN_ERR_RA_SVN_CMD_ERR variety, just skip all such wrappers in the
chain when picking the right error data to transmit.
This is the server-side counterpart, of sorts, to r997457.
* subversion/libsvn_ra_svn/ra_svn.h
(svn_ra_svn__locate_real_error_child): New.
* subversion/libsvn_ra_svn/marshal.c
(svn_ra_svn__locate_real_error_child): New.
(svn_ra_svn_handle_commands2): Use svn_ra_svn__locate_real_error_child().
* subversion/libsvn_ra_svn/editorp.c
(svn_ra_svn_drive_editor2): Use svn_ra_svn__locate_real_error_child().
Modified:
subversion/trunk/subversion/libsvn_ra_svn/editorp.c
subversion/trunk/subversion/libsvn_ra_svn/marshal.c
subversion/trunk/subversion/libsvn_ra_svn/ra_svn.h
Modified: subversion/trunk/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/editorp.c?rev=997466&r1=997465&r2=997466&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/editorp.c Wed Sep 15 19:23:11 2010
@@ -904,7 +904,9 @@ svn_error_t *svn_ra_svn_drive_editor2(sv
svn_error_clear(editor->abort_edit(edit_baton, subpool));
svn_ra_svn__set_block_handler(conn, blocked_write, &state);
}
- write_err = svn_ra_svn_write_cmd_failure(conn, subpool, err->child);
+ write_err = svn_ra_svn_write_cmd_failure(
+ conn, subpool,
+ svn_ra_svn__locate_real_error_child(err));
if (!write_err)
write_err = svn_ra_svn_flush(conn, subpool);
svn_ra_svn__set_block_handler(conn, NULL, NULL);
Modified: subversion/trunk/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/marshal.c?rev=997466&r1=997465&r2=997466&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/marshal.c Wed Sep 15 19:23:11 2010
@@ -832,6 +832,21 @@ svn_error_t *svn_ra_svn_parse_proplist(c
/* --- READING AND WRITING COMMANDS AND RESPONSES --- */
+svn_error_t *svn_ra_svn__locate_real_error_child(svn_error_t *err)
+{
+ svn_error_t *this_link;
+
+ SVN_ERR_ASSERT(err);
+
+ for (this_link = err;
+ this_link && (this_link->apr_err == SVN_ERR_RA_SVN_CMD_ERR);
+ this_link = this_link->child)
+ ;
+
+ SVN_ERR_ASSERT(this_link);
+ return this_link;
+}
+
svn_error_t *svn_ra_svn__handle_failure_status(const apr_array_header_t *params,
apr_pool_t *pool)
{
@@ -956,7 +971,9 @@ svn_error_t *svn_ra_svn_handle_commands2
if (err && err->apr_err == SVN_ERR_RA_SVN_CMD_ERR)
{
- write_err = svn_ra_svn_write_cmd_failure(conn, iterpool, err->child);
+ write_err = svn_ra_svn_write_cmd_failure(
+ conn, iterpool,
+ svn_ra_svn__locate_real_error_child(err));
svn_error_clear(err);
if (write_err)
return write_err;
Modified: subversion/trunk/subversion/libsvn_ra_svn/ra_svn.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/ra_svn.h?rev=997466&r1=997465&r2=997466&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/ra_svn.h (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/ra_svn.h Wed Sep 15 19:23:11 2010
@@ -122,6 +122,11 @@ svn_error_t *svn_ra_svn__cram_client(svn
const char *user, const char *password,
const char **message);
+/* Return a pointer to the error chain child of ERR which contains the
+ * first "real" error message, not merely one of the
+ * SVN_ERR_RA_SVN_CMD_ERR wrapper errors. */
+svn_error_t *svn_ra_svn__locate_real_error_child(svn_error_t *err);
+
/* Return an error chain based on @a params (which contains a
* command response indicating failure). The error chain will be
* in the same order as the errors indicated in @a params. Use