> -----Original Message----- > From: Kamesh Jayachandran [mailto:kam...@collab.net] > Sent: vrijdag 26 februari 2010 16:29 > To: comm...@subversion.apache.org > Subject: Re: svn commit: r916286 - in > /subversion/trunk/subversion/mod_dav_svn: dav_svn.h mirror.c > mod_dav_svn.c > > On 02/25/2010 11:36 PM, Julian Foad wrote: > > On Thu, 2010-02-25 at 20:45 +0530, Kamesh Jayachandran wrote: > > > >> On 02/25/2010 08:29 PM, Julian Foad wrote: > >> > >>> kame...@apache.org wrote: > >>> > > [...] > > > >>>> - if (strcmp(uri.path, root_dir) == 0) { > >>>> + if (uri.path) > >>>> + canonicalized_uri = svn_dirent_canonicalize(uri.path, r->pool); > >>>> > >>>> > >>> Oops, you called "dirent_canonicalize" on a URI. > >>> > >> Is there any uri canonicalize function?. > >> > > svn_uri_canonicalize() if it's a URI (in which non-URI characters must > > be escaped as '%XX'). > > > > > > Ok, I wanted to see the failure in my eyes before attempting to fix the > same. > > Following are my observations, > > <Location "/svn 1/"> > DAV svn > SVNParentPath /repositories > </Location> > <Location "/svn 2/"> > DAV svn > SVNParentPath /repositories-slave > SVNMasterURI "http://localhost/svn 1" > </Location> > > I could not see the difference between "svn_uri_canonicalize()" and > svn_dirent_canonicalize() for the above configuration, by the way both > fails while proxying. > > I have an upcoming local patch in progress attempting to fix the same.
Is it a local disk path? If no, then never use svn_dirent_*() on it. (If yes, always use svn_dirent_*() on it) svn_dirent_*() has platform dependent behavior. You might not see it on your OS, but the canonicalization rules for dirents are defined by your platform. Just a few simple examples: The canonical format of 'a:/': * On linux: 'a:' (never end a path with a '/', except for the root directory) * On Windows: 'A:/' (Drive letters always uppercase and in this case followed by a '/', as 'A:' refers to the current directory on drive A:) 'C:hi' is a dirent to the file named 'C:hi' on Linux, but on Windows it is a dirent pointing to the file 'hi' in the current directory of drive C:. If you use svn_uri_*(), these paths are handled the same, which is most likely what you want. The <Location> tag defines the path space on your webserver. Bert