am 9bdedb59: am a36e1aa3: Merge "adb: usb_windows: fix adb connection lost issue"
* commit '9bdedb599874278abf206230ed31010eeb9b40dd': adb: usb_windows: fix adb connection lost issue
This commit is contained in:
commit
9dbcbe0875
|
@ -255,7 +255,7 @@ usb_handle* do_usb_open(const wchar_t* interface_name) {
|
|||
}
|
||||
|
||||
int usb_write(usb_handle* handle, const void* data, int len) {
|
||||
unsigned long time_out = 500 + len * 8;
|
||||
unsigned long time_out = 5000;
|
||||
unsigned long written = 0;
|
||||
int ret;
|
||||
|
||||
|
@ -300,7 +300,7 @@ int usb_write(usb_handle* handle, const void* data, int len) {
|
|||
}
|
||||
|
||||
int usb_read(usb_handle *handle, void* data, int len) {
|
||||
unsigned long time_out = 500 + len * 8;
|
||||
unsigned long time_out = 0;
|
||||
unsigned long read = 0;
|
||||
int ret;
|
||||
|
||||
|
@ -322,7 +322,7 @@ int usb_read(usb_handle *handle, void* data, int len) {
|
|||
|
||||
if (len == 0)
|
||||
return 0;
|
||||
} else if (saved_errno != ERROR_SEM_TIMEOUT) {
|
||||
} else {
|
||||
// assume ERROR_INVALID_HANDLE indicates we are disconnected
|
||||
if (saved_errno == ERROR_INVALID_HANDLE)
|
||||
usb_kick(handle);
|
||||
|
|
Loading…
Reference in New Issue