Skip to content

Commit

Permalink
dnsforward: separate upstream code
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Nov 21, 2023
1 parent db42254 commit 09db7d2
Show file tree
Hide file tree
Showing 3 changed files with 376 additions and 369 deletions.
10 changes: 5 additions & 5 deletions internal/dnsforward/dnsforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ import (
// DefaultTimeout is the default upstream timeout
const DefaultTimeout = 10 * time.Second

// defaultLocalTimeout is the default timeout for resolving addresses from
// locally-served networks. It is assumed that local resolvers should work much
// faster than ordinary upstreams.
const defaultLocalTimeout = 1 * time.Second

// defaultClientIDCacheCount is the default count of items in the LRU ClientID
// cache. The assumption here is that there won't be more than this many
// requests between the BeforeRequestHandler stage and the actual processing.
Expand Down Expand Up @@ -456,11 +461,6 @@ func (s *Server) startLocked() error {
return err
}

// defaultLocalTimeout is the default timeout for resolving addresses from
// locally-served networks. It is assumed that local resolvers should work much
// faster than ordinary upstreams.
const defaultLocalTimeout = 1 * time.Second

// setupLocalResolvers initializes the resolvers for local addresses. It
// assumes s.serverLock is locked or the Server not running.
func (s *Server) setupLocalResolvers(boot upstream.Resolver) (err error) {
Expand Down
Loading

0 comments on commit 09db7d2

Please sign in to comment.