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>
commit438981ce0e72f29a01b7daddd9f52fb73d0eb7d2
parenta6283f31cf7401069df3d4e100e5234a553d60ab
authorLena Biliaieva <lena.biliaieva@qt.io>
committerLena Biliaieva <lena.biliaieva@qt.io>
commit timeTue, 22 Sep 2026 19:15:51 +0000