Attempt to recover from network failures

QNetworkAccessManager which is  used for all network  traffic does not
automatically  recover  from  network  outages. This  patch  tries  to
reestablish network accessibility before any requests are attempted.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6471 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville
2016-02-20 12:55:18 +00:00
parent ad50294454
commit 2994a924e5
3 changed files with 22 additions and 7 deletions
+5
View File
@@ -109,6 +109,11 @@ bool RemoteFile::sync (QUrl const& url, bool local, bool force)
void RemoteFile::download (QUrl const& url)
{
if (QNetworkAccessManager::Accessible != network_manager_->networkAccessible ()) {
// try and recover network access for QNAM
network_manager_->setNetworkAccessible (QNetworkAccessManager::Accessible);
}
QNetworkRequest request {url};
request.setRawHeader ("User-Agent", "WSJT Sample Downloader");
request.setOriginatingObject (this);