Author: rhuijben
Date: Thu Mar 12 08:40:16 2015
New Revision: 1666095

URL: http://svn.apache.org/r1666095
Log:
In ra-serf: make all our custom 'REPORT' requests expect only HTTP status 200
as OK (instead of just >= 200 && < 299), and switch them to a helper function
that may provide more detailed error messages if they fail, but with less
specific arguments.

Note that unlike in <= 1.8.x real error reports will never reach this code,
as server error reports are already handled in the request callbacks, so
this most likely only affects non-subversion responses.

* subversion/libsvn_ra_serf/getlocations.c
  (svn_ra_serf__get_locations): Expect 200.

* subversion/libsvn_ra_serf/getlocationsegments.c
  (svn_ra_serf__get_locations): Expect 200.

* subversion/libsvn_ra_serf/log.c
  (svn_ra_serf__get_log): Expect 200.

* subversion/libsvn_ra_serf/mergeinfo.c
  (svn_ra_serf__get_mergeinfo): Expect 200.

* subversion/libsvn_ra_serf/replay.c
  (svn_ra_serf__replay): Expect 200.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/getlocations.c
    subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c
    subversion/trunk/subversion/libsvn_ra_serf/log.c
    subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c
    subversion/trunk/subversion/libsvn_ra_serf/replay.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/getlocations.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/getlocations.c?rev=1666095&r1=1666094&r2=1666095&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/getlocations.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/getlocations.c Thu Mar 12 
08:40:16 2015
@@ -193,9 +193,8 @@ svn_ra_serf__get_locations(svn_ra_sessio
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 
-  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;
 }

Modified: subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c?rev=1666095&r1=1666094&r2=1666095&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/getlocationsegments.c Thu Mar 12 
08:40:16 2015
@@ -196,12 +196,8 @@ svn_ra_serf__get_location_segments(svn_r
 
   err = svn_ra_serf__context_run_one(handler, pool);
 
-  if (!err)
-    {
-      err = svn_ra_serf__error_on_status(handler->sline,
-                                         handler->path,
-                                         handler->location);
-    }
+  if (!err && handler->sline.code != 200)
+    err = svn_ra_serf__unexpected_status(handler);
 
   if (err && (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE))
     return svn_error_create(SVN_ERR_RA_NOT_IMPLEMENTED, err, NULL);

Modified: subversion/trunk/subversion/libsvn_ra_serf/log.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/log.c?rev=1666095&r1=1666094&r2=1666095&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/log.c Thu Mar 12 08:40:16 2015
@@ -598,8 +598,8 @@ svn_ra_serf__get_log(svn_ra_session_t *r
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 
-  return svn_error_trace(
-              svn_ra_serf__error_on_status(handler->sline,
-                                           req_url,
-                                           handler->location));
+  if (handler->sline.code != 200)
+    SVN_ERR(svn_ra_serf__unexpected_status(handler));
+
+  return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c?rev=1666095&r1=1666094&r2=1666095&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/mergeinfo.c Thu Mar 12 08:40:16 
2015
@@ -228,8 +228,8 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
 
   SVN_ERR(svn_ra_serf__context_run_one(handler, pool));
 
-  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));
 
   if (apr_hash_count(mergeinfo_ctx->result_catalog))
     *catalog = mergeinfo_ctx->result_catalog;

Modified: subversion/trunk/subversion/libsvn_ra_serf/replay.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/replay.c?rev=1666095&r1=1666094&r2=1666095&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/replay.c Thu Mar 12 08:40:16 2015
@@ -566,10 +566,10 @@ svn_ra_serf__replay(svn_ra_session_t *ra
 
   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 != 200)
+    SVN_ERR(svn_ra_serf__unexpected_status(handler));
+
+  return SVN_NO_ERROR;
 }
 
 /* The maximum number of outstanding requests at any time. When this


Reply via email to