You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/01/21 18:40:50 UTC

svn commit: r901797 - in /subversion/trunk/subversion/libsvn_ra_neon: options.c props.c ra_neon.h util.c

Author: julianfoad
Date: Thu Jan 21 17:40:50 2010
New Revision: 901797

URL: http://svn.apache.org/viewvc?rev=901797&view=rev
Log:
Ensure the URLs in libsvn_ra_neon are always canonical.

* subversion/libsvn_ra_neon/ra_neon.h
  (svn_ra_neon__request_get_location): Update doc string to reflect that
   it returns a canonicalized URL.

* subversion/libsvn_ra_neon/util.c
  (svn_ra_neon__request_get_location): Canonicalize the 'BASE URL' as
   per the rule.

* subversion/libsvn_ra_neon/props.c
  (end_element): Same.

* subversion/libsvn_ra_neon/options.c
  (end_element): Same.

Found by: stsp
Suggested by: stsp, julianfoad
Patch by: Kannan R <kannanr{_AT_}collab.net>

Modified:
    subversion/trunk/subversion/libsvn_ra_neon/options.c
    subversion/trunk/subversion/libsvn_ra_neon/props.c
    subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h
    subversion/trunk/subversion/libsvn_ra_neon/util.c

Modified: subversion/trunk/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/options.c?rev=901797&r1=901796&r2=901797&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/options.c Thu Jan 21 17:40:50 2010
@@ -25,6 +25,7 @@
 
 #include "svn_pools.h"
 #include "svn_error.h"
+#include "svn_dirent_uri.h"
 #include "svn_private_config.h"
 #include "../libsvn_ra/ra_loader.h"
 
@@ -107,7 +108,9 @@
   options_ctx_t *oc = baton;
 
   if (state == ELEM_href)
-    oc->activity_coll = svn_string_create_from_buf(oc->cdata, oc->pool);
+    oc->activity_coll = svn_string_create(svn_uri_canonicalize(oc->cdata->data,
+                                                               oc->pool),
+                                          oc->pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/props.c?rev=901797&r1=901796&r2=901797&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/props.c Thu Jan 21 17:40:50 2010
@@ -413,7 +413,8 @@
     case ELEM_href:
       /* Special handling for <href> that belongs to the <response> tag. */
       if (rsrc->href_parent == ELEM_response)
-        return assign_rsrc_url(pc->rsrc, cdata, pc->pool);
+        return assign_rsrc_url(pc->rsrc, svn_uri_canonicalize(cdata, pc->pool),
+                               pc->pool);
 
       /* Use the parent element's name, not the href. */
       parent_defn = defn_from_id(rsrc->href_parent);

Modified: subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h?rev=901797&r1=901796&r2=901797&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/ra_neon.h Thu Jan 21 17:40:50 2010
@@ -973,6 +973,7 @@
                   apr_pool_t *pool);
 
 /* Return the Location HTTP header or NULL if none was sent.
+ * (Return a canonical URL even if the header ended with a slash.)
  *
  * Do allocations in POOL.
  */

Modified: subversion/trunk/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_neon/util.c?rev=901797&r1=901796&r2=901797&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/trunk/subversion/libsvn_ra_neon/util.c Thu Jan 21 17:40:50 2010
@@ -1490,5 +1490,5 @@
                                   apr_pool_t *pool)
 {
   const char *val = ne_get_response_header(request->ne_req, "Location");
-  return val ? apr_pstrdup(pool, val) : NULL;
+  return val ? svn_uri_canonicalize(val, pool) : NULL;
 }



Re: svn commit: r901797 - in /subversion/trunk/subversion/libsvn_ra_neon: options.c props.c ra_neon.h util.c

Posted by Stefan Sperling <st...@elego.de>.
On Thu, Jan 21, 2010 at 05:40:50PM -0000, julianfoad@apache.org wrote:
> Author: julianfoad
> Date: Thu Jan 21 17:40:50 2010
> New Revision: 901797
> 
> URL: http://svn.apache.org/viewvc?rev=901797&view=rev
> Log:
> Ensure the URLs in libsvn_ra_neon are always canonical.
 
> Found by: stsp
> Suggested by: stsp, julianfoad
> Patch by: Kannan R <kannanr{_AT_}collab.net>

Nice work, thank you!

Stefan