Author: kotkov
Date: Thu Aug 24 09:43:28 2017
New Revision: 1806017

URL: http://svn.apache.org/viewvc?rev=1806017&view=rev
Log:
ra_serf: Prevent the server from generating and sending the full MERGE
response in cases when we don't require it.

The full response is not required when working over HTTPv2 protocol.
When working over HTTPv1, it's only required when the new working copy
properties need to be stored as part of a commit (indicated by a non-null
svn_ra_push_wc_prop_func_t callback).

Disabling the full merge response is achieved by setting "no-merge-response"
in the X-SVN-Options header, and is something that was done by ra_neon,
but apparently, this optimization was not reimplemented in ra_serf.

* subversion/libsvn_ra_serf/merge.c
  (setup_merge_headers): Disable the full merge response in the majority
   of cases when it's not required.

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

Modified: subversion/trunk/subversion/libsvn_ra_serf/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/merge.c?rev=1806017&r1=1806016&r2=1806017&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/merge.c Thu Aug 24 09:43:28 2017
@@ -282,6 +282,16 @@ setup_merge_headers(serf_bucket_t *heade
                               SVN_DAV_OPTION_RELEASE_LOCKS);
     }
 
+  /* We don't need the full merge response when working over HTTPv2.
+   * Over HTTPv1, this response is only required with a non-null
+   * svn_ra_push_wc_prop_func_t callback. */
+  if (SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(ctx->session) ||
+      ctx->session->wc_callbacks->push_wc_prop == NULL)
+    {
+      serf_bucket_headers_set(headers, SVN_DAV_OPTIONS_HEADER,
+                              SVN_DAV_OPTION_NO_MERGE_RESPONSE);
+    }
+
   return SVN_NO_ERROR;
 }
 


Reply via email to