QWebSocket: fix quadratic copy and scan during pre-handshake


Just like the parent patch, but for the client-side.

Different from the patch addressing the server-side, we don't need
to store a QHash<socket, bytes> since there is only one peer.
And the client side was not affected by this until 6.3.

Amends bbd9f2f4f5e0fda85029fa320f793973ea607c2b.

[ChangeLog][QWebSocket] An over-sized handshake response now closes the
connection, and QWebSocket::closeCode() reports
QWebSocketProtocol::CloseCodeTooMuchData. The size limit is also now
applied as the response arrives, rather than only while the end of the
headers has not been seen.

Pick-to: 6.12 6.12.0 6.11 6.11.3 6.8 6.5
Fixes: QTBUG-150324
Change-Id: If1a12a6d87fe1a9af55282482da27aabca676d43
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
commitfe08f10ffc359f4bf4e6e0a6db2f02ea26cf1f12
parent3368312b5f55427b41e1f7fec03f2f5f1c8840c1
authorMårten Nordheim <marten.nordheim@qt.io>
committerMårten Nordheim <marten.nordheim@qt.io>
commit timeThu, 24 Sep 2026 14:51:06 +0000