Skip to content

Commit

Permalink
feat: add tcp-dial-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Apr 4, 2023
1 parent 15b493d commit 89701b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ Application Options:
--pad Set EDNS0 padding
--http3 Use HTTP/3 for DoH
--recaxfr Perform recursive AXFR
-f, --format= Output format (pretty, json, yaml, raw) (default:
pretty)
-f, --format= Output format (pretty, json, yaml, raw) (default: pretty)
--pretty-ttls Format TTLs in human readable format (default: true)
--color Enable color output
--question Show question section
Expand All @@ -61,8 +60,7 @@ Application Options:
--aa Set AA (Authoritative Answer) flag in query
--ad Set AD (Authentic Data) flag in query
--cd Set CD (Checking Disabled) flag in query
--rd Set RD (Recursion Desired) flag in query (default:
true)
--rd Set RD (Recursion Desired) flag in query (default: true)
--ra Set RA (Recursion Available) flag in query
--z Set Z (Zero) flag in query
--t Set TC (Truncated) flag in query
Expand All @@ -79,6 +77,7 @@ Application Options:
--quic-dial-timeout= QUIC dial timeout (default: 10s)
--quic-idle-timeout= QUIC stream open timeout (default: 10s)
--handshake-timeout= Handshake timeout (default: 10s)
--tcp-dial-timeout= TCP dial timeout (default: 5s)
--udp-buffer= Set EDNS0 UDP size in query (default: 1232)
-v, --verbose Show verbose log messages
--trace Show trace log messages
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type optsTemplate struct {
QUICOpenStreamTimeout time.Duration `long:"quic-idle-timeout" description:"QUIC stream open timeout" default:"10s"`

HandshakeTimeout time.Duration `long:"handshake-timeout" description:"Handshake timeout" default:"10s"`
TCPDialTimeout time.Duration `long:"tcp-dial-timeout" description:"TCP dial timeout" default:"5s"`

UDPBuffer uint16 `long:"udp-buffer" description:"Set EDNS0 UDP size in query" default:"1232"`
Verbose bool `short:"v" long:"verbose" description:"Show verbose log messages"`
Expand Down Expand Up @@ -606,7 +607,7 @@ All long form (--) flags can be toggled with the dig-standard +[no]flag notation
case "tls":
log.Debug("Using TLS transport")
for _, msg := range msgs {
reply, err := transport.TLS(&msg, server, tlsConfig, 5*time.Second)
reply, err := transport.TLS(&msg, server, tlsConfig, opts.TCPDialTimeout)
if err != nil {
return err
}
Expand Down

0 comments on commit 89701b7

Please sign in to comment.