forked from quic-go/quic-go
fix deadlock when closing the server and the connection at the same time
This commit is contained in:
@@ -274,12 +274,12 @@ func (s *baseServer) accept(ctx context.Context) (quicSession, error) {
|
||||
|
||||
// Close the server
|
||||
func (s *baseServer) Close() error {
|
||||
s.sessionHandler.CloseServer()
|
||||
s.mutex.Lock()
|
||||
defer s.mutex.Unlock()
|
||||
if s.closed {
|
||||
return nil
|
||||
}
|
||||
s.sessionHandler.CloseServer()
|
||||
if s.serverError == nil {
|
||||
s.serverError = errors.New("server closed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user