summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2004-12-13 07:29:38 +0000
committerRobey Pointer <robey@lag.net>2004-12-13 07:29:38 +0000
commitcaa8d4cf4166e134cc59a8acf4d4b6f07fd7c252 (patch)
tree4c15e97a32264cb329a75822944327a601cf1a83
parent2d9ad663ba6c2083a335d5863ee8d2d31d763ec9 (diff)
[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).
-rw-r--r--paramiko/transport.py36
1 files changed, 3 insertions, 33 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index 683324f1..4a3ab2be 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