You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2014/01/10 13:25:38 UTC

svn commit: r1557103 - /subversion/trunk/subversion/mod_dav_svn/version.c

Author: rhuijben
Date: Fri Jan 10 12:25:37 2014
New Revision: 1557103

URL: http://svn.apache.org/r1557103
Log:
Only add our option headers in the mod_dav_svn OPTIONS handler if the client
asks for our option(s). This avoids setting them over and over again if a
client asks for a list of options at once.

* subversion/mod_dav_svn/version.c
  (get_option): Following up on r1557094, only add our option headers when
    asked for our option; not for every (undefined) option.

Modified:
    subversion/trunk/subversion/mod_dav_svn/version.c

Modified: subversion/trunk/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/version.c?rev=1557103&r1=1557102&r2=1557103&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/version.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/version.c Fri Jan 10 12:25:37 2014
@@ -179,23 +179,29 @@ get_option(const dav_resource *resource,
   request_rec *r = resource->info->r;
 
   /* ### DAV:version-history-collection-set */
-  if (elem->ns == APR_XML_NS_DAV_ID)
+  if (elem->ns != APR_XML_NS_DAV_ID
+      || strcmp(elem->name, "activity-collection-set") != 0)
     {
-      if (strcmp(elem->name, "activity-collection-set") == 0)
-        {
-          apr_text_append(resource->pool, option,
-                          "<D:activity-collection-set>");
-          apr_text_append(resource->pool, option,
-                          dav_svn__build_uri(resource->info->repos,
-                                             DAV_SVN__BUILD_URI_ACT_COLLECTION,
-                                             SVN_INVALID_REVNUM, NULL,
-                                             1 /* add_href */,
-                                             resource->pool));
-          apr_text_append(resource->pool, option,
-                          "</D:activity-collection-set>");
-        }
+       /* We don't know about other options (yet).
+
+          If we ever add multiple option request keys we should
+          just write the requested option value and make sure
+          we set the headers *once*. */
+      return NULL;
     }
 
+  apr_text_append(resource->pool, option,
+                  "<D:activity-collection-set>");
+
+  apr_text_append(resource->pool, option,
+                  dav_svn__build_uri(resource->info->repos,
+                                     DAV_SVN__BUILD_URI_ACT_COLLECTION,
+                                     SVN_INVALID_REVNUM, NULL,
+                                     1 /* add_href */,
+                                     resource->pool));
+  apr_text_append(resource->pool, option,
+                  "</D:activity-collection-set>");
+
   /* If we're allowed (by configuration) to do so, advertise support
      for ephemeral transaction properties. */
   if (dav_svn__check_ephemeral_txnprops_support(r))