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 2012/09/26 21:19:51 UTC

svn commit: r1390685 - /subversion/trunk/subversion/libsvn_ra_serf/update.c

Author: cmpilato
Date: Wed Sep 26 19:19:51 2012
New Revision: 1390685

URL: http://svn.apache.org/viewvc?rev=1390685&view=rev
Log:
For issue #4235 ("Inform HTTP caching proxies regarding the delta base
used in svndiff-style GET responses"), raise an error in the client if
the server reports a delta base that differs from the one we requested.

* subversion/libsvn_ra_serf/update.c
  (handle_fetch): Compare the X-SVN-VR-Base header value in the GET
    response with the one in the GET request.  If they differ, error
    out.  (But allow for the situation where the server failed to
    return the header at all, as will be true for pre-1.8 servers).

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/update.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1390685&r1=1390684&r2=1390685&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Wed Sep 26 19:19:51 2012
@@ -939,6 +939,17 @@ handle_fetch(serf_request_t *request,
               svn_txdelta_parse_svndiff(info->textdelta,
                                         info->textdelta_baton,
                                         TRUE, info->editor_pool);
+
+          /* Validate the delta base claimed by the server matches
+             what we asked for! */
+          val = serf_bucket_headers_get(hdrs, SVN_DAV_DELTA_BASE_HEADER);
+          if (val && (strcmp(val, info->delta_base) != 0))
+            {
+              err = svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+                                      _("GET request returned unexpected "
+                                        "delta base: %s"), val);
+              return error_fetch(request, fetch_ctx, err);
+            }
         }
       else
         {