forked from quic-go/quic-go
remove fcm.StreamContributesToConnectionFlowControl
This commit is contained in:
@@ -180,17 +180,6 @@ func (f *flowControlManager) UpdateWindow(streamID protocol.StreamID, offset pro
|
|||||||
return streamFlowController.UpdateSendWindow(offset), nil
|
return streamFlowController.UpdateSendWindow(offset), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *flowControlManager) StreamContributesToConnectionFlowControl(streamID protocol.StreamID) (bool, error) {
|
|
||||||
f.mutex.RLock()
|
|
||||||
defer f.mutex.RUnlock()
|
|
||||||
|
|
||||||
contributes, ok := f.contributesToConnectionFlowControl[streamID]
|
|
||||||
if !ok {
|
|
||||||
return false, errMapAccess
|
|
||||||
}
|
|
||||||
return contributes, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *flowControlManager) getFlowController(streamID protocol.StreamID) (*flowController, error) {
|
func (f *flowControlManager) getFlowController(streamID protocol.StreamID) (*flowController, error) {
|
||||||
streamFlowController, ok := f.streamFlowController[streamID]
|
streamFlowController, ok := f.streamFlowController[streamID]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|||||||
@@ -184,26 +184,5 @@ var _ = Describe("Flow Control Manager", func() {
|
|||||||
Expect(size).To(Equal(protocol.ByteCount(0x1000)))
|
Expect(size).To(Equal(protocol.ByteCount(0x1000)))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Context("streams contributing to connection-level flow control", func() {
|
|
||||||
It("says that a stream contributes", func() {
|
|
||||||
fcm.NewStream(5, true)
|
|
||||||
contributes, err := fcm.StreamContributesToConnectionFlowControl(5)
|
|
||||||
Expect(err).ToNot(HaveOccurred())
|
|
||||||
Expect(contributes).To(BeTrue())
|
|
||||||
})
|
|
||||||
|
|
||||||
It("says that a stream doesn't contribute", func() {
|
|
||||||
fcm.NewStream(3, false)
|
|
||||||
contributes, err := fcm.StreamContributesToConnectionFlowControl(3)
|
|
||||||
Expect(err).ToNot(HaveOccurred())
|
|
||||||
Expect(contributes).To(BeFalse())
|
|
||||||
})
|
|
||||||
|
|
||||||
It("returns an error for an unknown stream", func() {
|
|
||||||
_, err := fcm.StreamContributesToConnectionFlowControl(1337)
|
|
||||||
Expect(err).To(HaveOccurred())
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -15,5 +15,4 @@ type FlowControlManager interface {
|
|||||||
SendWindowSize(streamID protocol.StreamID) (protocol.ByteCount, error)
|
SendWindowSize(streamID protocol.StreamID) (protocol.ByteCount, error)
|
||||||
RemainingConnectionWindowSize() protocol.ByteCount
|
RemainingConnectionWindowSize() protocol.ByteCount
|
||||||
UpdateWindow(streamID protocol.StreamID, offset protocol.ByteCount) (bool, error)
|
UpdateWindow(streamID protocol.StreamID, offset protocol.ByteCount) (bool, error)
|
||||||
StreamContributesToConnectionFlowControl(streamID protocol.StreamID) (bool, error)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,14 +89,6 @@ func (m *mockFlowControlHandler) RemainingConnectionWindowSize() protocol.ByteCo
|
|||||||
func (m *mockFlowControlHandler) UpdateWindow(streamID protocol.StreamID, offset protocol.ByteCount) (bool, error) {
|
func (m *mockFlowControlHandler) UpdateWindow(streamID protocol.StreamID, offset protocol.ByteCount) (bool, error) {
|
||||||
panic("not implemented")
|
panic("not implemented")
|
||||||
}
|
}
|
||||||
func (m *mockFlowControlHandler) StreamContributesToConnectionFlowControl(streamID protocol.StreamID) (bool, error) {
|
|
||||||
for _, id := range m.streamsContributing {
|
|
||||||
if id == streamID {
|
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ = Describe("Stream", func() {
|
var _ = Describe("Stream", func() {
|
||||||
var (
|
var (
|
||||||
|
|||||||
Reference in New Issue
Block a user