Hysteria client: Remove closed instance conn (#7107)

https://github.com/XTLS/Xray-core/pull/7102#issuecomment-6054105250

Fixes https://github.com/XTLS/Xray-core/issues/7100

---------

Co-authored-by: LjhAUMEM <llnu14702@gmail.com>
This commit is contained in:
风扇滑翔翼
2026-10-10 08:08:06 +00:00
committed by GitHub
co-authored by LjhAUMEM
parent aa7aa9ad0a
commit c7dbfd5e1e
2 changed files with 39 additions and 13 deletions
+3 -1
View File
@@ -92,6 +92,8 @@ type Instance struct {
// Instance state
func (server *Instance) IsRunning() bool {
server.statusLock.Lock()
defer server.statusLock.Unlock()
return server.running
}
@@ -320,7 +322,7 @@ func (s *Instance) RequireFeatures(callback interface{}, optional bool) error {
// AddFeature registers a feature into current Instance.
func (s *Instance) AddFeature(feature features.Feature) error {
if s.running {
if s.IsRunning() {
if err := feature.Start(); err != nil {
errors.LogInfoInner(s.ctx, err, "failed to start feature")
}