QSSLSocket flush crashes

98 views Asked by At
qint64 sent = socket->write (data, size);
socket->flush ();

This works fine with a QTcpSocket, but eventually crashes within a memcpy inside a QSSLSocket private event (flush). I know I should add more context, but that's a lot. Omitting socket->flush () here makes everything work perfectly incl. all SSL handshake etc, so I wonder if anybody has come across this? It takes a while and a few kilobytes or so of data sent before it happens. Maybe it's bad practice to flush after write anyway, so...just curious :-)

1

There are 1 answers

0
Hex24 On

I have faced same issue and same as you was using flush after every write and sometimes "Tag mismatch" got in the way. Solved problem:

Remove flush usage after every write. And problem will be gone. QSSLSockets lib automatically flushes write buffer behind scenes, and it is more optimal than doing manual flush after each buffer data write :)