diff options
author | Jeremy T. Bouse <jbouse@debian.org> | 2014-09-22 09:21:39 -0400 |
---|---|---|
committer | Jeremy T. Bouse <jbouse@debian.org> | 2014-09-22 09:21:39 -0400 |
commit | 70f669a0a41e104bd0427e8ad9142071aae241ed (patch) | |
tree | a5c0a22c336514e1db001012a64d15477986b671 /paramiko/packet.py | |
parent | e9306cab7448e641a54789039f5c8bfe988de320 (diff) | |
parent | ccd643cdbd7ba752727d62051058a4454451414d (diff) | |
download | python-paramiko-70f669a0a41e104bd0427e8ad9142071aae241ed.tar python-paramiko-70f669a0a41e104bd0427e8ad9142071aae241ed.tar.gz |
Merge tag 'upstream/1.15.0'
Upstream version 1.15.0
Diffstat (limited to 'paramiko/packet.py')
-rw-r--r-- | paramiko/packet.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/paramiko/packet.py b/paramiko/packet.py index e97d92f..f516ff9 100644 --- a/paramiko/packet.py +++ b/paramiko/packet.py @@ -231,6 +231,7 @@ class Packetizer (object): def write_all(self, out): self.__keepalive_last = time.time() + iteration_with_zero_as_return_value = 0 while len(out) > 0: retry_write = False try: @@ -254,6 +255,15 @@ class Packetizer (object): n = 0 if self.__closed: n = -1 + else: + if n == 0 and iteration_with_zero_as_return_value > 10: + # We shouldn't retry the write, but we didn't + # manage to send anything over the socket. This might be an + # indication that we have lost contact with the remote side, + # but are yet to receive an EOFError or other socket errors. + # Let's give it some iteration to try and catch up. + n = -1 + iteration_with_zero_as_return_value += 1 if n < 0: raise EOFError() if n == len(out): |