From 2fe80ed203672977e5a00addb224be052bf81cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 16 Apr 2018 09:49:11 +0200 Subject: [PATCH] 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 Reviewed-by: Timur Pocheptsov --- src/network/ssl/qsslsocket_winrt.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp index 53a8a8b61bc..e72edcbc520 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();