mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 02:14:40 +01:00
Add a constant for the maximum number of attempts
This commit is contained in:
parent
0e2bb13254
commit
38e87f9a7b
1 changed files with 3 additions and 2 deletions
|
@ -316,11 +316,12 @@ func DNSExchange(
|
||||||
) (*dns.Msg, time.Duration, bool, error) {
|
) (*dns.Msg, time.Duration, bool, error) {
|
||||||
for {
|
for {
|
||||||
cancelChannel := make(chan struct{})
|
cancelChannel := make(chan struct{})
|
||||||
channel := make(chan DNSExchangeResponse, 6)
|
maxTries := 3
|
||||||
|
channel := make(chan DNSExchangeResponse, 2*maxTries)
|
||||||
var err error
|
var err error
|
||||||
options := 0
|
options := 0
|
||||||
|
|
||||||
for tries := 0; tries < 3; tries++ {
|
for tries := 0; tries < maxTries; tries++ {
|
||||||
if tryFragmentsSupport {
|
if tryFragmentsSupport {
|
||||||
queryCopy := query.Copy()
|
queryCopy := query.Copy()
|
||||||
queryCopy.Id += uint16(options)
|
queryCopy.Id += uint16(options)
|
||||||
|
|
Loading…
Add table
Reference in a new issue