Transports should explicitly track whether a port was specified
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Undecided
|
Vincent Ladeuil |
Bug Description
If a URL does not include an explicit port in its netloc (e.g. "http://
However, it's not strictly correct for all protocols that having a standard port means we can consider a URL with an explicit port equal to the standard port the same as an otherwise-identical URL with no port. For instance "bzr+ssh:
So the Transport interface (particularly ConnectedTransp
It would also make it possible for us to record and display back to the user URLs like "http://
Changed in bzr: | |
status: | New → In Progress |
Changed in bzr: | |
status: | In Progress → Fix Committed |
Changed in bzr: | |
milestone: | none → 1.0rc1 |
status: | Fix Committed → Fix Released |
Martin suggested:
When parsing a url, if no port is specified, leave it as None in the
parsed tuple or transport. When unparsing them, None goes back to
unspecified and any explicit port, even the default, is explicitly
shown.
The default port only comes in at the point of opening the network
socket if it's still None -- often this will be done inside pycurl or
something rather than bzrlib.
The only drawback is that if we ever get proto://foo/ and /foo:defaultpor t/ they won't be parsed the same way. We can host:80/ with the
proto:/
specifically list which protocols can or can't do this. On the other
hand I'm not sure it's really critical - if we just keep urls as
they're passed in, then we should rarely see http://
port number.