queue connection-level window updates from the flow controller directly

It is not sufficient to check for connection-level window updates every
time a packet is sent. When a connection-level window update needs to be
sent, we need to make sure that it gets sent immediately (i.e. call
scheduleSending() in the session).
This commit is contained in:
Marten Seemann
2018-05-06 10:51:51 +09:00
parent 2e8a5807ba
commit 08160ab18f
10 changed files with 126 additions and 55 deletions

View File

@@ -10,6 +10,7 @@ type flowController interface {
// for receiving
AddBytesRead(protocol.ByteCount)
GetWindowUpdate() protocol.ByteCount // returns 0 if no update is necessary
MaybeQueueWindowUpdate() // queues a window update, if necessary
}
// A StreamFlowController is a flow controller for a QUIC stream.
@@ -21,8 +22,6 @@ type StreamFlowController interface {
// UpdateHighestReceived should be 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 RST_STREAM frame
UpdateHighestReceived(offset protocol.ByteCount, final bool) error
// MaybeQueueWindowUpdate queues a window update, if necessary
MaybeQueueWindowUpdate()
}
// The ConnectionFlowController is the flow controller for the connection.