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 <ext-shane.2.kearns@nokia.com>
This commit is contained in:
Xizhi Zhu 2012-02-01 22:26:36 +01:00 committed by Qt by Nokia
parent 3acbb12d2d
commit 319ba95c76

View File

@ -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;