Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.8.x, 5.4.0
-
None
-
Windows, Mac, Linux
Description
Problem:
Calling waitForReadyRead() from a slot connected to the readyRead() signal will always timeout, although new data comes to plain socket buffer.
Same thing using QTcpSocket works just fine.
Why it happens?
QTcpSocket does actually read and store data into the buffer, but does not re-emit readyRead() signal which is fine. However, QSslSocket decrypts data only when this signal is emitted from QTcpSocket. Possible solution would be if waitForReadyRead() function in QSslSocket would decrypt plain socket data calling transmit().
Workaround:
My current workaround is to call flush() if there is encrypted data available, but the documentation does not clearly state that it will decrypt read buffer, it only guarantees that data will be encrypted and sent. Does it mean that in future implementations my code could be broken?
Thanks,
Denis