Skip to content

Commit

Permalink
all: imp code, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Dec 29, 2022
1 parent 7bbe893 commit 1dc6c7c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ See also the [v0.107.21 GitHub milestone][ms-v0.107.21].

### Fixed

- Freezing update with the `--update` flag used while another instance of
AdGuard Home running ([#4223], [#5191]).
- `AdGuardHome --update` freezing when another instance of AdGuard Home is
running ([#4223], [#5191]).
- The `--update` flag performing an update even with the same version.
- Failing HTTPS redirection on saving the encryption settings ([#4898]).
- Zeroing rules counter of erroneusly edited filtering rule lists ([#5290]).
Expand Down
6 changes: 3 additions & 3 deletions internal/dnsforward/dnsforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ func (s *Server) Prepare(conf *ServerConfig) (err error) {
return fmt.Errorf("preparing proxy: %w", err)
}

err = s.PrepareInternalProxy()
err = s.prepareInternalProxy()
if err != nil {
return fmt.Errorf("preparing internal proxy: %w", err)
}
Expand Down Expand Up @@ -527,9 +527,9 @@ func validateBlockingMode(mode BlockingMode, blockingIPv4, blockingIPv6 net.IP)
}
}

// PrepareInternalProxy initializes the DNS proxy that is used for internal DNS
// prepareInternalProxy initializes the DNS proxy that is used for internal DNS
// queries, such as public clients PTR resolving and updater hostname resolving.
func (s *Server) PrepareInternalProxy() (err error) {
func (s *Server) prepareInternalProxy() (err error) {
srvConf := s.conf
conf := &proxy.Config{
CacheEnabled: true,
Expand Down
5 changes: 2 additions & 3 deletions internal/home/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,15 @@ func initDNSServer(
}

Context.clients.dnsServer = Context.dnsServer
var dnsConfig dnsforward.ServerConfig

dnsConfig, err = generateServerConfig(tlsConf, httpReg)
dnsConf, err := generateServerConfig(tlsConf, httpReg)
if err != nil {
closeDNSServer()

return fmt.Errorf("generateServerConfig: %w", err)
}

err = Context.dnsServer.Prepare(&dnsConfig)
err = Context.dnsServer.Prepare(&dnsConf)
if err != nil {
closeDNSServer()

Expand Down
6 changes: 3 additions & 3 deletions internal/home/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ func run(opts options, clientBuildFS fs.FS) {
err = setupConfig(opts)
fatalOnError(err)

// TODO(e.burkov): This could probably be made much earlier and certainly
// could be done on the first run as well.
// TODO(e.burkov): This could be made earlier, probably as the option's
// effect.
cmdlineUpdate(opts)

if !Context.firstRun {
Expand Down Expand Up @@ -1056,7 +1056,7 @@ func cmdlineUpdate(opts options) {
err = updater.Update(Context.firstRun)
fatalOnError(err)

err = tryRestartService()
err = restartService()
if err != nil {
log.Debug("restarting service: %s", err)
log.Info("It seems AdGuard Home isn't running as a service, " +
Expand Down
4 changes: 2 additions & 2 deletions internal/home/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ func sendSigReload() {
log.Debug("service: sent signal to pid %d", pid)
}

// tryRestartService tries to restart the service. It returns an error if the
// restartService tries to restart the service. It returns an error if the
// service couldn't be restarted.
func tryRestartService() (err error) {
func restartService() (err error) {
// Call chooseSystem explicitly to introduce OpenBSD support for service
// package. It's a noop for other GOOS values.
chooseSystem()
Expand Down

0 comments on commit 1dc6c7c

Please sign in to comment.