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

Re: [PATCH] Send path with lock token to fix issue 4369

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 31 May 2013 20:17:20 +0100

Philip Martin <philip.martin_at_wandisco.com> writes:

> What sort of URI do we have to supply? Will a session relative <f> do?
> Or a server relative </obj/repo/A/f>? Or a full scheme/host/port/path?

RFC 2518 says:

9.4 If Header

   If = "If" ":" ( 1*No-tag-list | 1*Tagged-list)
   No-tag-list = List
   Tagged-list = Resource 1*List
   Resource = Coded-URL
   List = "(" 1*(["Not"](State-token | "[" entity-tag "]")) ")"
   State-token = Coded-URL
   Coded-URL = "<" absoluteURI ">"

   Note that the absoluteURI production is defined in [RFC2396].

and 2396 says

   absoluteURI = scheme ":" ( hier_part | opaque_part )

so how about this patch:

Index: subversion/libsvn_ra_serf/commit.c
===================================================================
--- subversion/libsvn_ra_serf/commit.c (revision 1488294)
+++ subversion/libsvn_ra_serf/commit.c (working copy)
@@ -804,8 +804,15 @@
       if (token)
         {
           const char *token_header;
+ const char *token_uri;
+ apr_uri_t uri = commit_ctx->session->session_url;
 
- token_header = apr_pstrcat(pool, "(<", token, ">)", (char *)NULL);
+ uri.path = (char *)svn_path_url_add_component2(uri.path, relpath,
+ pool);
+ token_uri = apr_uri_unparse(pool, &uri, 0);
+
+ token_header = apr_pstrcat(pool, "<", token_uri, "> (<", token, ">)",
+ (char *)NULL);
           serf_bucket_headers_set(headers, "If", token_header);
         }
     }

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download
Received on 2013-05-31 21:17:57 CEST

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.