From 0aff48911dc55226ef1cbd50bf60e0671005b85b Mon Sep 17 00:00:00 2001 From: Julien Benoist Date: Wed, 20 Sep 2017 16:51:00 -0700 Subject: [PATCH] copy KeepAlive value from the server quic.Config --- server.go | 1 + server_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/server.go b/server.go index ff75a503..25e975a3 100644 --- a/server.go +++ b/server.go @@ -149,6 +149,7 @@ func populateServerConfig(config *Config) *Config { HandshakeTimeout: handshakeTimeout, IdleTimeout: idleTimeout, AcceptCookie: vsa, + KeepAlive: config.KeepAlive, MaxReceiveStreamFlowControlWindow: maxReceiveStreamFlowControlWindow, MaxReceiveConnectionFlowControlWindow: maxReceiveConnectionFlowControlWindow, } diff --git a/server_test.go b/server_test.go index f10b4204..5f58115a 100644 --- a/server_test.go +++ b/server_test.go @@ -349,6 +349,7 @@ var _ = Describe("Server", func() { AcceptCookie: acceptCookie, HandshakeTimeout: 1337 * time.Hour, IdleTimeout: 42 * time.Minute, + KeepAlive: true, } ln, err := Listen(conn, &tls.Config{}, &config) Expect(err).ToNot(HaveOccurred()) @@ -360,6 +361,7 @@ var _ = Describe("Server", func() { Expect(server.config.HandshakeTimeout).To(Equal(1337 * time.Hour)) Expect(server.config.IdleTimeout).To(Equal(42 * time.Minute)) Expect(reflect.ValueOf(server.config.AcceptCookie)).To(Equal(reflect.ValueOf(acceptCookie))) + Expect(server.config.KeepAlive).To(BeTrue()) }) It("fills in default values if options are not set in the Config", func() { @@ -370,6 +372,7 @@ var _ = Describe("Server", func() { Expect(server.config.HandshakeTimeout).To(Equal(protocol.DefaultHandshakeTimeout)) Expect(server.config.IdleTimeout).To(Equal(protocol.DefaultIdleTimeout)) Expect(reflect.ValueOf(server.config.AcceptCookie)).To(Equal(reflect.ValueOf(defaultAcceptCookie))) + Expect(server.config.KeepAlive).To(BeFalse()) }) It("listens on a given address", func() {