You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by je...@apache.org on 2012/06/12 15:28:00 UTC
svn commit: r1349324 - /subversion/trunk/subversion/libsvn_ra_serf/util.c
Author: jerenkrantz
Date: Tue Jun 12 13:27:59 2012
New Revision: 1349324
URL: http://svn.apache.org/viewvc?rev=1349324&view=rev
Log:
Corollary to issue #4175 (SurfShield doesn't work).
Allow EAGAIN to be handled properly when server_error fallback is used.
Thanks to: lgo, jcorvel, ivan
* subversion/libsvn_ra_serf/util.c
(handle_response): Clear non-EOF transient errors (EAGAIN, WAIT_CONN);
update comment to match another version of reality closer to our own.
Modified:
subversion/trunk/subversion/libsvn_ra_serf/util.c
Modified: subversion/trunk/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/util.c?rev=1349324&r1=1349323&r2=1349324&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/util.c Tue Jun 12 13:27:59 2012
@@ -1887,17 +1887,25 @@ handle_response(serf_request_t *request,
&handler->server_error->parser,
scratch_pool);
- /* APR_EOF will be returned when parsing is complete. If we see
- any other error, return it immediately.
+ /* If we do not receive an error or it is a non-transient error, return
+ immediately.
- In practice the only other error we expect to see is APR_EAGAIN,
- which indicates the network has no more data right now. This
- svn_error_t will get unwrapped, and that APR_EAGAIN will be
- returned to serf. We'll get called later, when more network data
- is available. */
- if (!err || !APR_STATUS_IS_EOF(err->apr_err))
+ APR_EOF will be returned when parsing is complete.
+
+ APR_EAGAIN & WAIT_CONN may be intermittently returned as we proceed through
+ parsing and the network has no more data right now. If we receive that,
+ clear the error and return - allowing serf to wait for more data.
+ */
+ if (!err || !SERF_BUCKET_READ_ERROR(err->apr_err))
return svn_error_trace(err);
+ if (!APR_STATUS_IS_EOF(err->apr_err))
+ {
+ *serf_status = err->apr_err;
+ svn_error_clear(err);
+ return SVN_NO_ERROR;
+ }
+
/* Clear the EOF. We don't need it. */
svn_error_clear(err);