diff options
author | Robey Pointer <robey@lag.net> | 2005-03-25 20:06:56 +0000 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2005-03-25 20:06:56 +0000 |
commit | 3e5bd84cc58fc6db485c5a188ac0ef90280b2804 (patch) | |
tree | 64d98843bf184d60aa6fe34a92992275e41eaf9d | |
parent | fead211c5ca75b654c218c6bcfc75552284719c6 (diff) |
[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-155]
fix sending of large sftp packet sizes
fix a bug where packets larger than about 12KB would cause the session to
die on platforms other than osx. turns out that on most platforms, setting a
socket timeout also causes timeouts to occur on writes (but not on osx). so
on a huge write, once the os buffers were full, paramiko would get a
socket.timeout exception when writing, and bail.
since the timeout is primarily so we can periodically poll to see if the
session has been killed from elsewhere, do that on a timeout but otherwise
continue trying to write. large packet sizes (in sftp) should now work.
-rw-r--r-- | paramiko/transport.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py index b03e0078..f8a52365 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -889,6 +889,10 @@ class BaseTransport (threading.Thread): while len(out) > 0: try: n = self.sock.send(out) + except socket.timeout: + n = 0 + if not self.active: + n = -1 except Exception, x: # could be: (32, 'Broken pipe') n = -1 |