summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2014-09-16 13:03:49 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2014-09-22 09:08:06 +0200
commit52db71f191d75a878c9b23eee5eebbd3b5a7c1a6 (patch)
tree418fefc2f7e2be964ece66e45b5731b09f666e39 /src/network/access
parentd41c5f9dba53c1592014270bab8b35768f3818ce (diff)
[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>
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 367c92a460..796f51b9b1 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
}