mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-10-07 12:37:06 -04:00
fix: Change behavior of cancel request
*now cancel request cancel all requests
This commit is contained in:
@ -126,9 +126,14 @@ QString HttpClient::addActiveRequest(QNetworkReply *reply, const QString &reques
|
||||
void HttpClient::cancelRequest(const QString &requestId)
|
||||
{
|
||||
QMutexLocker locker(&m_mutex);
|
||||
if (auto it = m_activeRequests.find(requestId); it != m_activeRequests.end()) {
|
||||
it.value()->abort();
|
||||
it.value()->deleteLater();
|
||||
auto it = m_activeRequests.find(requestId);
|
||||
if (it != m_activeRequests.end()) {
|
||||
QNetworkReply *reply = it.value();
|
||||
if (reply) {
|
||||
reply->disconnect();
|
||||
reply->abort();
|
||||
reply->deleteLater();
|
||||
}
|
||||
m_activeRequests.erase(it);
|
||||
LOG_MESSAGE(QString("HttpClient: Cancelled request: %1").arg(requestId));
|
||||
}
|
||||
|
Reference in New Issue
Block a user