Commit Graph

9 Commits (5ed736b053eb9d04ecd1a6f2f375cce7fcefe4e6)

Author SHA1 Message Date
Mårten Nordheim 5ed736b053 Http/2: fix active streams counting
We were looking at all active streams, but that also includes promised
streams.

By the RFC the limitation that our peer specifies only applies to the
number of streams _we_ create, not the total amount of active streams.

More importantly, for the qhttp2protocolhandler it could mean that we
could end up having a few promised streams push the active stream count
over the limit, which could lead us to start more streams than intended
(then bounded by the number of queued requests).

The worst case in this scenario is that a **non-compliant** server
doesn't track how many connections we open and the user has queued
a ton of requests, so we open a ton of streams.

But on the upside: server-push is not widely used.

Pick-to: 6.7
Change-Id: I2a533472eb9127fd176bb99e9db0518f05c3fffe
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-18 17:42:19 +01:00
Øystein Heskestad 9b386127a0 QHttpConnection: Create new streams returns error when ids are exhausted
CreateStream returns a new error code, StreamIdsExhausted, when next
stream id counter exceeds max stream id instead of assert.

Task-number: QTBUG-122375
Pick-to: 6.7
Change-Id: I653b20c24c1429fe88d476beb1ca952aa1bbb320
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-18 13:17:19 +00:00
Matthias Rauter 3f26fdebbc Implement ping reply in QHttp2Connection and add test
Fixes: QTBUG-122338
Change-Id: I1e8dfa8a93c45dbe12a628d4d5e79d494d8f6032
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-04 20:14:36 +01:00
Mårten Nordheim a680838be4 Http2: handle empty hpack block for headers
When adjusting handling for the special traling HEADERS with PRIORITY
case the actual no-headers case handling was lost.
This patch adds it back.

Now it deals with it being empty due to overflow or just empty headers.

With a real server this should never happen though, since they either
send the required headers or don't send a HEADER frame at all. So, in
theory it will not have caused a problem for users.

Pick-to: 6.7 6.6
Change-Id: Iacbb1183f26cb1f2e7e30ace6456488c4671972d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-27 16:58:27 +01:00
Mårten Nordheim 2f1a564e15 QHttp2Connection: add extra docs
And move a public slot into private slot, because it was not intended to
be public.

Change-Id: I847fa510c29e5f63aaace0797c81b9874007fda0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-21 18:03:29 +01:00
Mårten Nordheim e247a6ce9f QHttp2Connection: confirm successive remote stream IDs are higher
And it should also apply to the promised streams, not separate ID tracking.

https://datatracker.ietf.org/doc/html/rfc9113#section-5.1.1

Change-Id: I6826a39c98f9b6a585200e628533843db731a85b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
2024-02-19 21:09:30 +01:00
Mårten Nordheim df4322f7f7 QHttp2Connection: fix potential streamId reuse
Pick-to: 6.7
Change-Id: Ib81058c4613820f15f55388b87433875c11492dd
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-02-19 19:56:25 +01:00
Mårten Nordheim a3a48815cc QH2Connection: Fix issue with unity-build/odr
The static function appeared in two places, and in a unity-build
this fails quite visibly.

Pick-to: 6.7
Change-Id: I60000d01194a2c79ca9c101f2a6d3f77f469f1a7
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
2024-01-18 21:56:46 +01:00
Mårten Nordheim 0dba3f6b71 Privately introduce QHttp2Connection
For use in QtGRPC.

There is some duplication between this code and the code in
QHttp2ProtocolHandler. But let's not change the implementation of
the protocol handler after the 6.7 beta release. Nor do I think we
should do it for 6.8 LTS. So let's just live with the duplication
until that has branched.

Pick-to: 6.7
Fixes: QTBUG-105491
Change-Id: I69aa38a3c341347e702f9c07c27287aee38a16f2
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-01-17 16:05:25 +01:00