forked from quic-go/quic-go
simplify stream ID handling in the incoming streams map (#5207)
* simplify stream ID handling in the incoming streams map No functional change expected. * protocol: move stream ID constant definition
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package protocol
|
||||
|
||||
import "github.com/quic-go/quic-go/quicvarint"
|
||||
|
||||
// StreamType encodes if this is a unidirectional or bidirectional stream
|
||||
type StreamType uint8
|
||||
|
||||
@@ -23,6 +25,30 @@ const (
|
||||
// MaxStreamCount is the maximum stream count value that can be sent in MAX_STREAMS frames
|
||||
// and as the stream count in the transport parameters
|
||||
MaxStreamCount StreamNum = 1 << 60
|
||||
// MaxStreamID is the maximum stream ID
|
||||
MaxStreamID StreamID = quicvarint.Max
|
||||
)
|
||||
|
||||
const (
|
||||
// FirstOutgoingBidiStreamClient is the first bidirectional stream opened by the client
|
||||
FirstOutgoingBidiStreamClient StreamID = 0
|
||||
// FirstOutgoingUniStreamClient is the first unidirectional stream opened by the client
|
||||
FirstOutgoingUniStreamClient StreamID = 2
|
||||
// FirstOutgoingBidiStreamServer is the first bidirectional stream opened by the server
|
||||
FirstOutgoingBidiStreamServer StreamID = 1
|
||||
// FirstOutgoingUniStreamServer is the first unidirectional stream opened by the server
|
||||
FirstOutgoingUniStreamServer StreamID = 3
|
||||
)
|
||||
|
||||
const (
|
||||
// FirstIncomingBidiStreamServer is the first bidirectional stream accepted by the server
|
||||
FirstIncomingBidiStreamServer = FirstOutgoingBidiStreamClient
|
||||
// FirstIncomingUniStreamServer is the first unidirectional stream accepted by the server
|
||||
FirstIncomingUniStreamServer = FirstOutgoingUniStreamClient
|
||||
// FirstIncomingBidiStreamClient is the first bidirectional stream accepted by the client
|
||||
FirstIncomingBidiStreamClient = FirstOutgoingBidiStreamServer
|
||||
// FirstIncomingUniStreamClient is the first unidirectional stream accepted by the client
|
||||
FirstIncomingUniStreamClient = FirstOutgoingUniStreamServer
|
||||
)
|
||||
|
||||
// StreamID calculates the stream ID.
|
||||
|
||||
Reference in New Issue
Block a user