QGrpcHttp2Channel: don't send DATA frames before HEADERS


Http2Handler::processQueue() could be invoked between attachStream() and
sendInitialRequest(). For example while waiting for the HTTP/2 SETTINGS
frame after a TLS handshake. Per rfc9113#section-6.1 DATA is valid only
on streams in "open" or "half-closed (remote)". QHttp2Stream::sendDATA()
enforces this by silently returning false on an "idle" stream, dropping
the dequeued message. On HTTPS bidi streams the first request message
could therefore go missing, producing a flaky bidiStreamsInOrder failure
where the server saw number=2 as the first read.

Gate the drain on the handler's state so sendInitialRequest() reruns
processQueue() once HEADERS are out, preserving FIFO order.

Ref: https://datatracker.ietf.org/doc/html/rfc9113#section-6.1-10

[ChangeLog][QtGrpc][QGrpcHttp2Channel] Fixed a race on client- and
bidi-streaming RPCs where the first request message could be dropped
when written before the HTTP/2 HEADERS frame had been sent. Most visible
on HTTPS, where TLS handshake latency widened the window between stream
attachment and HEADERS emission.

Pick-to: 6.11 6.8
Change-Id: I16b091d441f6f16952e299d6c85e135af3c89d97
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
commit7fa196b94db9ec8d924b5952ce40ded099140094
parente9fedebea7da7c921d56c0e2f07235bc7a6f2bc5
authorDennis Oberst <dennis.oberst@qt.io>
committerDennis Oberst <dennis.oberst@qt.io>
commit timeMon, 1 Jun 2026 14:55:23 +0000