adds py3 compat changes to network_cli plugin (#18735)

now calculates StringIO receive buffer and if received data is less than
buffer size, resets offset to 0
This commit is contained in:
Peter Sprygada 2016-12-03 20:05:33 -05:00 committed by GitHub
parent ea5c3df043
commit 8e562018ed

View file

@ -116,7 +116,8 @@ class Connection(_Connection):
data = self._shell.recv(256)
recv.write(data)
recv.seek(recv.tell() - 256)
offset = recv.tell() - 256 if recv.tell() > 256 else 0
recv.seek(offset)
window = self._strip(recv.read())