Avoid reading reply data if the reply isn't open

This might be the case when the request has been aborted. Reading from the
reply in this case would result in an unwanted log message from Qt.
This commit is contained in:
Martchus 2021-06-04 16:26:09 +02:00
parent 3e28db37e8
commit 986959c8b2
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ SyncthingConnection::Reply SyncthingConnection::prepareReply(QList<QNetworkReply
SyncthingConnection::Reply SyncthingConnection::handleReply(QNetworkReply *reply, bool readData, bool handleAborting)
{
const auto log = m_loggingFlags & SyncthingConnectionLoggingFlags::ApiReplies;
readData = readData || log;
readData = (readData || log) && reply->isOpen();
handleAborting = handleAborting && m_abortingAllRequests;
const auto data = Reply{
.reply = handleAborting ? nullptr : reply, // skip further processing if aborting to reconnect