From 319ba95c763c5e323e338119750651ef7e0cd897 Mon Sep 17 00:00:00 2001 From: Xizhi Zhu Date: Wed, 1 Feb 2012 22:26:36 +0100 Subject: [PATCH] Call start() even when bearer is not compiled. Otherwise, the HTTP request won't be sent if bearer is not compiled. Change-Id: I9a8171fde6fe5b2db0405b4af6e1d52ac4528502 Reviewed-by: Shane Kearns --- src/network/access/qnetworkreplyhttpimpl.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index c7e2995..71bc03e 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -1499,10 +1499,11 @@ bool QNetworkReplyHttpImplPrivate::start() { #ifndef QT_NO_BEARERMANAGEMENT if (!managerPrivate->networkSession) { +#endif postRequest(); return true; +#ifndef QT_NO_BEARERMANAGEMENT } -#endif // This is not ideal. const QString host = url.host(); @@ -1513,15 +1514,14 @@ bool QNetworkReplyHttpImplPrivate::start() return true; } -#ifndef QT_NO_BEARERMANAGEMENT if (managerPrivate->networkSession->isOpen() && managerPrivate->networkSession->state() == QNetworkSession::Connected) { postRequest(); return true; } -#endif return false; +#endif } void QNetworkReplyHttpImplPrivate::_q_startOperation() @@ -1533,13 +1533,12 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation() } state = Working; + if (!start()) { #ifndef QT_NO_BEARERMANAGEMENT - if (!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 // state changes. state = WaitingForSession; - QNetworkSession *session = managerPrivate->networkSession.data(); if (session) { @@ -1553,10 +1552,9 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation() } else { qWarning("Backend is waiting for QNetworkSession to connect, but there is none!"); } - +#endif return; } -#endif if (synchronous) { state = Finished; -- 2.7.4