summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2017-02-22 13:34:10 +0200
committerKari Oikarinen <kari.oikarinen@qt.io>2017-03-24 14:15:51 +0000
commit86ac7b459b580d88de8ddb6721ccfce6b4f466ae (patch)
tree52d00947878117e6755db0504c835948c0176f01
parentb43f96f322abe956d0864694af3e8c1bf9e1d7dc (diff)
Give up after 5 errors in UsbConnectionReader
Previously a zero-length read was raised as a sign of error every 5 errors. However this meant reams of errors and invalid messages being sent if a Connection was active to the device while it was unplugged. The first invalid message is sufficient, since Connection will reset in response. Change-Id: I44cd5e90edf84aee1680f1852b637c0c2b590b2e Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
-rw-r--r--qdb/server/usb-host/usbconnectionreader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qdb/server/usb-host/usbconnectionreader.cpp b/qdb/server/usb-host/usbconnectionreader.cpp
index 3411a40..0e0eed3 100644
--- a/qdb/server/usb-host/usbconnectionreader.cpp
+++ b/qdb/server/usb-host/usbconnectionreader.cpp
@@ -54,7 +54,7 @@ void UsbConnectionReader::executeRead()
++m_errorCount;
if (m_errorCount == 5) {
emit newRead(QByteArray{});
- m_errorCount = 0;
+ return; // Quit reading, this connection has failed.
}
}
} else {