refactor frame packing to logic to not access the streams map (#4596)

* avoid accessing the streams map when packing stream data

* avoid accessing the streams map when packing flow control frames

* remove streamGetter interface
This commit is contained in:
Marten Seemann
2024-07-28 12:32:54 -07:00
committed by GitHub
parent fc79a77ffe
commit 42f04d4e02
20 changed files with 224 additions and 390 deletions

View File

@@ -8,7 +8,6 @@ type flowController interface {
UpdateSendWindow(protocol.ByteCount) (updated bool)
AddBytesSent(protocol.ByteCount)
// for receiving
AddBytesRead(protocol.ByteCount)
GetWindowUpdate() protocol.ByteCount // returns 0 if no update is necessary
IsNewlyBlocked() (bool, protocol.ByteCount)
}
@@ -16,6 +15,7 @@ type flowController interface {
// A StreamFlowController is a flow controller for a QUIC stream.
type StreamFlowController interface {
flowController
AddBytesRead(protocol.ByteCount) (shouldQueueWindowUpdate bool)
// UpdateHighestReceived is called when a new highest offset is received
// final has to be to true if this is the final offset of the stream,
// as contained in a STREAM frame with FIN bit, and the RESET_STREAM frame
@@ -28,6 +28,7 @@ type StreamFlowController interface {
// The ConnectionFlowController is the flow controller for the connection.
type ConnectionFlowController interface {
flowController
AddBytesRead(protocol.ByteCount)
Reset() error
}