mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 07:15:34 +08:00
Download related:
* Info which URL failed * log redirects * disabled CNetworkUtils::setSwiftClientSslCertificate(copiedReques
This commit is contained in:
committed by
Mat Sutcliffe
parent
8571feda30
commit
0d0e093330
@@ -1846,6 +1846,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
if (this->isShuttingDown()) { return nullptr; }
|
if (this->isShuttingDown()) { return nullptr; }
|
||||||
if (!this->isNetworkAccessible()) { return nullptr; }
|
if (!this->isNetworkAccessible()) { return nullptr; }
|
||||||
|
|
||||||
QWriteLocker locker(&m_accessManagerLock);
|
QWriteLocker locker(&m_accessManagerLock);
|
||||||
Q_ASSERT_X(CThreadUtils::isApplicationThreadObjectThread(m_accessManager), Q_FUNC_INFO, "Network manager supposed to be in main thread");
|
Q_ASSERT_X(CThreadUtils::isApplicationThreadObjectThread(m_accessManager), Q_FUNC_INFO, "Network manager supposed to be in main thread");
|
||||||
if (!CThreadUtils::isCurrentThreadObjectThread(m_accessManager))
|
if (!CThreadUtils::isCurrentThreadObjectThread(m_accessManager))
|
||||||
@@ -1858,12 +1859,13 @@ namespace BlackCore
|
|||||||
QNetworkRequest copiedRequest = CNetworkUtils::getSwiftNetworkRequest(request, this->getApplicationNameAndVersion());
|
QNetworkRequest copiedRequest = CNetworkUtils::getSwiftNetworkRequest(request, this->getApplicationNameAndVersion());
|
||||||
|
|
||||||
// If URL is one of the shared URLs, add swift client SSL certificate to request
|
// 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);
|
QNetworkReply *reply = requestOrPostMethod(*m_accessManager, copiedRequest);
|
||||||
reply->setProperty("started", QVariant(QDateTime::currentMSecsSinceEpoch()));
|
reply->setProperty("started", QVariant(QDateTime::currentMSecsSinceEpoch()));
|
||||||
reply->setProperty(CUrlLog::propertyNameId(), QVariant(logId));
|
reply->setProperty(CUrlLog::propertyNameId(), QVariant(logId));
|
||||||
const QUrl url(reply->url());
|
const QUrl url(reply->url());
|
||||||
|
QString urlStr = url.toString();
|
||||||
|
|
||||||
if (progress)
|
if (progress)
|
||||||
{
|
{
|
||||||
@@ -1889,6 +1891,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
QNetworkRequest redirectRequest(redirectUrl);
|
QNetworkRequest redirectRequest(redirectUrl);
|
||||||
const int redirectsLeft = maxRedirects - 1;
|
const int redirectsLeft = maxRedirects - 1;
|
||||||
|
CLogMessage(sApp).info(u"Redirecting '%1' to '%2'") << urlStr << redirectUrl.toString();
|
||||||
this->httpRequestImplInQAMThread(redirectRequest, logId, callback, progress, redirectsLeft, requestOrPostMethod);
|
this->httpRequestImplInQAMThread(redirectRequest, logId, callback, progress, redirectsLeft, requestOrPostMethod);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ namespace BlackCore
|
|||||||
const CUpdateInfo updateInfo = CUpdateInfo::fromDatabaseJson(updateInfoJsonString);
|
const CUpdateInfo updateInfo = CUpdateInfo::fromDatabaseJson(updateInfoJsonString);
|
||||||
if (updateInfo.isEmpty())
|
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);
|
this->manageUpdateInfoAvailability(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user