mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2024-12-28 00:20:13 +01:00
Revert "cleanup: estimators: simplify blindAdjust"
This reverts commit c699e7bec4
.
This commit is contained in:
parent
17a675021e
commit
b76db70a6c
@ -29,7 +29,11 @@ func (questionSizeEstimator *QuestionSizeEstimator) MinQuestionSize() int {
|
|||||||
|
|
||||||
func (questionSizeEstimator *QuestionSizeEstimator) blindAdjust() {
|
func (questionSizeEstimator *QuestionSizeEstimator) blindAdjust() {
|
||||||
questionSizeEstimator.Lock()
|
questionSizeEstimator.Lock()
|
||||||
questionSizeEstimator.minQuestionSize = Min(MaxDNSUDPPacketSize, questionSizeEstimator.minQuestionSize*2)
|
if MaxDNSUDPPacketSize-questionSizeEstimator.minQuestionSize < questionSizeEstimator.minQuestionSize {
|
||||||
|
questionSizeEstimator.minQuestionSize = MaxDNSUDPPacketSize
|
||||||
|
} else {
|
||||||
|
questionSizeEstimator.minQuestionSize *= 2
|
||||||
|
}
|
||||||
questionSizeEstimator.ewma.Set(float64(questionSizeEstimator.minQuestionSize))
|
questionSizeEstimator.ewma.Set(float64(questionSizeEstimator.minQuestionSize))
|
||||||
questionSizeEstimator.Unlock()
|
questionSizeEstimator.Unlock()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user