diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-04-18 14:30:39 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-04-18 16:12:16 (GMT) |
commit | 445e70499dde512b5c957721b53ac22f0df72ee7 (patch) | |
tree | 7f53b0e25a383edc475bf456e350ebd3982b4b63 /src/network | |
parent | c3ee4c09dc90d09b729ec70b2ebc27136bd2da2e (diff) | |
download | Qt-445e70499dde512b5c957721b53ac22f0df72ee7.zip Qt-445e70499dde512b5c957721b53ac22f0df72ee7.tar.gz Qt-445e70499dde512b5c957721b53ac22f0df72ee7.tar.bz2 |
Fix QNetworkReplyImpl error handling
The backend was never started when compiled without bearer management,
now it is.
Now emits the error signal in case of startup errors which would leave
the state machine hanging. Previously it just printed a warning.
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 9eb505d..34fd7a7 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -90,10 +90,10 @@ void QNetworkReplyImplPrivate::_q_startOperation() return; } + if (!backend->start()) { #ifndef QT_NO_BEARERMANAGEMENT - if (!backend->start()) { // ### we should call that method even if bearer is not used // backend failed to start because the session state is not Connected. - // QNetworkAccessManager will call reply->backend->start() again for us when the session + // QNetworkAccessManager will call _q_startOperation again for us when the session // state changes. state = WaitingForSession; @@ -109,11 +109,20 @@ void QNetworkReplyImplPrivate::_q_startOperation() session->open(); } else { qWarning("Backend is waiting for QNetworkSession to connect, but there is none!"); + state = Working; + error(QNetworkReplyImpl::UnknownNetworkError, + QCoreApplication::translate("QNetworkReply", "Network session error.")); + finished(); } - +#else + qWarning("Backend start failed"); + state = Working; + error(QNetworkReplyImpl::UnknownNetworkError, + QCoreApplication::translate("QNetworkReply", "backend start error.")); + finished(); +#endif return; } -#endif if (backend && backend->isSynchronous()) { state = Finished; |