You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ko...@apache.org on 2015/09/23 18:34:48 UTC

svn commit: r1704891 - in /subversion/trunk/subversion: include/svn_dav.h libsvn_ra_serf/options.c mod_dav_svn/version.c

Author: kotkov
Date: Wed Sep 23 16:34:48 2015
New Revision: 1704891

URL: http://svn.apache.org/viewvc?rev=1704891&view=rev
Log:
Following up on r1704317, advertise svndiff1 support in mod_dav_svn servers.

When parsing OPTIONS responses in ra_serf, record that we can use svndiff1
upon seeing the new DAV header.  If there is no such header, use the current
approach of sending svndiff1 to servers that support Subversion's HTTPv2
protocol.

Related discussion is in http://svn.haxx.se/dev/archive-2015-09/0278.shtml
(Subject: "Re: svn commit: r1704317 - ...").

* subversion/include/svn_dav.h
  (SVN_DAV_NS_DAV_SVN_SVNDIFF1): New.

* subversion/mod_dav_svn/version.c
  (get_vsn_options): Advertise that svndiff1 is supported by the server.

* subversion/libsvn_ra_serf/options.c
  (capabilities_headers_iterator_callback): Record svndiff1 support if the
   server advertises it with the new header.  Update the related comment.

Suggested by: danielsh

Modified:
    subversion/trunk/subversion/include/svn_dav.h
    subversion/trunk/subversion/libsvn_ra_serf/options.c
    subversion/trunk/subversion/mod_dav_svn/version.c

Modified: subversion/trunk/subversion/include/svn_dav.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_dav.h?rev=1704891&r1=1704890&r2=1704891&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_dav.h (original)
+++ subversion/trunk/subversion/include/svn_dav.h Wed Sep 23 16:34:48 2015
@@ -386,6 +386,15 @@ extern "C" {
 #define SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS\
             SVN_DAV_PROP_NS_DAV "svn/reverse-file-revs"
 
+/** Presence of this in a DAV header in an OPTIONS response indicates
+ * that the transmitter (in this case, the server) knows how to handle
+ * svndiff1 format encoding.
+ *
+ * @since New in 1.10.
+ */
+#define SVN_DAV_NS_DAV_SVN_SVNDIFF1\
+            SVN_DAV_PROP_NS_DAV "svn/svndiff1"
+
 
 /** @} */
 

Modified: subversion/trunk/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/options.c?rev=1704891&r1=1704890&r2=1704891&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/options.c Wed Sep 23 16:34:48 2015
@@ -226,6 +226,12 @@ capabilities_headers_iterator_callback(v
         {
           session->supports_rev_rsrc_replay = TRUE;
         }
+      if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_SVNDIFF1, vals))
+        {
+          /* Use compressed svndiff1 format for servers that properly
+             advertise this capability (Subversion 1.10 and greater). */
+          session->supports_svndiff1 = TRUE;
+        }
     }
 
   /* SVN-specific headers -- if present, server supports HTTP protocol v2 */
@@ -243,7 +249,8 @@ capabilities_headers_iterator_callback(v
           apr_hash_set(session->supported_posts, "create-txn", 10, (void *)1);
         }
 
-      /* Use compressed svndiff1 format for servers that speak HTTPv2.
+      /* Use compressed svndiff1 format for servers that speak HTTPv2,
+         in addition to servers that send SVN_DAV_NS_DAV_SVN_SVNDIFF1.
 
          Apache HTTPd + mod_dav_svn servers support svndiff1, beginning
          from Subversion 1.4, but they do not advertise this capability.

Modified: subversion/trunk/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/version.c?rev=1704891&r1=1704890&r2=1704891&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/version.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/version.c Wed Sep 23 16:34:48 2015
@@ -152,6 +152,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INHERITED_PROPS);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INLINE_PROPS);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_REVERSE_FILE_REVS);
+  apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_SVNDIFF1);
   /* Mergeinfo is a special case: here we merely say that the server
    * knows how to handle mergeinfo -- whether the repository does too
    * is a separate matter.