expose the quic.Config in the h2quic.Server

This commit is contained in:
Marten Seemann
2017-07-08 16:21:20 +08:00
parent 79c7ed4ed1
commit d94b57fe29
2 changed files with 19 additions and 8 deletions

View File

@@ -385,8 +385,7 @@ var _ = Describe("H2 server", func() {
})
AfterEach(func() {
err := s.Close()
Expect(err).NotTo(HaveOccurred())
Expect(s.Close()).To(Succeed())
})
It("may only be called once", func() {
@@ -405,6 +404,18 @@ var _ = Describe("H2 server", func() {
err = s.Close()
Expect(err).NotTo(HaveOccurred())
}, 0.5)
It("uses the quic.Config to start the quic server", func() {
conf := &quic.Config{HandshakeTimeout: time.Nanosecond}
var receivedConf *quic.Config
quicListenAddr = func(addr string, tlsConf *tls.Config, config *quic.Config) (quic.Listener, error) {
receivedConf = config
return nil, errors.New("listen err")
}
s.QuicConfig = conf
go s.ListenAndServe()
Eventually(func() *quic.Config { return receivedConf }).Should(Equal(conf))
})
})
Context("ListenAndServeTLS", func() {