diff options
Diffstat (limited to 'launcher/net/Download.cpp')
-rw-r--r-- | launcher/net/Download.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp index cd3fcc85..4ea45c63 100644 --- a/launcher/net/Download.cpp +++ b/launcher/net/Download.cpp @@ -41,6 +41,7 @@ #include <QDateTime> #include <QFileInfo> +#include <memory> #include "ByteArraySink.h" #include "ChecksumValidator.h" @@ -69,7 +70,7 @@ auto Download::makeCached(QUrl url, MetaEntryPtr entry, Options options) -> Down return dl; } -auto Download::makeByteArray(QUrl url, QByteArray* output, Options options) -> Download::Ptr +auto Download::makeByteArray(QUrl url, std::shared_ptr<QByteArray> output, Options options) -> Download::Ptr { auto dl = makeShared<Download>(); dl->m_url = url; @@ -134,11 +135,14 @@ void Download::executeTask() request.setRawHeader("Authorization", token.toUtf8()); } +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + request.setTransferTimeout(); +#endif + m_last_progress_time = m_clock.now(); m_last_progress_bytes = 0; QNetworkReply* rep = m_network->get(request); - m_reply.reset(rep); connect(rep, &QNetworkReply::downloadProgress, this, &Download::downloadProgress); connect(rep, &QNetworkReply::finished, this, &Download::downloadFinished); |