[Bearer] Try a bit harder to open a network session

The symptoms were made apparent in the xmlpatterns command line
utility when trying to use the synchronous HTTP code path in
QXmlQuery for fetching schemas.

Change-Id: I93b283fdec4b501a5c1fc646f7ddc30d8407f5ae
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
This commit is contained in:
Pierre Rossi 2014-09-16 13:03:49 +02:00 committed by Pierre Rossi
parent d41c5f9dba
commit 52db71f191

View File

@ -1585,8 +1585,14 @@ bool QNetworkReplyHttpImplPrivate::start()
q, SLOT(_q_networkSessionUsagePoliciesChanged(QNetworkSession::UsagePolicies)));
postRequest();
return true;
} else if (synchronous) {
// Command line applications using the synchronous path such as xmlpatterns may need an extra push.
networkSession->open();
if (networkSession->waitForOpened()) {
postRequest();
return true;
}
}
return false;
#endif
}