make the idle_timeout transport parameter optional

This commit is contained in:
Marten Seemann
2018-09-19 13:28:10 -04:00
parent ec04ea8756
commit d0bc89fb74
2 changed files with 0 additions and 13 deletions

View File

@@ -160,12 +160,6 @@ var _ = Describe("Transport Parameters", func() {
Expect(params.StatelessResetToken).To(Equal(statelessResetToken))
})
It("rejects the parameters if the idle_timeout is missing", func() {
delete(parameters, idleTimeoutParameterID)
err := params.unmarshal(marshal(parameters))
Expect(err).To(MatchError("missing parameter"))
})
It("doesn't allow values below the minimum remote idle timeout", func() {
t := 2 * time.Second
Expect(t).To(BeNumerically("<", protocol.MinRemoteIdleTimeout))

View File

@@ -3,7 +3,6 @@ package handshake
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"time"
@@ -97,8 +96,6 @@ func (p *TransportParameters) getHelloMap() map[Tag][]byte {
}
func (p *TransportParameters) unmarshal(data []byte) error {
var foundIdleTimeout bool
for len(data) >= 4 {
paramID := binary.BigEndian.Uint16(data[:2])
paramLen := int(binary.BigEndian.Uint16(data[2:4]))
@@ -128,7 +125,6 @@ func (p *TransportParameters) unmarshal(data []byte) error {
}
p.MaxUniStreams = binary.BigEndian.Uint16(data[:2])
case idleTimeoutParameterID:
foundIdleTimeout = true
if paramLen != 2 {
return fmt.Errorf("wrong length for idle_timeout: %d (expected 2)", paramLen)
}
@@ -159,9 +155,6 @@ func (p *TransportParameters) unmarshal(data []byte) error {
if len(data) != 0 {
return fmt.Errorf("should have read all data. Still have %d bytes", len(data))
}
if !foundIdleTimeout {
return errors.New("missing parameter")
}
return nil
}