mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2024-09-11 21:17:40 +03:00
Unbreak running without a captive portal configuration file
This commit is contained in:
parent
5843e49188
commit
60d4c98f31
@ -22,7 +22,7 @@ type CaptivePortalHandler struct {
|
||||
cancelChannels []chan struct{}
|
||||
}
|
||||
|
||||
func (captivePortalHandler *CaptivePortalHandler) Stop() {
|
||||
func (captivePortalHandler *CaptivePortalHandler) Stop() {
|
||||
for _, cancelChannel := range captivePortalHandler.cancelChannels {
|
||||
cancelChannel <- struct{}{}
|
||||
_ = <-cancelChannel
|
||||
|
@ -14,7 +14,9 @@ func NetProbe(proxy *Proxy, address string, timeout int) error {
|
||||
return nil
|
||||
}
|
||||
if captivePortalHandler, err := ColdStart(proxy); err == nil {
|
||||
defer captivePortalHandler.Stop()
|
||||
if captivePortalHandler != nil {
|
||||
defer captivePortalHandler.Stop()
|
||||
}
|
||||
} else {
|
||||
dlog.Critical(err)
|
||||
}
|
||||
|
@ -12,7 +12,9 @@ func NetProbe(proxy *Proxy, address string, timeout int) error {
|
||||
return nil
|
||||
}
|
||||
if captivePortalHandler, err := ColdStart(proxy); err == nil {
|
||||
defer captivePortalHandler.Stop()
|
||||
if captivePortalHandler != nil {
|
||||
defer captivePortalHandler.Stop()
|
||||
}
|
||||
} else {
|
||||
dlog.Critical(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user