mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-01-13 02:22:48 +01:00
Reduce comparisons (#2148)
This commit is contained in:
parent
dc2fff05be
commit
568f54fabb
@ -106,10 +106,9 @@ func (proxy *Proxy) Encrypt(
|
||||
minQuestionSize += int(xpad[0])
|
||||
}
|
||||
paddedLength := Min(MaxDNSUDPPacketSize, (Max(minQuestionSize, QueryOverhead)+1+63) & ^63)
|
||||
if proto == "udp" && serverInfo.knownBugs.fragmentsBlocked {
|
||||
if serverInfo.knownBugs.fragmentsBlocked && proto == "udp" {
|
||||
paddedLength = MaxDNSUDPSafePacketSize
|
||||
}
|
||||
if serverInfo.Relay != nil && proto == "tcp" {
|
||||
} else if serverInfo.Relay != nil && proto == "tcp" {
|
||||
paddedLength = MaxDNSPacketSize
|
||||
}
|
||||
if QueryOverhead+len(packet)+1 > paddedLength {
|
||||
|
Loading…
Reference in New Issue
Block a user