Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1794)

Unified Diff: appengine/third_party/python-adb/adb/filesync_protocol.py

Issue 2279033003: swarming: Bump python-adb to 6e66b... (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/third_party/python-adb/adb/filesync_protocol.py
diff --git a/appengine/third_party/python-adb/adb/filesync_protocol.py b/appengine/third_party/python-adb/adb/filesync_protocol.py
index a885e2b2e22f9758a07f670bd429718ba47c9541..87aa3fb7a4b27deaca8f1de4365be36cb8a77807 100644
--- a/appengine/third_party/python-adb/adb/filesync_protocol.py
+++ b/appengine/third_party/python-adb/adb/filesync_protocol.py
@@ -207,6 +207,9 @@ class FileSyncConnection(object):
chunk = self.send_buffer[:self.adb.max_packet_size]
try:
self.adb.Write(chunk)
+ # Wait for ack from device, ignoring these for too long causes things
+ # to explode.
+ self.adb.ReadUntil('OKAY')
except libusb1.USBError as e:
self.send_buffer = ''
raise usb_exceptions.WriteFailedError('Could not write %r' % chunk, e)
@@ -216,11 +219,11 @@ class FileSyncConnection(object):
# Ensure recv buffer has enough data.
while len(self.recv_buffer) < size:
try:
- _, data = self.adb.ReadUntil('WRTE')
+ msg = self.adb.ReadUntil('WRTE')
except adb_protocol.InvalidResponseError as e:
raise usb_exceptions.AdbCommandFailureException(
'Command failed: %s' % e)
- self.recv_buffer += data
+ self.recv_buffer += msg.data
result = self.recv_buffer[:size]
self.recv_buffer = self.recv_buffer[size:]
« no previous file with comments | « appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698