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 | ccd643cdbd7ba752727d62051058a4454451414d (patch) | |
tree | 9bc89a6629132f474b3297735069d025145a965c /paramiko/packet.py | |
parent | 588a4823436454e8968ee36ae95ff92e1cddc3f7 (diff) | |
download | python-paramiko-fb4c0dd00e16f34601f088e6e760ffef08069535.tar python-paramiko-fb4c0dd00e16f34601f088e6e760ffef08069535.tar.gz |
Imported Upstream version 1.15.0upstream/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): |