remove unused version parameter from stream constructor

This commit is contained in:
Marten Seemann 2022-12-24 12:50:31 +13:00
parent 0f352f2653
commit d972a5e8f2
3 changed files with 4 additions and 7 deletions

View file

@ -80,8 +80,6 @@ type stream struct {
sender streamSender
receiveStreamCompleted bool
sendStreamCompleted bool
version protocol.VersionNumber
}
var _ Stream = &stream{}
@ -90,9 +88,8 @@ var _ Stream = &stream{}
func newStream(streamID protocol.StreamID,
sender streamSender,
flowController flowcontrol.StreamFlowController,
version protocol.VersionNumber,
) *stream {
s := &stream{sender: sender, version: version}
s := &stream{sender: sender}
senderForSendStream := &uniStreamSender{
streamSender: sender,
onStreamCompletedImpl: func() {

View file

@ -40,7 +40,7 @@ var _ = Describe("Stream", func() {
BeforeEach(func() {
mockSender = NewMockStreamSender(mockCtrl)
mockFC = mocks.NewMockStreamFlowController(mockCtrl)
str = newStream(streamID, mockSender, mockFC, protocol.VersionWhatever)
str = newStream(streamID, mockSender, mockFC)
timeout := scaleDuration(250 * time.Millisecond)
strWithTimeout = struct {

View file

@ -89,7 +89,7 @@ func (m *streamsMap) initMaps() {
protocol.StreamTypeBidi,
func(num protocol.StreamNum) streamI {
id := num.StreamID(protocol.StreamTypeBidi, m.perspective)
return newStream(id, m.sender, m.newFlowController(id), m.version)
return newStream(id, m.sender, m.newFlowController(id))
},
m.sender.queueControlFrame,
)
@ -97,7 +97,7 @@ func (m *streamsMap) initMaps() {
protocol.StreamTypeBidi,
func(num protocol.StreamNum) streamI {
id := num.StreamID(protocol.StreamTypeBidi, m.perspective.Opposite())
return newStream(id, m.sender, m.newFlowController(id), m.version)
return newStream(id, m.sender, m.newFlowController(id))
},
m.maxIncomingBidiStreams,
m.sender.queueControlFrame,