mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
Add debugging code for ssl errors.
This commit is contained in:
parent
c9888a285e
commit
1b0eac2870
@ -25,6 +25,8 @@ Download::Download()
|
||||
&HashAndSaveFile::hashAndSave, Qt::QueuedConnection);
|
||||
connect(m_hashAndSave, &HashAndSaveFile::hashAndSaveFinished, this,
|
||||
&Download::handleHashAndSaveFinished, Qt::QueuedConnection);
|
||||
connect(&m_networkManager, &QNetworkAccessManager::sslErrors, this,
|
||||
&Download::handleSslErrors);
|
||||
updateModelList();
|
||||
}
|
||||
|
||||
@ -128,6 +130,13 @@ void Download::cancelDownload(const QString &modelFile)
|
||||
}
|
||||
}
|
||||
|
||||
void Download::handleSslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
|
||||
{
|
||||
QUrl url = reply->request().url();
|
||||
for (auto e : errors)
|
||||
qWarning() << "ERROR: Received ssl error:" << e.errorString() << "for" << url;
|
||||
}
|
||||
|
||||
void Download::handleJsonDownloadFinished()
|
||||
{
|
||||
#if 0
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
Q_INVOKABLE QString downloadLocalModelsPath() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleSslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
|
||||
void handleJsonDownloadFinished();
|
||||
void handleDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
|
||||
void handleModelDownloadFinished();
|
||||
|
@ -28,6 +28,8 @@ Network::Network()
|
||||
settings.setValue("uniqueId", m_uniqueId);
|
||||
settings.sync();
|
||||
setActive(settings.value("network/isActive", false).toBool());
|
||||
connect(&m_networkManager, &QNetworkAccessManager::sslErrors, this,
|
||||
&Network::handleSslErrors);
|
||||
}
|
||||
|
||||
void Network::setActive(bool b)
|
||||
@ -126,6 +128,13 @@ void Network::handleJsonUploadFinished()
|
||||
jsonReply->deleteLater();
|
||||
}
|
||||
|
||||
void Network::handleSslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
|
||||
{
|
||||
QUrl url = reply->request().url();
|
||||
for (auto e : errors)
|
||||
qWarning() << "ERROR: Received ssl error:" << e.errorString() << "for" << url;
|
||||
}
|
||||
|
||||
bool Network::sendConversation(const QString &ingestId, const QString &conversation)
|
||||
{
|
||||
return packageAndSendJson(ingestId, conversation);
|
||||
|
Loading…
Reference in New Issue
Block a user