QWebSocket: Check for an existing close timer before creating one
close() is called for every protocol error, so a peer sending malformed
frames could make it allocate an unbounded number of timers. Because
they all connect to the same disconnected signal, destroying them was
quadratic: ~470 KB of malformed frames on a single connection left the
event loop blocked for 37 minutes.
Reuse the existing timer instead. The bug where parsing continues after
a protocol error is addressed separately.
Pick-to: 6.12 6.12.0 6.11 6.11.3 6.8
Task-number: QTBUG-150271
Change-Id: I4511d3bb3fc09ac3cd78f8d72677fff93da805ea
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>