mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-11 00:38:24 +03:00
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:
+3
-1
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user