forked from quic-go/quic-go
set if a stream contributes to connection flow control
This depends on the version. In gQUIC, stream 1 and 3 don't contribute, in IETF QUIC only stream 0 doesn't contribute.
This commit is contained in:
@@ -68,6 +68,17 @@ func (vn VersionNumber) CryptoStreamID() StreamID {
|
||||
return 0
|
||||
}
|
||||
|
||||
// StreamContributesToConnectionFlowControl says if a stream contributes to connection-level flow control
|
||||
func (vn VersionNumber) StreamContributesToConnectionFlowControl(id StreamID) bool {
|
||||
if id == vn.CryptoStreamID() {
|
||||
return false
|
||||
}
|
||||
if vn.isGQUIC() && id == 3 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (vn VersionNumber) isGQUIC() bool {
|
||||
return vn > gquicVersion0 && vn <= maxGquicVersion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user