Skip to content

Commit

Permalink
Avoid reading reply data if the reply isn't open
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Martchus committed Jun 4, 2021
1 parent 3e28db3 commit 986959c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connector/syncthingconnection_requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 986959c

Please sign in to comment.