summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-08-03 01:00:16 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-08-07 17:44:51 +0200
commit053e7cce79d4bef99ec85101b0d22bbb171072c5 (patch)
treec2059e82cccdea1fd0024c5942d1a834c28d39da /src/network/access
parenta420d02538d28854914a6978c9637a0ddd652146 (diff)
parentf271dd8f960ad9f61697dfa57b26c4071441cadc (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp16
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h1
2 files changed, 16 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 0ac14c78f6..5726925cb0 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -251,6 +251,20 @@ bool QHttpNetworkConnectionChannel::sendRequest()
return protocolHandler->sendRequest();
}
+/*
+ * Invoke "protocolHandler->sendRequest" using a queued connection.
+ * It's used to return to the event loop before invoking sendRequest when
+ * there's a very real chance that the request could have been aborted
+ * (i.e. after having emitted 'encrypted').
+ */
+void QHttpNetworkConnectionChannel::sendRequestDelayed()
+{
+ QMetaObject::invokeMethod(this, [this] {
+ Q_ASSERT(!protocolHandler.isNull());
+ if (reply)
+ protocolHandler->sendRequest();
+ }, Qt::ConnectionType::QueuedConnection);
+}
void QHttpNetworkConnectionChannel::_q_receiveReply()
{
@@ -1234,7 +1248,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
emit reply->encrypted();
}
if (reply)
- sendRequest();
+ sendRequestDelayed();
}
}
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index e9cdae5653..270b3eb9ba 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -174,6 +174,7 @@ public:
void abort();
bool sendRequest();
+ void sendRequestDelayed();
bool ensureConnection();