diff --git a/dnscrypt-proxy/estimators.go b/dnscrypt-proxy/estimators.go index 461be79e..47ca6ffd 100644 --- a/dnscrypt-proxy/estimators.go +++ b/dnscrypt-proxy/estimators.go @@ -29,11 +29,7 @@ func (questionSizeEstimator *QuestionSizeEstimator) MinQuestionSize() int { func (questionSizeEstimator *QuestionSizeEstimator) blindAdjust() { questionSizeEstimator.Lock() - if MaxDNSUDPPacketSize-questionSizeEstimator.minQuestionSize < questionSizeEstimator.minQuestionSize { - questionSizeEstimator.minQuestionSize = MaxDNSUDPPacketSize - } else { - questionSizeEstimator.minQuestionSize *= 2 - } + questionSizeEstimator.minQuestionSize = Min(MaxDNSUDPPacketSize, questionSizeEstimator.minQuestionSize*2) questionSizeEstimator.ewma.Set(float64(questionSizeEstimator.minQuestionSize)) questionSizeEstimator.Unlock() }