~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/medium.py

(jelmer) Add a post_connect hook for transports. (Bazaar Developers)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    debug,
44
44
    errors,
45
45
    trace,
 
46
    transport,
46
47
    ui,
47
48
    urlutils,
48
49
    )
1021
1022
            raise AssertionError(
1022
1023
                "Unexpected io_kind %r from %r"
1023
1024
                % (io_kind, self._ssh_connection))
 
1025
        for hook in transport.Transport.hooks["post_connect"]:
 
1026
            hook(self)
1024
1027
 
1025
1028
    def _flush(self):
1026
1029
        """See SmartClientStreamMedium._flush()."""
1129
1132
            raise errors.ConnectionError("failed to connect to %s:%d: %s" %
1130
1133
                    (self._host, port, err_msg))
1131
1134
        self._connected = True
 
1135
        for hook in transport.Transport.hooks["post_connect"]:
 
1136
            hook(self)
1132
1137
 
1133
1138
 
1134
1139
class SmartClientAlreadyConnectedSocketMedium(SmartClientSocketMedium):