summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2018-04-16 09:49:11 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2018-04-21 12:16:16 +0000
commit2fe80ed203672977e5a00addb224be052bf81cca (patch)
treed83837669299d477ba7e7d755fdcbd3c6a3a864c
parent9aced25ab56ce825539019892330740b0bb19ad9 (diff)
QSslSocket: Call transmit when encrypted on WinRT
Once connection is established the socket emits 'connected', and then you can start writing. But it will end up in the write-buffer and won't get sent until 'transmit' is called. Some code (e.g. QWebSocket) relies on QSslSocket transmitting once it's encrypted. This is done in the OpenSSL backend but was not done in the WinRT backend. Task-number: QTBUG-56558 Change-Id: I8cf5d3257f3597a4bb80f35369490a3816506a34 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/network/ssl/qsslsocket_winrt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp
index 53a8a8b61b..e72edcbc52 100644
--- a/src/network/ssl/qsslsocket_winrt.cpp
+++ b/src/network/ssl/qsslsocket_winrt.cpp
@@ -647,6 +647,10 @@ HRESULT QSslSocketBackendPrivate::onSslUpgrade(IAsyncAction *action, AsyncStatus
connectionEncrypted = true;
emit q->encrypted();
+ // The write buffer may already have data written to it, so we need to call transmit.
+ // This has to be done in 'q's thread, and not in the current thread (the XAML thread).
+ QMetaObject::invokeMethod(q, [this](){ transmit(); });
+
if (pendingClose) {
pendingClose = false;
q->disconnectFromHost();