summaryrefslogtreecommitdiff
path: root/paramiko/transport.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2016-12-12 15:29:06 -0800
committerJeff Forcier <jeff@bitprophet.org>2016-12-12 15:29:06 -0800
commit5f25e08691f9c1b49863cb112968c7ea1868c7d8 (patch)
treeb5750bac755da992528620c9e0ed5d7875ff7fd4 /paramiko/transport.py
parenta3c35766b21e9e2a46213116d478c17c757d1534 (diff)
downloadparamiko-5f25e08691f9c1b49863cb112968c7ea1868c7d8.tar.gz
Revert "Add timeout to Transport.start_client()"
This reverts commit 5c7f30be9737f73fd024a23f5db0b6a7578026b6.
Diffstat (limited to 'paramiko/transport.py')
-rw-r--r--paramiko/transport.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index 7906c9f2..71d5109e 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -1,5 +1,4 @@
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
-# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
@@ -446,7 +445,7 @@ class Transport (threading.Thread, ClosingContextManager):
# We need the FQDN to get this working with SSPI
self.gss_host = socket.getfqdn(gss_host)
- def start_client(self, event=None, timeout=None):
+ def start_client(self, event=None):
"""
Negotiate a new SSH2 session as a client. This is the first step after
creating a new `.Transport`. A separate thread is created for protocol
@@ -457,7 +456,7 @@ class Transport (threading.Thread, ClosingContextManager):
be triggered. On failure, `is_active` will return ``False``.
(Since 1.4) If ``event`` is ``None``, this method will not return until
- negotiation is done. On success, the method returns normally.
+ negotation is done. On success, the method returns normally.
Otherwise an SSHException is raised.
After a successful negotiation, you will usually want to authenticate,
@@ -474,9 +473,6 @@ class Transport (threading.Thread, ClosingContextManager):
:param .threading.Event event:
an event to trigger when negotiation is complete (optional)
- :param float timeout:
- a timeout, in seconds, for SSH2 session negotiation (optional)
-
:raises SSHException: if negotiation fails (and no ``event`` was passed
in)
"""
@@ -490,7 +486,6 @@ class Transport (threading.Thread, ClosingContextManager):
# synchronous, wait for a result
self.completion_event = event = threading.Event()
self.start()
- max_time = time.time() + timeout if timeout is not None else None
while True:
event.wait(0.1)
if not self.active:
@@ -498,7 +493,7 @@ class Transport (threading.Thread, ClosingContextManager):
if e is not None:
raise e
raise SSHException('Negotiation failed.')
- if event.is_set() or (timeout is not None and time.time() >= max_time):
+ if event.is_set():
break
def start_server(self, event=None, server=None):