mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
fix: sing内核删除用户逻辑不正确BUG
This commit is contained in:
@@ -299,7 +299,7 @@ func (n *Hysteria2node) getMasqHandler(tlsconfig *server.TLSConfig, conn net.Pac
|
||||
req.Header.Set("X-Forwarded-For", clientIP)
|
||||
}
|
||||
|
||||
if !c.Masquerade.Proxy.RewriteHost {
|
||||
if c.Masquerade.Proxy.RewriteHost {
|
||||
req.Host = req.URL.Host
|
||||
}
|
||||
},
|
||||
|
||||
@@ -29,7 +29,6 @@ type Sing struct {
|
||||
hookServer *HookServer
|
||||
router adapter.Router
|
||||
logFactory log.Factory
|
||||
inbounds map[string]adapter.Inbound
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -114,7 +114,7 @@ type UserDeleter interface {
|
||||
|
||||
func (b *Sing) DelUsers(users []panel.UserInfo, tag string) error {
|
||||
var del UserDeleter
|
||||
if i, ok := b.inbounds[tag]; ok {
|
||||
if i, found := b.box.Inbound().Get(tag); found {
|
||||
switch i.Type() {
|
||||
case "vmess":
|
||||
del = i.(*vmess.Inbound)
|
||||
|
||||
@@ -45,8 +45,14 @@ func (r *cachedReader) Cache(b *buf.Buffer) {
|
||||
if !mb.IsEmpty() {
|
||||
r.cache, _ = buf.MergeMulti(r.cache, mb)
|
||||
}
|
||||
b.Clear()
|
||||
rawBytes := b.Extend(buf.Size)
|
||||
cacheLen := r.cache.Len()
|
||||
if cacheLen <= b.Cap() {
|
||||
b.Clear()
|
||||
} else {
|
||||
b.Release()
|
||||
*b = *buf.NewWithSize(cacheLen)
|
||||
}
|
||||
rawBytes := b.Extend(cacheLen)
|
||||
n := r.cache.Copy(rawBytes)
|
||||
b.Resize(0, int32(n))
|
||||
r.Unlock()
|
||||
@@ -106,7 +112,7 @@ func init() {
|
||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
||||
d := new(DefaultDispatcher)
|
||||
if err := core.RequireFeatures(ctx, func(om outbound.Manager, router routing.Router, pm policy.Manager, sm stats.Manager, dc dns.Client) error {
|
||||
core.RequireFeatures(ctx, func(fdns dns.FakeDNSEngine) {
|
||||
core.OptionalFeatures(ctx, func(fdns dns.FakeDNSEngine) {
|
||||
d.fdns = fdns
|
||||
})
|
||||
return d.Init(config.(*Config), om, router, pm, sm, dc)
|
||||
|
||||
Reference in New Issue
Block a user