Hi,
On Thu, Feb 4, 2010 at 20:15, Nelson, Erik - 2
<eri...@ba...> wrote:
> I noticed that basic_uri::port always returns the same value for a given
> scheme... Is that by design? I see lots of web servers running on ports
> other than 80.
>
It shouldn't, this is the current implementation:
return parts_.port ? *(parts_.port) :
(boost::iequals(parts_.scheme,
string_type("https")) ? 443u : 80u);
As it's a boost::optional<boost::uint16_t> it first checks whether a
port is available in the uri_parts, this is the boolean operator of
the optional, reflected by "parts_.port", and if it is it will return
it, "*(parts_.port)". Otherwise it will check the scheme and return
443 if it is 'https' (case insensitve), and only if that's not the
case it will return 80.
> Thanks
>
> Erik
>
Jeroen
|