Skip to content

Commit

Permalink
Merge pull request #41 from L-Super/patch-1
Browse files Browse the repository at this point in the history
fix: set timeout
  • Loading branch information
alex-spataru authored Dec 18, 2023
2 parents beed2db + 6765856 commit e4d8c73
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 e4d8c73

Please sign in to comment.