From caa8d4cf4166e134cc59a8acf4d4b6f07fd7c252 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Mon, 13 Dec 2004 07:29:38 +0000 Subject: [PATCH] [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-131] move check_global_request move check_global_request into the server interface -- i missed it during the initial move (oops). --- paramiko/transport.py | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/paramiko/transport.py b/paramiko/transport.py index 683324f..4a3ab2b 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -193,7 +193,7 @@ class BaseTransport (threading.Thread): @param sock: a socket or socket-like object to create the session over. @type sock: socket - """ + """ if type(sock) is str: # convert "host:port" into (host, port) hl = sock.split(':', 1) @@ -491,7 +491,7 @@ class BaseTransport (threading.Thread): Request a new channel to the server. L{Channel}s are socket-like objects used for the actual transfer of data across the session. You may only request a channel after negotiating encryption (using - L{connect} or L{start_client} and authenticating. + L{connect} or L{start_client}) and authenticating. @param kind: the kind of channel requested (usually C{"session"}, C{"forwarded-tcpip"} or C{"direct-tcpip"}). @@ -650,36 +650,6 @@ class BaseTransport (threading.Thread): break return self.global_response - def check_global_request(self, kind, msg): - """ - I{(subclass override)} - Handle a global request of the given C{kind}. This method is called - in server mode and client mode, whenever the remote host makes a global - request. If there are any arguments to the request, they will be in - C{msg}. - - There aren't any useful global requests defined, aside from port - forwarding, so usually this type of request is an extension to the - protocol. - - If the request was successful and you would like to return contextual - data to the remote host, return a tuple. Items in the tuple will be - sent back with the successful result. (Note that the items in the - tuple can only be strings, ints, longs, or bools.) - - The default implementation always returns C{False}, indicating that it - does not support any global requests. - - @param kind: the kind of global request being made. - @type kind: str - @param msg: any extra arguments to the request. - @type msg: L{Message} - @return: C{True} or a tuple of data if the request was granted; - C{False} otherwise. - @rtype: bool - """ - return False - def accept(self, timeout=None): self.lock.acquire() try: @@ -1380,7 +1350,7 @@ class BaseTransport (threading.Thread): kind = m.get_string() self._log(DEBUG, 'Received global request "%s"' % kind) want_reply = m.get_boolean() - ok = self.check_global_request(kind, m) + ok = self.server_object.check_global_request(kind, m) extra = () if type(ok) is tuple: extra = ok