Ref T32, utility functions for URL/URL list

* keep error messages of failed URLs
* append query
This commit is contained in:
Klaus Basan
2017-04-21 03:11:00 +02:00
parent cbe3122c40
commit 88ef2ee019
4 changed files with 26 additions and 12 deletions

View File

@@ -147,8 +147,16 @@ namespace BlackMisc
if (!failedUrl.isEmpty()) { this->addFailedUrl(failedUrl); }
if (!hasMoreUrlsToTry()) { return CUrl(); }
const CUrl url(this->obtainNextUrlWithout(random, this->m_failedUrls));
if (CNetworkUtils::canConnect(url)) { return url; }
if (addFailedUrl(url)) { return obtainNextWorkingUrl(); }
QString msg;
if (CNetworkUtils::canConnect(url, msg)) { return url; }
if (addFailedUrl(url))
{
if (!msg.isEmpty())
{
this->m_errorMsgs.append(QString("URL: %1 error: ").arg(url.toQString(), msg));
}
return obtainNextWorkingUrl();
}
return CUrl();
}