Expose quic server closed err (#3395)

* expose quic server closed error

* http3.Server's serving method returns http.ErrServerClosed when quic listener is closed

* Revert "http3.Server's serving method returns http.ErrServerClosed when quic listener is closed"

This reverts commit fb1f244440466b5ebda6b4e0fdef8c342230b4b2.
This commit is contained in:
hareku 2022-04-25 19:10:55 +09:00 committed by GitHub
parent 1a0d577854
commit 823c609be4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,9 @@ import (
"github.com/lucas-clemente/quic-go/logging"
)
// ErrServerClosed is returned by the Listener or EarlyListener's Accept method after a call to Close.
var ErrServerClosed = errors.New("quic: Server closed")
// packetHandler handles packets
type packetHandler interface {
handlePacket(*receivedPacket)
@ -284,7 +287,7 @@ func (s *baseServer) Close() error {
return nil
}
if s.serverError == nil {
s.serverError = errors.New("server closed")
s.serverError = ErrServerClosed
}
// If the server was started with ListenAddr, we created the packet conn.
// We need to close it in order to make the go routine reading from that conn return.