http3: fix off-by-one error when processing the GOAWAY stream ID (#5145)

This commit is contained in:
Marten Seemann
2025-05-20 14:43:33 +08:00
committed by GitHub
parent 363e0ccafb
commit 04eab22893
3 changed files with 32 additions and 12 deletions

View File

@@ -1188,14 +1188,12 @@ func testHTTPRequestAfterGracefulShutdown(t *testing.T, setGetBody bool) {
require.Nil(t, req.GetBody)
}
// By increasing the RTT, we make sure that the request is sent before the client receives the GOAWAY frame.
inShutdown.Store(true)
go server1.Shutdown(context.Background())
go server2.ServeListener(ln)
defer server2.Close()
// so that graceful shutdown can actually start
time.Sleep(scaleDuration(10 * time.Millisecond))
resp, err = cl.Do(req)
if !setGetBody {
require.ErrorContains(t, err, "after Request.Body was written; define Request.GetBody to avoid this error")