-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Julian Foad wrote:
[..]
>> No, it should create a canonical URL. The fix we need is inside
>> svn_ra_neon__request_get_location(), or at least we need to look inside
>> that function to see where the non-canonical URL is coming from, and
>> maybe trace further back to find the cause of the problem.
>
> Oops, typo. Meant to ask for canonical. I'll give a shot to try where
> the non-canonicalized is possibly created in ..get_location().
`svn_ra_neon__request_get_location()' returns the non-canonical URL
which is obtained from the `ne_get_response_header()'(third party
function). Attaching the updated patch to canonicalize the URLs.
[[[
Log:
Ensure the URLs are canonical before passing to the new
`svn_path_url_add_component2()'.
[ in subversion/libsvn_ra_neon ]
* util.c
(svn_ra_neon__request_get_location): Canonicalize the 'BASE URL' as
`svn_path_url_add_component2()' won't handle it.
* props.c
(svn_ra_neon__get_baseline_info, svn_ra_neon__get_one_prop): Same.
* options.c
(svn_ra_neon__exchange_capabilities): Same.
Found by: stsp
Suggested by: stsp, julianfoad
Patch by: Kannan R <[email protected]>
]]]
- --
Thanks & Regards,
Kannan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEVAwUBSzDONnlTqcY7ytmIAQJGfwf9FfnMJJbYYEg3uimSYpvv2fOjwM5pf9DL
A7tWd3UxPq4gHza2mZYoXRZELnVo9xbKGozoxpQLUqcVmrS9dDZd+C/SUtypxMMz
QwNyC9VKre2DVvI9n9+VSQNU11eAwIVf86OHyln4fBpmqf9czKkqcjxphGntrhSa
iGpKHgFnILekScqIgvsqVu9Rs1tr89daQnlQVaDtHo9UVTm3MvyuOshZLLIEezUA
LmA1EyB0V/Y/uiE3JgXfY7hXm7o/b0fF1coQ9UDeqkR/Z8zADHh64y6dClxpKhVM
SU9e95JTNG1+XXmoCg1NC9VsOuQNDJRphEx/FpdSHWpmFa9U+Chfjw==
=GGUJ
-----END PGP SIGNATURE-----
Index: subversion/libsvn_ra_neon/util.c
===================================================================
--- subversion/libsvn_ra_neon/util.c (revision 893084)
+++ subversion/libsvn_ra_neon/util.c (working copy)
@@ -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;
}
Index: subversion/libsvn_ra_neon/props.c
===================================================================
--- subversion/libsvn_ra_neon/props.c (revision 893084)
+++ subversion/libsvn_ra_neon/props.c (working copy)
@@ -619,6 +619,7 @@
ne_propname props[2] = { { 0 } };
const char *name;
const svn_string_t *value;
+ svn_string_t *canonicalized_baseline_url;
props[0] = *propname;
SVN_ERR(svn_ra_neon__get_props_resource(&rsrc, sess, url, label, props,
@@ -634,7 +635,12 @@
name, url);
}
- *propval = value;
+ canonicalized_baseline_url = svn_string_create(svn_uri_canonicalize
+ (value->data,
+ pool),
+ pool);
+
+ *propval = canonicalized_baseline_url;
return SVN_NO_ERROR;
}
@@ -959,7 +965,7 @@
{
svn_ra_neon__resource_t *baseline_rsrc, *rsrc;
const svn_string_t *my_bc_url;
- svn_string_t my_bc_rel;
+ svn_string_t my_bc_rel, *canonicalized_bc_url;
/* Go fetch a BASELINE_RSRC that contains specific properties we
want. This routine will also fill in BC_RELATIVE as best it
@@ -989,9 +995,12 @@
"on the baseline resource"));
}
+ canonicalized_bc_url = svn_string_create(svn_uri_canonicalize(my_bc_url->data,
+ pool), pool);
+
/* maybe return bc_url to the caller */
if (bc_url)
- *bc_url = *my_bc_url;
+ *bc_url = *canonicalized_bc_url;
if (latest_rev != NULL)
{
Index: subversion/libsvn_ra_neon/options.c
===================================================================
--- subversion/libsvn_ra_neon/options.c (revision 893084)
+++ subversion/libsvn_ra_neon/options.c (working copy)
@@ -294,7 +294,7 @@
goto cleanup;
}
- ras->act_coll = apr_pstrdup(ras->pool, oc.activity_coll->data);
+ ras->act_coll = svn_uri_canonicalize(oc.activity_coll->data, ras->pool);
parse_capabilities(req->ne_req, ras, pool);
cleanup: