copy KeepAlive value from the server quic.Config

This commit is contained in:
Julien Benoist
2017-09-20 16:51:00 -07:00
committed by Marten Seemann
parent ce9132e324
commit 0aff48911d
2 changed files with 4 additions and 0 deletions

View File

@@ -149,6 +149,7 @@ func populateServerConfig(config *Config) *Config {
HandshakeTimeout: handshakeTimeout,
IdleTimeout: idleTimeout,
AcceptCookie: vsa,
KeepAlive: config.KeepAlive,
MaxReceiveStreamFlowControlWindow: maxReceiveStreamFlowControlWindow,
MaxReceiveConnectionFlowControlWindow: maxReceiveConnectionFlowControlWindow,
}

View File

@@ -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() {