Skip to content

Commit

Permalink
main: rm short form, consider for local
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Jun 13, 2023
1 parent d46aa00 commit 627ed3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Application Options:
be specified multiple times
--all-servers If specified, parallel queries to all configured upstream servers are enabled
--fastest-addr Respond to A or AAAA requests only with the fastest IP address
-w, --timeout= Timeout for outbound DNS queries to remote upstream servers in
--timeout= Timeout for outbound DNS queries to remote upstream servers in
seconds (default: 10s)
--cache If specified, DNS cache is enabled
--cache-size= Cache size (in bytes). Default: 64k
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/AdguardTeam/dnsproxy/proxy"
"github.com/AdguardTeam/dnsproxy/upstream"
"github.com/AdguardTeam/golibs/log"
"github.com/AdguardTeam/golibs/mathutil"
"github.com/AdguardTeam/golibs/netutil"
"github.com/ameshkov/dnscrypt/v2"
goFlags "github.com/jessevdk/go-flags"
Expand Down Expand Up @@ -112,7 +113,7 @@ type Options struct {

// Timeout for outbound DNS queries to remote upstream servers in seconds.
// Default is 10s.
Timeout time.Duration `yaml:"timeout" short:"w" long:"timeout" description:"Timeout for outbound DNS queries to remote upstream servers in seconds" default:"10s"`
Timeout time.Duration `yaml:"timeout" long:"timeout" description:"Timeout for outbound DNS queries to remote upstream servers in seconds" default:"10s"`

// Cache settings
// --
Expand Down Expand Up @@ -370,7 +371,7 @@ func initUpstreams(config *proxy.Config, options *Options) {
privUpsOpts := &upstream.Options{
HTTPVersions: httpVersions,
Bootstrap: options.BootstrapDNS,
Timeout: defaultLocalTimeout,
Timeout: mathutil.Min(defaultLocalTimeout, options.Timeout),
}
config.PrivateRDNSUpstreamConfig, err = proxy.ParseUpstreamsConfig(privUpstreams, privUpsOpts)
if err != nil {
Expand Down

0 comments on commit 627ed3b

Please sign in to comment.