diff --git a/internal/handshake/params_negotiator.go b/internal/handshake/params_negotiator.go index 144d1317b..b3c79f8b5 100644 --- a/internal/handshake/params_negotiator.go +++ b/internal/handshake/params_negotiator.go @@ -88,11 +88,14 @@ func (h *paramsNegotiator) GetTransportParameters() []transportParameter { binary.BigEndian.PutUint32(initialMaxStreamID, math.MaxUint32) idleTimeout := make([]byte, 2) binary.BigEndian.PutUint16(idleTimeout, uint16(h.GetIdleConnectionStateLifetime().Seconds())) + maxPacketSize := make([]byte, 2) + binary.BigEndian.PutUint16(maxPacketSize, uint16(protocol.MaxReceivePacketSize)) params := []transportParameter{ {initialMaxStreamDataParameterID, initialMaxStreamData}, {initialMaxDataParameterID, initialMaxData}, {initialMaxStreamIDParameterID, initialMaxStreamID}, {idleTimeoutParameterID, idleTimeout}, + {maxPacketSizeParameterID, maxPacketSize}, } h.mutex.RLock() defer h.mutex.RUnlock() diff --git a/internal/handshake/params_negotiator_test.go b/internal/handshake/params_negotiator_test.go index 028778e18..8bb0a2c0d 100644 --- a/internal/handshake/params_negotiator_test.go +++ b/internal/handshake/params_negotiator_test.go @@ -49,13 +49,14 @@ var _ = Describe("Params Negotiator (for TLS)", func() { It("creates the parameters list", func() { buf := make([]byte, 4) values := paramsListToMap(pn.GetTransportParameters()) - Expect(values).To(HaveLen(4)) + Expect(values).To(HaveLen(5)) binary.BigEndian.PutUint32(buf, uint32(protocol.ReceiveStreamFlowControlWindow)) Expect(values).To(HaveKeyWithValue(initialMaxStreamDataParameterID, buf)) binary.BigEndian.PutUint32(buf, uint32(protocol.ReceiveConnectionFlowControlWindow)) Expect(values).To(HaveKeyWithValue(initialMaxDataParameterID, buf)) Expect(values).To(HaveKeyWithValue(initialMaxStreamIDParameterID, []byte{0xff, 0xff, 0xff, 0xff})) Expect(values).To(HaveKeyWithValue(idleTimeoutParameterID, []byte{0x50, 0x0})) + Expect(values).To(HaveKeyWithValue(maxPacketSizeParameterID, []byte{0x5, 0xac})) // 1452 = 0x5ac }) It("request ommision of the connection ID", func() {