change: config: handle NetProbe fatal error and run only if not offline
All errors returned from NetProbe are managed as fatal later. Decide, connection issues are not fatal but bad configuration is. Without this configuration errors are silently ignored here.
This commit is contained in:
parent
32c387318a
commit
8c6a968e27
|
@ -469,9 +469,10 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error {
|
|||
proxy.listenAddresses = nil
|
||||
}
|
||||
dlog.Noticef("dnscrypt-proxy %s", AppVersion)
|
||||
NetProbe(netprobeAddress, netprobeTimeout)
|
||||
|
||||
if !config.OfflineMode {
|
||||
if err := NetProbe(netprobeAddress, netprobeTimeout); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := config.loadSources(proxy); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
|
@ -39,7 +38,6 @@ func NetProbe(address string, timeout int) error {
|
|||
dlog.Notice("Network connectivity detected")
|
||||
return nil
|
||||
}
|
||||
es := "Timeout while waiting for network connectivity"
|
||||
dlog.Error(es)
|
||||
return errors.New(es)
|
||||
dlog.Error("Timeout while waiting for network connectivity")
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
|
@ -43,7 +42,6 @@ func NetProbe(address string, timeout int) error {
|
|||
dlog.Notice("Network connectivity detected")
|
||||
return nil
|
||||
}
|
||||
es := "Timeout while waiting for network connectivity"
|
||||
dlog.Error(es)
|
||||
return errors.New(es)
|
||||
dlog.Error("Timeout while waiting for network connectivity")
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue