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

Re: [PATCH] Virtual host mode with user name in URL

From: Thomas Quinot <quinot_at_adacore.com>
Date: Thu, 15 Feb 2018 16:54:18 +0100

* Philip Martin, 2018-02-15 :

> That looks correct so far, but it leads me to consider port numbers.
>
> svn ls svn://hostname:3691/repo
>
> Should the server look for the repository under 'hostname:3691' or under
> the plain 'hostname'? I suspect the port number should be ignored and
> that the plain 'hostname' is correct and that makes the current
> behaviour another bug. We might be better off using apr_uri_parse()
> rather than writing our own parsing code here.

Thanks for your feedback Philip!

I also thought about port numbers, and I think that's a different
situations. I would view URLs differring only in the user name:
  svn://svn.example.com/
  svn://foo@svn.example.com/
  svn://bar@svn.example.com/
as "clearly" referring to the same server/repo in all three cases.

On the other hand, I can see legitimate use cases where:
  svn://svn.example.com/
  svn://svn.example.com:3691/
would refer to *different* servers/repos, in which case it makes sense
to *include* the port number in the path when operating in virtual host
mode.

Conversely, in use cases where the intent actually is for both
URLs to denote the same underlying server, one can use a
symbolic link svn.example.com:3691 -> svn.example.com.

Unlike the set of user names, I would expect the set of ports
for which an svnserve process is listening to be "small" and "static"
enough that this is a viable approach.

Good remark about apr_uri_parse. Not clear it will substantially
simplify the code (will require introducing an apr_sprintf call,
and potentially conditional code depending on if and when a port
number needs to be explicitly included), but certainly cleaner from
a conceptual standpoint.

-- 
Thomas Quinot, Ph.D. ** quinot_at_adacore.com ** IT Lead Engineer
               AdaCore -- Paris, France -- New York, USA
Received on 2018-02-15 16:54:29 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.