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>
This commit is contained in:
Mårten Nordheim 2018-04-16 09:49:11 +02:00
parent 9aced25ab5
commit 2fe80ed203

View File

@ -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();