forked from quic-go/quic-go
use a uint64 for stream counts
This commit is contained in:
@@ -21,7 +21,7 @@ type incomingBidiStreamsMap struct {
|
||||
nextStreamToAccept protocol.StreamID // the next stream that will be returned by AcceptStream()
|
||||
nextStreamToOpen protocol.StreamID // the highest stream that the peer openend
|
||||
maxStream protocol.StreamID // the highest stream that the peer is allowed to open
|
||||
maxNumStreams int // maximum number of streams
|
||||
maxNumStreams uint64 // maximum number of streams
|
||||
|
||||
newStream func(protocol.StreamID) streamI
|
||||
queueMaxStreamID func(*wire.MaxStreamIDFrame)
|
||||
@@ -32,7 +32,7 @@ type incomingBidiStreamsMap struct {
|
||||
func newIncomingBidiStreamsMap(
|
||||
nextStreamToAccept protocol.StreamID,
|
||||
initialMaxStreamID protocol.StreamID,
|
||||
maxNumStreams int,
|
||||
maxNumStreams uint64,
|
||||
queueControlFrame func(wire.Frame),
|
||||
newStream func(protocol.StreamID) streamI,
|
||||
) *incomingBidiStreamsMap {
|
||||
@@ -108,7 +108,8 @@ func (m *incomingBidiStreamsMap) DeleteStream(id protocol.StreamID) error {
|
||||
}
|
||||
delete(m.streams, id)
|
||||
// queue a MAX_STREAM_ID frame, giving the peer the option to open a new stream
|
||||
if numNewStreams := m.maxNumStreams - len(m.streams); numNewStreams > 0 {
|
||||
if m.maxNumStreams > uint64(len(m.streams)) {
|
||||
numNewStreams := m.maxNumStreams - uint64(len(m.streams))
|
||||
m.maxStream = m.nextStreamToOpen + protocol.StreamID((numNewStreams-1)*4)
|
||||
m.queueMaxStreamID(&wire.MaxStreamIDFrame{StreamID: m.maxStream})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user