forked from quic-go/quic-go
set offset in WindowUpdates based on read position and window increment
fixes #105
This commit is contained in:
@@ -138,7 +138,7 @@ func (s *stream) ReadByte() (byte, error) {
|
||||
}
|
||||
|
||||
func (s *stream) updateReceiveFlowControlWindow() {
|
||||
n := s.receiveFlowControlWindow + s.receiveFlowControlWindowIncrement
|
||||
n := s.readOffset + s.receiveFlowControlWindowIncrement
|
||||
s.receiveFlowControlWindow = n
|
||||
s.session.updateReceiveFlowControlWindow(s.streamID, n)
|
||||
}
|
||||
|
||||
@@ -354,7 +354,6 @@ var _ = Describe("Stream", func() {
|
||||
Context("flow control window updating, for receiving", func() {
|
||||
It("updates the flow control window", func() {
|
||||
len := int(protocol.WindowUpdateThreshold) + 1
|
||||
receiveFlowControlWindow := str.receiveFlowControlWindow
|
||||
frame := frames.StreamFrame{
|
||||
Offset: 0,
|
||||
Data: bytes.Repeat([]byte{'f'}, len),
|
||||
@@ -364,7 +363,7 @@ var _ = Describe("Stream", func() {
|
||||
n, err := str.Read(b)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(n).To(Equal(len))
|
||||
Expect(str.receiveFlowControlWindow).To(Equal(receiveFlowControlWindow + str.receiveFlowControlWindowIncrement))
|
||||
Expect(str.receiveFlowControlWindow).To(Equal(protocol.ByteCount(len) + str.receiveFlowControlWindowIncrement))
|
||||
})
|
||||
|
||||
It("does not update the flow control window when not enough data was received", func() {
|
||||
|
||||
Reference in New Issue
Block a user