New patch for qt-copy: fix QSslSocket::waitForBytesWritten(-1)

Andreas Hartmetz ahartmetz at gmail.com
Sun Nov 18 05:28:04 GMT 2007


Am Sonntag 18 November 2007 05:27:12 schrieb Andreas Hartmetz:
> Hi,
>
> During my work on a replacement for KSSL I discovered a bug in QSslSocket.
> After much trial and error I realized that while QSslSocket::bytesToWrite()
> may not be perfectly reliable, it is also unnecessary if
> waitForBytesWritten(-1) works right.
> The patch fixes the bug that QSslSocket::waitForBytesWritten(-1) does the
> same thing as waitForBytesWritten(0). What should happen for -1 is that it
> waits until some data (in the actual implementation, all data) has been
> transferred to the OS socket. For 0, it just waits for zero milliseconds.
> The bug only triggers when using an encrypted connection.
> The fix is to make the timeout behavior of QSslSocket imitate that of
> QAbstractSocket, and by imitate I mean use the same code.
> It's a small change that /looks/ harmless.

Forgot to mention - as the same bug is present in two other methods the patch 
fixes them, too.

> Thiago had a quick look and approved of the fix, although he (just like me)
> probably didn't do a full investigation; the socket code consists of many
> interacting classes...
>
> Cheers,
> Andreas





More information about the kde-core-devel mailing list