~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/smart.py

  • Committer: Robert Collins
  • Date: 2007-03-05 03:43:56 UTC
  • mfrom: (2312 +trunk)
  • mto: (2255.11.6 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: robertc@robertcollins.net-20070305034356-og43j35eg62m952f
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
del scheme
224
224
 
225
225
 
 
226
# Port 4155 is the default port for bzr://, registered with IANA.
 
227
BZR_DEFAULT_PORT = 4155
 
228
 
 
229
 
226
230
def _recv_tuple(from_file):
227
231
    req_line = from_file.readline()
228
232
    return _decode_tuple(req_line)
1731
1735
    def __init__(self, url):
1732
1736
        _scheme, _username, _password, _host, _port, _path = \
1733
1737
            transport.split_url(url)
1734
 
        try:
1735
 
            _port = int(_port)
1736
 
        except (ValueError, TypeError), e:
1737
 
            raise errors.InvalidURL(path=url, extra="invalid port %s" % _port)
 
1738
        if _port is None:
 
1739
            _port = BZR_DEFAULT_PORT
 
1740
        else:
 
1741
            try:
 
1742
                _port = int(_port)
 
1743
            except (ValueError, TypeError), e:
 
1744
                raise errors.InvalidURL(
 
1745
                    path=url, extra="invalid port %s" % _port)
1738
1746
        medium = SmartTCPClientMedium(_host, _port)
1739
1747
        super(SmartTCPTransport, self).__init__(url, medium=medium)
1740
1748