mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 11:15:03 +03:00
fix(traffic): keep enforcing limits when one inbound's settings are broken
Disabling depleted clients rewrote each affected inbound's settings and aborted the whole lifecycle tick when one blob did not parse, so a node storing a malformed blob on the master switched expiry and quota checks off for every inbound. Unparseable node settings are now treated like a snapshot that drops the hub's clients (the hub keeps its copy), and an unparseable stored blob is left as it is while the client's rows are still disabled; the rewrite also works one level deep like the others.
This commit is contained in:
@@ -468,7 +468,9 @@ func adoptedWireInbound(c, snapIb *model.Inbound, adoptedSettings string) *model
|
||||
// still links some: a reset or half-started node, never an authoritative removal.
|
||||
func snapshotDropsEveryHubClient(tx *gorm.DB, inboundID int, wireSettings string) bool {
|
||||
clients, err := ParseInboundSettingsClients(wireSettings)
|
||||
if err != nil || len(clients) > 0 {
|
||||
// Settings that do not parse list no client the hub could keep either; storing them
|
||||
// would only hand every later reader of the row a blob it cannot use.
|
||||
if err == nil && len(clients) > 0 {
|
||||
return false
|
||||
}
|
||||
var links int64
|
||||
|
||||
Reference in New Issue
Block a user