mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-25 05:45:42 +03:00
Fix deadlock when using putmultifilejob with rate limits enabled
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
f28a1a368e
commit
a547f55f2f
1 changed files with 7 additions and 0 deletions
|
@ -44,6 +44,13 @@ void PutMultiFileJob::start()
|
||||||
QNetworkRequest req;
|
QNetworkRequest req;
|
||||||
|
|
||||||
for(const auto &oneDevice : _devices) {
|
for(const auto &oneDevice : _devices) {
|
||||||
|
// Our rate limits in UploadDevice::readData will cause an application freeze if used here.
|
||||||
|
// QHttpMultiPart's internal QHttpMultiPartIODevice::readData will loop over and over trying
|
||||||
|
// to read data from our UploadDevice while there is data left to be read; this will cause
|
||||||
|
// a deadlock as we will never have a chance to progress the data read
|
||||||
|
oneDevice._device->setChoked(false);
|
||||||
|
oneDevice._device->setBandwidthLimited(false);
|
||||||
|
|
||||||
auto onePart = QHttpPart{};
|
auto onePart = QHttpPart{};
|
||||||
|
|
||||||
onePart.setBodyDevice(oneDevice._device.get());
|
onePart.setBodyDevice(oneDevice._device.get());
|
||||||
|
|
Loading…
Reference in a new issue