only retransmit WindowUpdates if no higher WindowUpdate has been sent

fixes #394
This commit is contained in:
Marten Seemann
2017-01-14 15:16:12 +07:00
parent db22dae089
commit 71227437ee
5 changed files with 89 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ type mockFlowControlHandler struct {
bytesRead protocol.ByteCount
bytesSent protocol.ByteCount
receiveWindow protocol.ByteCount
highestReceivedForStream protocol.StreamID
highestReceived protocol.ByteCount
flowControlViolation error
@@ -57,6 +58,10 @@ func (m *mockFlowControlHandler) GetWindowUpdates() (res []flowcontrol.WindowUpd
return res
}
func (m *mockFlowControlHandler) GetReceiveWindow(protocol.StreamID) (protocol.ByteCount, error) {
return m.receiveWindow, nil
}
func (m *mockFlowControlHandler) AddBytesRead(streamID protocol.StreamID, n protocol.ByteCount) error {
m.bytesReadForStream = streamID
m.bytesRead = n