mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
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:
parent
1a0d577854
commit
823c609be4
1 changed files with 4 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue