[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r34386 - in branches/http-protocol-v2/subversion: include mod_dav_svn

From: Greg Stein <gstein_at_gmail.com>
Date: Mon, 24 Nov 2008 20:29:36 -0800

On Mon, Nov 24, 2008 at 11:19, <sussman_at_tigris.org> wrote:
> Author: sussman
> Date: Mon Nov 24 11:19:48 2008
> New Revision: 34386
>
> Log:
> Refine the way mod_dav_svn returns v2 headers in an OPTIONS response.

Woot!

>...
> +++ branches/http-protocol-v2/subversion/include/svn_dav.h Mon Nov 24 11:19:48 2008 (r34386)
> @@ -81,6 +81,31 @@ extern "C" {
> universe of svn_lock_t->owner.) */
> #define SVN_DAV_LOCK_OWNER_HEADER "X-SVN-Lock-Owner"
>
> +/** Presence of this in a DAV header in an OPTIONS response indicates
> + * that the server speaks HTTP protocol v2. This header provides an
> + * opaque URI that the client should send all custom REPORT requests
> + * against. */
> +#define SVN_DAV_ROOT_STUB_HEADER "X-SVN-Root-Stub"

Please remove the X- prefix from these headers. That is no longer
considered "Best Practice" (*). Ideally, we'd switch the other header
names, too, but bleah... compat issues.

(*) http://twitter.com/mnot/status/1022120826

>...
> +++ branches/http-protocol-v2/subversion/mod_dav_svn/dav_svn.h Mon Nov 24 11:19:48 2008 (r34386)
> @@ -45,8 +45,8 @@ extern "C" {
>
> #define DAV_SVN__ROOT_STUB "!svn/me" /* where REPORTS are sent */
> #define DAV_SVN__PEGREV_STUB "!svn/bc" /* for accessing REV/PATH pairs */
> -#define DAV_SVN__REV_STUB "!svn/rev" /* for acccesing rev props */
> -#define DAV_SVN__TXN_STUB "!svn/txn" /* for accessing transactions */
> +#define DAV_SVN__REV_STUB "!svn/rev" /* revision resources */
> +#define DAV_SVN__TXN_STUB "!svn/txn" /* transaction resouces */
> #define DAV_SVN__TXNPROP_STUB "!svn/txp" /* for accessing txn props */

I just realized that these definitions won't work. Remember that the
"!svn" prefix is *configurable*. You'll need to use the configured
prefix.

>...
> +++ branches/http-protocol-v2/subversion/mod_dav_svn/version.c Mon Nov 24 11:19:48 2008 (r34386)
>...
> @@ -212,10 +198,10 @@ get_option(const dav_resource *resource,
> if ((serr == NULL)
> && SVN_IS_VALID_REVNUM(youngest))
> {
> - const char *text =
> - apr_psprintf(resource->pool, "<youngest-rev>%"
> - SVN_REVNUM_T_FMT "</youngest-rev>", youngest);
> - apr_text_append(resource->pool, option, text);
> + const char *yrtext =
> + apr_psprintf(resource->pool, "%"SVN_REVNUM_T_FMT, youngest);
> + apr_table_set(resource->info->r->headers_out,
> + SVN_DAV_YOUNGEST_REV_HEADER, yrtext);

I seem to recall somebody saying that SVN_REVNUM_T_FMT is deprecated.
That we just use %ld nowadays.

Yup. See svn_types.h... that constant is deprecated.

>...

Cheers,
-g

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-11-25 05:29:49 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.