Download related:

* Info which URL failed
* log redirects
* disabled CNetworkUtils::setSwiftClientSslCertificate(copiedReques
This commit is contained in:
Klaus Basan
2019-03-30 06:00:04 +01:00
committed by Mat Sutcliffe
parent 8571feda30
commit 0d0e093330
2 changed files with 5 additions and 2 deletions

View File

@@ -1846,6 +1846,7 @@ namespace BlackCore
{
if (this->isShuttingDown()) { return nullptr; }
if (!this->isNetworkAccessible()) { return nullptr; }
QWriteLocker locker(&m_accessManagerLock);
Q_ASSERT_X(CThreadUtils::isApplicationThreadObjectThread(m_accessManager), Q_FUNC_INFO, "Network manager supposed to be in main thread");
if (!CThreadUtils::isCurrentThreadObjectThread(m_accessManager))
@@ -1858,12 +1859,13 @@ namespace BlackCore
QNetworkRequest copiedRequest = CNetworkUtils::getSwiftNetworkRequest(request, this->getApplicationNameAndVersion());
// If URL is one of the shared URLs, add swift client SSL certificate to request
CNetworkUtils::setSwiftClientSslCertificate(copiedRequest, this->getGlobalSetup().getSwiftSharedUrls());
// CNetworkUtils::setSwiftClientSslCertificate(copiedRequest, this->getGlobalSetup().getSwiftSharedUrls());
QNetworkReply *reply = requestOrPostMethod(*m_accessManager, copiedRequest);
reply->setProperty("started", QVariant(QDateTime::currentMSecsSinceEpoch()));
reply->setProperty(CUrlLog::propertyNameId(), QVariant(logId));
const QUrl url(reply->url());
QString urlStr = url.toString();
if (progress)
{
@@ -1889,6 +1891,7 @@ namespace BlackCore
{
QNetworkRequest redirectRequest(redirectUrl);
const int redirectsLeft = maxRedirects - 1;
CLogMessage(sApp).info(u"Redirecting '%1' to '%2'") << urlStr << redirectUrl.toString();
this->httpRequestImplInQAMThread(redirectRequest, logId, callback, progress, redirectsLeft, requestOrPostMethod);
return;
}

View File

@@ -484,7 +484,7 @@ namespace BlackCore
const CUpdateInfo updateInfo = CUpdateInfo::fromDatabaseJson(updateInfoJsonString);
if (updateInfo.isEmpty())
{
CLogMessage(this).error(u"Loading of update info yielded no data");
CLogMessage(this).error(u"Loading of update info yielded no data, '%1'") << urlString;
this->manageUpdateInfoAvailability(false);
}
else