Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-44531

QSslSocket waitForReadyRead problem

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.8.x, 5.4.0
    • Network: SSL
    • 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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richmoore Richard Moore (qtnetwork)
            comy Denis Komadaric
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes