mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-07 07:07:37 +03:00
Implement an actual estimator for the response size
Scale back the minimum question size when relevant. Did I mention that this is yet another thing that was never properly implemented in dnscrypt-proxy 1.x?
This commit is contained in:
parent
f4346691bc
commit
efd0477c2b
2 changed files with 24 additions and 2 deletions
|
@ -163,6 +163,8 @@ func (proxy *Proxy) processIncomingQuery(serverInfo *ServerInfo, serverProto str
|
|||
clientPc.(net.PacketConn).WriteTo(response, *clientAddr)
|
||||
if HasTCFlag(response) {
|
||||
proxy.questionSizeEstimator.blindAdjust()
|
||||
} else {
|
||||
proxy.questionSizeEstimator.adjust(len(response))
|
||||
}
|
||||
} else {
|
||||
response, err = PrefixWithSize(response)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue