Skip to content

Commit

Permalink
fix: set timeout
Browse files Browse the repository at this point in the history
Closes #40
  • Loading branch information
L-Super committed Dec 17, 2023
1 parent beed2db commit 6765856
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ void Downloader::startDownload(const QUrl &url)
QNetworkRequest request(url);

request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);

#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
/* 10s timeout */
request.setTransferTimeout(10000);
#endif

if (!m_userAgentString.isEmpty())
request.setRawHeader("User-Agent", m_userAgentString.toUtf8());
Expand Down

0 comments on commit 6765856

Please sign in to comment.