Browse Source

Fix close quic.Listener

世界 2 years ago
parent
commit
230e8f895d
2 changed files with 2 additions and 2 deletions
  1. 1 1
      inbound/hysteria.go
  2. 1 1
      transport/v2rayquic/server.go

+ 1 - 1
inbound/hysteria.go

@@ -332,7 +332,7 @@ func (h *Hysteria) Close() error {
 	h.udpAccess.Unlock()
 	return common.Close(
 		&h.myInboundAdapter,
-		h.listener,
+		common.PtrOrNil(h.listener),
 		h.tlsConfig,
 	)
 }

+ 1 - 1
transport/v2rayquic/server.go

@@ -94,5 +94,5 @@ func (s *Server) streamAcceptLoop(conn quic.Connection) error {
 }
 
 func (s *Server) Close() error {
-	return common.Close(s.udpListener, s.quicListener)
+	return common.Close(s.udpListener, common.PtrOrNil(s.quicListener))
 }