forked from quic-go/quic-go
use a generic streams map for outgoing streams (#3488)
This commit is contained in:
@@ -55,8 +55,8 @@ type streamsMap struct {
|
||||
newFlowController func(protocol.StreamID) flowcontrol.StreamFlowController
|
||||
|
||||
mutex sync.Mutex
|
||||
outgoingBidiStreams *outgoingBidiStreamsMap
|
||||
outgoingUniStreams *outgoingUniStreamsMap
|
||||
outgoingBidiStreams *outgoingStreamsMap[streamI]
|
||||
outgoingUniStreams *outgoingStreamsMap[sendStreamI]
|
||||
incomingBidiStreams *incomingBidiStreamsMap
|
||||
incomingUniStreams *incomingUniStreamsMap
|
||||
reset bool
|
||||
@@ -85,7 +85,8 @@ func newStreamsMap(
|
||||
}
|
||||
|
||||
func (m *streamsMap) initMaps() {
|
||||
m.outgoingBidiStreams = newOutgoingBidiStreamsMap(
|
||||
m.outgoingBidiStreams = newOutgoingStreamsMap(
|
||||
protocol.StreamTypeBidi,
|
||||
func(num protocol.StreamNum) streamI {
|
||||
id := num.StreamID(protocol.StreamTypeBidi, m.perspective)
|
||||
return newStream(id, m.sender, m.newFlowController(id), m.version)
|
||||
@@ -100,7 +101,8 @@ func (m *streamsMap) initMaps() {
|
||||
m.maxIncomingBidiStreams,
|
||||
m.sender.queueControlFrame,
|
||||
)
|
||||
m.outgoingUniStreams = newOutgoingUniStreamsMap(
|
||||
m.outgoingUniStreams = newOutgoingStreamsMap(
|
||||
protocol.StreamTypeUni,
|
||||
func(num protocol.StreamNum) sendStreamI {
|
||||
id := num.StreamID(protocol.StreamTypeUni, m.perspective)
|
||||
return newSendStream(id, m.sender, m.newFlowController(id), m.version)
|
||||
|
||||
Reference in New Issue
Block a user