From bbf8977f64d77c661bc71f6c0fa48ba9d64b9fa7 Mon Sep 17 00:00:00 2001 From: Lucas Clemente Date: Tue, 4 Jul 2017 18:02:45 +0200 Subject: [PATCH] Change h2quic.Server.Serve() to accept a net.PacketConn --- Changelog.md | 1 + h2quic/server.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 91c3fd4e..32cec5c0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,4 +11,5 @@ - Remove the `tls.Config` from the `quic.Config`. The `tls.Config` must now be passed to the `Dial` and `Listen` functions as a separate parameter. See the [Godoc](https://godoc.org/github.com/lucas-clemente/quic-go) for details. - Changed the log level environment variable to only accept strings ("DEBUG", "INFO", "ERROR"), see [the wiki](https://github.com/lucas-clemente/quic-go/wiki/Logging) for more details. - Rename the `h2quic.QuicRoundTripper` to `h2quic.RoundTripper` +- Changed `h2quic.Server.Serve()` to accept a `net.PacketConn` - Various bugfixes diff --git a/h2quic/server.go b/h2quic/server.go index e391ceb1..a2f13bf7 100644 --- a/h2quic/server.go +++ b/h2quic/server.go @@ -69,11 +69,11 @@ func (s *Server) ListenAndServeTLS(certFile, keyFile string) error { } // Serve an existing UDP connection. -func (s *Server) Serve(conn *net.UDPConn) error { +func (s *Server) Serve(conn net.PacketConn) error { return s.serveImpl(s.TLSConfig, conn) } -func (s *Server) serveImpl(tlsConfig *tls.Config, conn *net.UDPConn) error { +func (s *Server) serveImpl(tlsConfig *tls.Config, conn net.PacketConn) error { if s.Server == nil { return errors.New("use of h2quic.Server without http.Server") }