fix: close connection after error handling in snell outbound

This commit is contained in:
wwqgtxx committed 2026-09-14 13:54:21 +08:00
1 parent 0436650753
commit 187c6342c4
1 file changed
+6 -1
+6 -1
View File
@@ -291,7 +291,12 @@ func NewSnell(option SnellOption) (*Snell, error) {
return nil, err
}
return s.streamConnContext(ctx, c)
sc, err := s.streamConnContext(ctx, c)
if err != nil {
_ = c.Close()
return nil, err
}
return sc, nil
})
}
return s, nil