QNetworkReply: Fix finish signal is not emitted

When a QNetworkReply is in WaitingForSession state and is aborted the finished signal
was not emitted.

Task-number: QTBUG-37473
Change-Id: Iccc4dfd8e8e65e9e42625a908432ce9083caa231
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
This commit is contained in:
Fabian Bumberger 2014-06-29 21:00:17 +02:00
parent 7a848d5f13
commit febded2353

View File

@ -277,6 +277,10 @@ void QNetworkReplyHttpImpl::abort()
// call finished which will emit signals
// FIXME shouldn't this be emitted Queued?
d->error(OperationCanceledError, tr("Operation canceled"));
// If state is WaitingForSession, calling finished has no effect
if (d->state == QNetworkReplyHttpImplPrivate::WaitingForSession)
d->state = QNetworkReplyHttpImplPrivate::Working;
d->finished();
}