From 52db71f191d75a878c9b23eee5eebbd3b5a7c1a6 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Tue, 16 Sep 2014 13:03:49 +0200 Subject: [PATCH] [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 Reviewed-by: Jocelyn Turcotte --- src/network/access/qnetworkreplyhttpimpl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 367c92a460e..796f51b9b1b 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -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 }