From 584f441141923873cda7833aba153c793cfbf24b Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Wed, 28 Nov 2018 16:43:50 +0300 Subject: [PATCH] dnsforward library -- introduce IsRunning() --- dnsforward/dnsforward.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dnsforward/dnsforward.go b/dnsforward/dnsforward.go index 0e3686af..e72869f2 100644 --- a/dnsforward/dnsforward.go +++ b/dnsforward/dnsforward.go @@ -163,6 +163,16 @@ func (s *Server) Stop() error { return nil } +func (s *Server) IsRunning() bool { + s.RLock() + isRunning := true + if s.udpListen == nil { + isRunning = false + } + s.RUnlock() + return isRunning +} + // // Server reconfigure //