Merge pull request #645 from qdeconinck/fix-connection-stall-wuf-0

fix stalls when retransmitting connection-level Window Update Frames
This commit is contained in:
Marten Seemann
2017-06-07 11:01:51 +02:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -157,6 +157,11 @@ func (f *flowControlManager) GetReceiveWindow(streamID protocol.StreamID) (proto
f.mutex.RLock()
defer f.mutex.RUnlock()
// StreamID can be 0 when retransmitting
if streamID == 0 {
return f.connFlowController.receiveWindow, nil
}
flowController, err := f.getFlowController(streamID)
if err != nil {
return 0, err

View File

@@ -103,6 +103,12 @@ var _ = Describe("Flow Control Manager", func() {
Expect(err).To(MatchError(errMapAccess))
})
It("gets the offset of the connection-level receive window", func() {
offset, err := fcm.GetReceiveWindow(0)
Expect(err).ToNot(HaveOccurred())
Expect(offset).To(Equal(protocol.ByteCount(200)))
})
Context("flow control violations", func() {
It("errors when encountering a stream level flow control violation", func() {
err := fcm.UpdateHighestReceived(4, 101)