/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/smart.py

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)
867
871
 
868
872
    def stop_background_thread(self):
869
873
        self._should_terminate = True
 
874
        # At one point we would wait to join the threads here, but it looks
 
875
        # like they don't actually exit.  So now we just leave them running
 
876
        # and expect to terminate the process. -- mbp 20070215
870
877
        # self._server_socket.close()
871
 
        # we used to join the thread, but it's not really necessary; it will
872
 
        # terminate in time
 
878
        ## sys.stderr.write("waiting for server thread to finish...")
873
879
        ## self._server_thread.join()
874
880
 
875
881
 
1729
1735
    def __init__(self, url):
1730
1736
        _scheme, _username, _password, _host, _port, _path = \
1731
1737
            transport.split_url(url)
1732
 
        try:
1733
 
            _port = int(_port)
1734
 
        except (ValueError, TypeError), e:
1735
 
            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)
1736
1746
        medium = SmartTCPClientMedium(_host, _port)
1737
1747
        super(SmartTCPTransport, self).__init__(url, medium=medium)
1738
1748