You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/12/28 18:51:50 UTC
svn commit: r1553881 - in /subversion/trunk/subversion/libsvn_ra_serf:
options.c property.c
Author: rhuijben
Date: Sat Dec 28 17:51:50 2013
New Revision: 1553881
URL: http://svn.apache.org/r1553881
Log:
Add more http status verifications in libsvn_ra_serf.
* subversion/libsvn_ra_serf/options.c
(svn_ra_serf__v2_get_youngest_revnum,
svn_ra_serf__v1_get_activity_collection,
svn_ra_serf__exchange_capabilities): Report anything but 200 as unexpected.
(svn_ra_serf__probe_proxy): Expect either 200 or 411.
(svn_ra_serf__has_capability): Add error tracing.
* subversion/libsvn_ra_serf/property.c
(svn_ra_serf__wait_for_props): Expect 207 status.
Modified:
subversion/trunk/subversion/libsvn_ra_serf/options.c
subversion/trunk/subversion/libsvn_ra_serf/property.c
Modified: subversion/trunk/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/options.c?rev=1553881&r1=1553880&r2=1553881&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/options.c Sat Dec 28 17:51:50 2013
@@ -439,9 +439,9 @@ svn_ra_serf__v2_get_youngest_revnum(svn_
SVN_ERR(create_options_req(&opt_ctx, session, conn, scratch_pool));
SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, scratch_pool));
- SVN_ERR(svn_ra_serf__error_on_status(opt_ctx->handler->sline,
- opt_ctx->handler->path,
- opt_ctx->handler->location));
+
+ if (opt_ctx->handler->sline.code != 200)
+ return svn_error_trace(svn_ra_serf__unexpected_status(opt_ctx->handler));
*youngest = opt_ctx->youngest_rev;
SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(*youngest));
@@ -464,9 +464,8 @@ svn_ra_serf__v1_get_activity_collection(
SVN_ERR(create_options_req(&opt_ctx, session, conn, scratch_pool));
SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, scratch_pool));
- SVN_ERR(svn_ra_serf__error_on_status(opt_ctx->handler->sline,
- opt_ctx->handler->path,
- opt_ctx->handler->location));
+ if (opt_ctx->handler->sline.code != 200)
+ return svn_error_trace(svn_ra_serf__unexpected_status(opt_ctx->handler));
*activity_url = apr_pstrdup(result_pool, opt_ctx->activity_collection);
@@ -500,9 +499,8 @@ svn_ra_serf__exchange_capabilities(svn_r
return SVN_NO_ERROR;
}
- SVN_ERR(svn_ra_serf__error_on_status(opt_ctx->handler->sline,
- serf_sess->session_url.path,
- opt_ctx->handler->location));
+ if (opt_ctx->handler->sline.code != 200)
+ return svn_error_trace(svn_ra_serf__unexpected_status(opt_ctx->handler));
/* Opportunistically cache any reported activity URL. (We don't
want to have to ask for this again later, potentially against an
@@ -569,9 +567,8 @@ svn_ra_serf__probe_proxy(svn_ra_serf__se
return SVN_NO_ERROR;
}
- SVN_ERR(svn_ra_serf__error_on_status(handler->sline,
- handler->path,
- handler->location));
+ if (handler->sline.code != 200)
+ SVN_ERR(svn_ra_serf__unexpected_status(handler));
return SVN_NO_ERROR;
}
@@ -643,7 +640,7 @@ svn_ra_serf__has_capability(svn_ra_sessi
cap_result = capability_yes;
}
else
- return err;
+ return svn_error_trace(err);
}
else
cap_result = capability_yes;
Modified: subversion/trunk/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/property.c?rev=1553881&r1=1553880&r2=1553881&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/property.c Sat Dec 28 17:51:50 2013
@@ -638,10 +638,10 @@ svn_ra_serf__wait_for_props(svn_ra_serf_
{
SVN_ERR(svn_ra_serf__context_run_one(handler, scratch_pool));
- return svn_error_trace(
- svn_ra_serf__error_on_status(handler->sline,
- handler->path,
- handler->location));
+ if (handler->sline.code != 207)
+ return svn_error_trace(svn_ra_serf__unexpected_status(handler));
+
+ return SVN_NO_ERROR;
}
/*