From fb1f244440466b5ebda6b4e0fdef8c342230b4b2 Mon Sep 17 00:00:00 2001 From: hareku Date: Mon, 25 Apr 2022 15:51:55 +0900 Subject: [PATCH] http3.Server's serving method returns http.ErrServerClosed when quic listener is closed --- http3/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/http3/server.go b/http3/server.go index 3897bbb9ffb..29357f77f52 100644 --- a/http3/server.go +++ b/http3/server.go @@ -255,6 +255,9 @@ func (s *Server) serveImpl(startListener func() (quic.EarlyListener, error)) err for { conn, err := ln.Accept(context.Background()) if err != nil { + if errors.Is(err, quic.ErrServerClosed) { + return http.ErrServerClosed + } return err } go s.handleConn(conn)