http3: qlog sent and received GOAWAY frames (#5376)

This commit is contained in:
Marten Seemann
2025-10-11 19:20:01 +08:00
committed by GitHub
parent 6c4abb9c14
commit f330d0e257
6 changed files with 78 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ import (
"time"
"github.com/quic-go/quic-go"
"github.com/quic-go/quic-go/http3/qlog"
"github.com/quic-go/quic-go/qlogwriter"
"github.com/quic-go/quic-go/quicvarint"
@@ -379,6 +380,12 @@ func (c *Conn) handleControlStream(str *quic.ReceiveStream) {
c.conn.CloseWithError(quic.ApplicationErrorCode(ErrCodeFrameUnexpected), "")
return
}
if c.qlogger != nil {
c.qlogger.RecordEvent(qlog.FrameParsed{
StreamID: str.StreamID(),
Frame: qlog.Frame{Frame: qlog.GoAwayFrame{StreamID: goaway.StreamID}},
})
}
if goaway.StreamID%4 != 0 { // client-initiated, bidirectional streams
c.conn.CloseWithError(quic.ApplicationErrorCode(ErrCodeIDError), "")
return