forked from quic-go/quic-go
never send a value larger than 2^60 in MAX_STREAMS frames
This commit is contained in:
@@ -159,12 +159,15 @@ func (m *incomingUniStreamsMap) deleteStream(num protocol.StreamNum) error {
|
||||
delete(m.streams, num)
|
||||
// queue a MAX_STREAM_ID frame, giving the peer the option to open a new stream
|
||||
if m.maxNumStreams > uint64(len(m.streams)) {
|
||||
numNewStreams := m.maxNumStreams - uint64(len(m.streams))
|
||||
m.maxStream = m.nextStreamToOpen + protocol.StreamNum(numNewStreams) - 1
|
||||
m.queueMaxStreamID(&wire.MaxStreamsFrame{
|
||||
Type: protocol.StreamTypeUni,
|
||||
MaxStreamNum: m.maxStream,
|
||||
})
|
||||
maxStream := m.nextStreamToOpen + protocol.StreamNum(m.maxNumStreams-uint64(len(m.streams))) - 1
|
||||
// Never send a value larger than protocol.MaxStreamCount.
|
||||
if maxStream <= protocol.MaxStreamCount {
|
||||
m.maxStream = maxStream
|
||||
m.queueMaxStreamID(&wire.MaxStreamsFrame{
|
||||
Type: protocol.StreamTypeUni,
|
||||
MaxStreamNum: m.maxStream,
|
||||
})
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user