mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
fix routedDispatch
This commit is contained in:
@@ -414,15 +414,14 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
|
|||||||
}
|
}
|
||||||
|
|
||||||
sessionInbound := session.InboundFromContext(ctx)
|
sessionInbound := session.InboundFromContext(ctx)
|
||||||
|
if sessionInbound.User != nil {
|
||||||
if l != nil {
|
if l != nil {
|
||||||
// del connect count
|
// del connect count
|
||||||
if sessionInbound.User != nil {
|
|
||||||
if destination.Network == net.Network_TCP {
|
if destination.Network == net.Network_TCP {
|
||||||
defer func() {
|
defer func() {
|
||||||
l.ConnLimiter.DelConnCount(sessionInbound.User.Email, sessionInbound.Source.Address.IP().String())
|
l.ConnLimiter.DelConnCount(sessionInbound.User.Email, sessionInbound.Source.Address.IP().String())
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
var err error
|
var err error
|
||||||
l, err = limiter.GetLimiter(sessionInbound.Tag)
|
l, err = limiter.GetLimiter(sessionInbound.Tag)
|
||||||
@@ -430,13 +429,13 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
|
|||||||
newError("get limiter ", sessionInbound.Tag, " error: ", err).AtWarning().WriteToLog(session.ExportIDToError(ctx))
|
newError("get limiter ", sessionInbound.Tag, " error: ", err).AtWarning().WriteToLog(session.ExportIDToError(ctx))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if l != nil {
|
||||||
var destStr string
|
var destStr string
|
||||||
if destination.Address.Family().IsDomain() {
|
if destination.Address.Family().IsDomain() {
|
||||||
destStr = destination.Address.Domain()
|
destStr = destination.Address.Domain()
|
||||||
} else {
|
} else {
|
||||||
destStr = destination.Address.IP().String()
|
destStr = destination.Address.IP().String()
|
||||||
}
|
}
|
||||||
if l != nil {
|
|
||||||
if l.CheckDomainRule(destStr) {
|
if l.CheckDomainRule(destStr) {
|
||||||
newError(fmt.Sprintf(
|
newError(fmt.Sprintf(
|
||||||
"User %s access domain %s reject by rule",
|
"User %s access domain %s reject by rule",
|
||||||
@@ -458,6 +457,7 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var handler outbound.Handler
|
var handler outbound.Handler
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user