Skip to content

Commit

Permalink
Expose quic server closed err (quic-go#3395)
Browse files Browse the repository at this point in the history
* 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 fb1f244.
  • Loading branch information
hareku authored and sudarshan-reddy committed Aug 9, 2022
1 parent 10fb3d2 commit ec73dd0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server.go
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ec73dd0

Please sign in to comment.