forked from quic-go/quic-go
don't require the initial_max_stream_id in the transport parameters
The draft was recently changed to make this value optional.
This commit is contained in:
@@ -149,12 +149,6 @@ var _ = Describe("Transport Parameters", func() {
|
||||
Expect(err).To(MatchError("missing parameter"))
|
||||
})
|
||||
|
||||
It("rejects the parameters if the initial_max_stream_id is missing", func() {
|
||||
delete(parameters, initialMaxStreamIDParameterID)
|
||||
_, err := readTransportParamters(paramsMapToList(parameters))
|
||||
Expect(err).To(MatchError("missing parameter"))
|
||||
})
|
||||
|
||||
It("rejects the parameters if the idle_timeout is missing", func() {
|
||||
delete(parameters, idleTimeoutParameterID)
|
||||
_, err := readTransportParamters(paramsMapToList(parameters))
|
||||
|
||||
@@ -97,7 +97,6 @@ func readTransportParamters(paramsList []transportParameter) (*TransportParamete
|
||||
|
||||
var foundInitialMaxStreamData bool
|
||||
var foundInitialMaxData bool
|
||||
var foundInitialMaxStreamID bool
|
||||
var foundIdleTimeout bool
|
||||
|
||||
for _, p := range paramsList {
|
||||
@@ -115,7 +114,6 @@ func readTransportParamters(paramsList []transportParameter) (*TransportParamete
|
||||
}
|
||||
params.ConnectionFlowControlWindow = protocol.ByteCount(binary.BigEndian.Uint32(p.Value))
|
||||
case initialMaxStreamIDParameterID:
|
||||
foundInitialMaxStreamID = true
|
||||
if len(p.Value) != 4 {
|
||||
return nil, fmt.Errorf("wrong length for initial_max_stream_id: %d (expected 4)", len(p.Value))
|
||||
}
|
||||
@@ -134,7 +132,7 @@ func readTransportParamters(paramsList []transportParameter) (*TransportParamete
|
||||
}
|
||||
}
|
||||
|
||||
if !(foundInitialMaxStreamData && foundInitialMaxData && foundInitialMaxStreamID && foundIdleTimeout) {
|
||||
if !(foundInitialMaxStreamData && foundInitialMaxData && foundIdleTimeout) {
|
||||
return nil, errors.New("missing parameter")
|
||||
}
|
||||
return params, nil
|
||||
|
||||
Reference in New Issue
Block a user