Plugin/Forward - autotune the dialTimeout for connection (#1852)
* - implement an auto-tunable dialTimeout for fallback. * - fix gofmt * - factorized timeout computation with readTimeout / updated readme / * - fix comment
This commit is contained in:
parent
6f865a9de7
commit
70c957d885
5 changed files with 84 additions and 52 deletions
|
@ -140,9 +140,9 @@ func TestCleanupAll(t *testing.T) {
|
|||
|
||||
tr := newTransport(s.Addr, nil /* no TLS */)
|
||||
|
||||
c1, _ := dns.DialTimeout("udp", tr.addr, dialTimeout)
|
||||
c2, _ := dns.DialTimeout("udp", tr.addr, dialTimeout)
|
||||
c3, _ := dns.DialTimeout("udp", tr.addr, dialTimeout)
|
||||
c1, _ := dns.DialTimeout("udp", tr.addr, defaultDialTimeout)
|
||||
c2, _ := dns.DialTimeout("udp", tr.addr, defaultDialTimeout)
|
||||
c3, _ := dns.DialTimeout("udp", tr.addr, defaultDialTimeout)
|
||||
|
||||
tr.conns["udp"] = []*persistConn{
|
||||
{c1, time.Now()},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue