diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-21 01:48:34 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-05-21 01:48:34 -0700 |
commit | 79839771561641d6fa34549861a5ed163e382312 (patch) | |
tree | 3b0132349ab9b5d3108c5cb60991446eefdf768e /launcher/net/Download.cpp | |
parent | 21cb4598999808849eb18503f7aae54039c73cea (diff) | |
download | PrismLauncher-79839771561641d6fa34549861a5ed163e382312.tar.gz PrismLauncher-79839771561641d6fa34549861a5ed163e382312.tar.bz2 PrismLauncher-79839771561641d6fa34549861a5ed163e382312.zip |
feat: Qt 5.15 adds transfer timeouts. at least use it for downloads
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/net/Download.cpp')
-rw-r--r-- | launcher/net/Download.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp index cd3fcc85..7f8d3a06 100644 --- a/launcher/net/Download.cpp +++ b/launcher/net/Download.cpp @@ -134,11 +134,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); |