mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-16 17:32:23 +08:00
Fix clash server early close
This commit is contained in:
parent
4216afe62f
commit
6253e2e24c
|
@ -25,6 +25,7 @@ import (
|
||||||
"github.com/go-chi/cors"
|
"github.com/go-chi/cors"
|
||||||
"github.com/go-chi/render"
|
"github.com/go-chi/render"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
|
"github.com/sagernet/sing/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ adapter.ClashServer = (*Server)(nil)
|
var _ adapter.ClashServer = (*Server)(nil)
|
||||||
|
@ -103,10 +104,11 @@ func (s *Server) Start() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) Close() error {
|
func (s *Server) Close() error {
|
||||||
s.httpServer.Close()
|
return common.Close(
|
||||||
s.tcpListener.Close()
|
common.PtrOrNil(s.httpServer),
|
||||||
s.trafficManager.Close()
|
s.tcpListener,
|
||||||
return nil
|
s.trafficManager,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) RoutedConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, matchedRule adapter.Rule) (net.Conn, adapter.Tracker) {
|
func (s *Server) RoutedConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, matchedRule adapter.Rule) (net.Conn, adapter.Tracker) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user