mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 13:42:24 +00:00
Fix server deduplicaiton failure (#6900)
Some checks failed
Some checks failed
- Add a local method AreEquel to compare string values, return TRUE when compare between 'null' and 'string.Emtpy'
This commit is contained in:
parent
d561f10edc
commit
d0e2cc9442
1 changed files with 18 additions and 13 deletions
|
@ -951,22 +951,27 @@ namespace ServiceLib.Handler
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool AreEqual(string? a, string? b)
|
||||
{
|
||||
return string.Equals(a, b) || (string.IsNullOrEmpty(a) && string.IsNullOrEmpty(b));
|
||||
}
|
||||
|
||||
return o.ConfigType == n.ConfigType
|
||||
&& o.Address == n.Address
|
||||
&& AreEqual(o.Address, n.Address)
|
||||
&& o.Port == n.Port
|
||||
&& o.Id == n.Id
|
||||
&& o.Security == n.Security
|
||||
&& o.Network == n.Network
|
||||
&& o.HeaderType == n.HeaderType
|
||||
&& o.RequestHost == n.RequestHost
|
||||
&& o.Path == n.Path
|
||||
&& AreEqual(o.Id, n.Id)
|
||||
&& AreEqual(o.Security, n.Security)
|
||||
&& AreEqual(o.Network, n.Network)
|
||||
&& AreEqual(o.HeaderType, n.HeaderType)
|
||||
&& AreEqual(o.RequestHost, n.RequestHost)
|
||||
&& AreEqual(o.Path, n.Path)
|
||||
&& (o.ConfigType == EConfigType.Trojan || o.StreamSecurity == n.StreamSecurity)
|
||||
&& o.Flow == n.Flow
|
||||
&& o.Sni == n.Sni
|
||||
&& o.Alpn == n.Alpn
|
||||
&& o.Fingerprint == n.Fingerprint
|
||||
&& o.PublicKey == n.PublicKey
|
||||
&& o.ShortId == n.ShortId
|
||||
&& AreEqual(o.Flow, n.Flow)
|
||||
&& AreEqual(o.Sni, n.Sni)
|
||||
&& AreEqual(o.Alpn, n.Alpn)
|
||||
&& AreEqual(o.Fingerprint, n.Fingerprint)
|
||||
&& AreEqual(o.PublicKey, n.PublicKey)
|
||||
&& AreEqual(o.ShortId, n.ShortId)
|
||||
&& (!remarks || o.Remarks == n.Remarks);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue