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/08/20 19:32:57 UTC
svn commit: r1375123 - in /subversion/trunk/subversion: include/svn_dav.h
mod_dav_svn/dav_svn.h mod_dav_svn/version.c
Author: cmpilato
Date: Mon Aug 20 17:32:56 2012
New Revision: 1375123
URL: http://svn.apache.org/viewvc?rev=1375123&view=rev
Log:
Teach mod_dav_svn to advertise the supported POST types. This was
work intended for the original HTTPv2 release that just never
happened. (It wasn't strictly necessary.)
* subversion/include/svn_dav.h
(SVN_DAV_SUPPORTED_POSTS_HEADER): New #define.
* subversion/mod_dav_svn/dav_svn.h
(dav_svn__posts_list): Uncomment this static variable.
* subversion/mod_dav_svn/version.c
(get_option): Add the list (heheh...) of supported POST types in the
OPTIONS response when v2 is being advertised.
Modified:
subversion/trunk/subversion/include/svn_dav.h
subversion/trunk/subversion/mod_dav_svn/dav_svn.h
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=1375123&r1=1375122&r2=1375123&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_dav.h (original)
+++ subversion/trunk/subversion/include/svn_dav.h Mon Aug 20 17:32:56 2012
@@ -177,6 +177,13 @@ extern "C" {
* @since New in 1.7. */
#define SVN_DAV_VTXN_NAME_HEADER "SVN-VTxn-Name"
+/** This header is used in the OPTIONS response to identify named
+ * skel-based POST request types which the server is prepared to
+ * handle. (HTTP protocol v2 only)
+ * @since New in 1.8. */
+#define SVN_DAV_SUPPORTED_POSTS_HEADER "SVN-Supported-Posts"
+
+
/**
* @name Fulltext MD5 headers
*
Modified: subversion/trunk/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/dav_svn.h?rev=1375123&r1=1375122&r2=1375123&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/trunk/subversion/mod_dav_svn/dav_svn.h Mon Aug 20 17:32:56 2012
@@ -671,13 +671,11 @@ dav_svn__get_deleted_rev_report(const da
/*** posts/ ***/
/* The list of Subversion's custom POSTs. */
-/* ### TODO: Populate this list and transmit its contents in the
- ### OPTIONS response.
static const char * dav_svn__posts_list[] = {
"create-txn",
NULL
};
-*/
+
/* The various POST handlers, defined in posts/, and used by repos.c. */
dav_error *
Modified: subversion/trunk/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/version.c?rev=1375123&r1=1375122&r2=1375123&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/version.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/version.c Mon Aug 20 17:32:56 2012
@@ -234,6 +234,8 @@ get_option(const dav_resource *resource,
DeltaV-free! If we're configured to advise this support, do so. */
if (resource->info->repos->v2_protocol)
{
+ const char **this_post = dav_svn__posts_list;
+
apr_table_set(r->headers_out, SVN_DAV_ROOT_URI_HEADER, repos_root_uri);
apr_table_set(r->headers_out, SVN_DAV_ME_RESOURCE_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
@@ -256,6 +258,15 @@ get_option(const dav_resource *resource,
apr_table_set(r->headers_out, SVN_DAV_VTXN_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
dav_svn__get_vtxn_stub(r), (char *)NULL));
+
+ /* Report the supported POST types. */
+ while (*this_post)
+ {
+ apr_table_addn(r->headers_out, SVN_DAV_SUPPORTED_POSTS_HEADER,
+ apr_pstrcat(resource->pool, *this_post,
+ (char *)NULL));
+ this_post++;
+ }
}
return NULL;