summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-07-10 12:44:53 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-07-13 09:37:21 (GMT)
commit839fbd22a602aa4b9fa20e6c302329008c3aab09 (patch)
tree56011fd0ad0162d6633bcf5d0d58fe301ad726b3 /src
parentd5c71b7ede48fd832145cc3921da77b10772053c (diff)
downloadQt-839fbd22a602aa4b9fa20e6c302329008c3aab09.zip
Qt-839fbd22a602aa4b9fa20e6c302329008c3aab09.tar.gz
Qt-839fbd22a602aa4b9fa20e6c302329008c3aab09.tar.bz2
Removed an assert from the QNetworkReply.
It is possible that finished() function will be called several times, for example if the user calls QNetworkReply::close() as a result of the authenticationRequired() signal, the connection will be closed (which results in emitting a finished() signal), and then the authentication will be cancelled, which will also try to emit the same signal, however the connection state will already be set to Finished. The fix is to just make sure if the finished() signal has already been emitted by checking if the connection state is not Finished or Aborted. Reviewed-by: Thiago Macieira
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index de39970..28319bb 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -461,8 +461,8 @@ void QNetworkReplyImplPrivate::appendDownstreamData(QIODevice *data)
void QNetworkReplyImplPrivate::finished()
{
Q_Q(QNetworkReplyImpl);
- Q_ASSERT_X(state != Finished, "QNetworkReplyImpl",
- "Backend called finished/finishedWithError more than once");
+ if (state == Finished || state == Aborted)
+ return;
state = Finished;
pendingNotifications.clear();