make the number of incoming streams configurable, for IETF QUIC

This commit is contained in:
Marten Seemann 2018-02-23 12:30:34 +08:00
parent ecad36a65b
commit 58b20c6009
14 changed files with 131 additions and 29 deletions

View file

@ -35,6 +35,8 @@ var _ streamManager = &streamsMap{}
func newStreamsMap(
sender streamSender,
newFlowController func(protocol.StreamID) flowcontrol.StreamFlowController,
maxIncomingStreams int,
maxIncomingUniStreams int,
perspective protocol.Perspective,
version protocol.VersionNumber,
) streamManager {
@ -69,11 +71,10 @@ func newStreamsMap(
newBidiStream,
sender.queueControlFrame,
)
// TODO(#523): make these values configurable
m.incomingBidiStreams = newIncomingBidiStreamsMap(
firstIncomingBidiStream,
protocol.MaxBidiStreamID(protocol.MaxIncomingStreams, perspective),
protocol.MaxIncomingStreams,
protocol.MaxBidiStreamID(maxIncomingStreams, perspective),
maxIncomingStreams,
sender.queueControlFrame,
newBidiStream,
)
@ -82,11 +83,10 @@ func newStreamsMap(
newUniSendStream,
sender.queueControlFrame,
)
// TODO(#523): make these values configurable
m.incomingUniStreams = newIncomingUniStreamsMap(
firstIncomingUniStream,
protocol.MaxUniStreamID(protocol.MaxIncomingStreams, perspective),
protocol.MaxIncomingStreams,
protocol.MaxUniStreamID(maxIncomingUniStreams, perspective),
maxIncomingUniStreams,
sender.queueControlFrame,
newUniReceiveStream,
)