Skip to content

Commit

Permalink
fix: network locked if aborting requests before they start (fix #2515)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Nov 14, 2022
1 parent 007a022 commit b49e35d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/src/network/network-reply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ QByteArray NetworkReply::rawHeader(const QByteArray &headerName) const

bool NetworkReply::isRunning() const
{
// A reply that hasn't been actually started or aborted yet is considered as running
if (!m_started && !m_aborted) {
return true;
}

return m_reply != nullptr && m_reply->isRunning();
}

Expand Down Expand Up @@ -128,6 +130,8 @@ void NetworkReply::abort()
m_aborted = true;
if (m_reply != nullptr) {
m_reply->abort();
} else {
emit finished();
}
if (timer.isActive()) {
timer.stop();
Expand Down

0 comments on commit b49e35d

Please sign in to comment.