Index: subversion/libsvn_ra_serf/util.c
===================================================================
--- subversion/libsvn_ra_serf/util.c	(revision 1349207)
+++ subversion/libsvn_ra_serf/util.c	(working copy)
@@ -1419,6 +1427,7 @@
   svn_ra_serf__server_error_t server_err = { 0 };
   serf_bucket_t *hdrs;
   const char *val;
+  apr_status_t err;
 
   hdrs = serf_bucket_response_get_headers(response);
   val = serf_bucket_headers_get(hdrs, "Content-Type");
@@ -1459,7 +1468,9 @@
 
   /* The only error that we will return is from the XML response body.
      Otherwise, ignore the entire body and return success.  */
-  (void) drain_bucket(response);
+  err = drain_bucket(response);
+  if (err && !SERF_BUCKET_READ_ERROR(err))
+    return svn_error_wrap_apr(err, NULL);
 
   return SVN_NO_ERROR;
 }
@@ -1487,17 +1498,21 @@
   /* Woo-hoo.  Nothing here to see.  */
   if (sl.code == 404 && ctx->ignore_errors == FALSE)
     {
-      add_done_item(ctx);
-
       err = handle_server_error(request, response, pool);
 
       /* ### the above call should have drained the entire response. this
          ### call is historical, and probably not required. but during
          ### the rework of this core handling... let's keep it for now.  */
-      status = drain_bucket(response);
-      if (status)
-        err = svn_error_compose_create(svn_error_wrap_apr(status, NULL),
-                                       err);
+      if (!err)
+        {
+          status = drain_bucket(response);
+          if (status)
+            err = svn_error_compose_create(svn_error_wrap_apr(status, NULL),
+                                           err);
+        }
+      if (APR_STATUS_IS_EOF(err->apr_err))
+        add_done_item(ctx);
+
       return svn_error_trace(err);
     }
 
