Skip to content

Commit

Permalink
fixup! fix: prevent deadlockwith stuck bulk transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Oct 13, 2024
1 parent 1d1a5e9 commit 683fac2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/controllers/bulk/bulkcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
#include "controllers/bulk/bulksupported.h"
#include "controllers/defs_controllers.h"
#include "moc_bulkcontroller.cpp"
#include "util/cmdlineargs.h"
#include "util/time.h"
#include "util/trace.h"

namespace {
constexpr unsigned int kBulkSendTimeoutMs = 5000; // In milliseconds
}

BulkReader::BulkReader(libusb_device_handle *handle, unsigned char in_epaddr)
: QThread(),
m_phandle(handle),
Expand Down Expand Up @@ -304,7 +299,8 @@ void BulkController::sendBytes(const QByteArray& data) {
(unsigned char*)data.constData(),
data.size(),
&transferred,
kBulkSendTimeoutMs);
5000 // Send timeout in milliseconds
);
if (ret < 0) {
qCWarning(m_logOutput) << "Unable to send data to" << getName()
<< "serial #" << m_sUID << "-" << libusb_error_name(ret);
Expand Down

0 comments on commit 683fac2

Please sign in to comment.