commit 2dd0c3fbb543474f293768f301a7719cba25d727 Author: David Fifield david@bamsoftware.com Date: Sat May 24 19:11:45 2014 -0700
Log that we received a signal only when we received a signal.
In the case where there were no active handlers, so we didn't wait for a second signal, it was printing "got second signal %!s(<nil>)". --- meek-client/meek-client.go | 4 ++-- meek-server/meek-server.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/meek-client/meek-client.go b/meek-client/meek-client.go index 645d1ef..ae27e11 100644 --- a/meek-client/meek-client.go +++ b/meek-client/meek-client.go @@ -390,13 +390,13 @@ func main() { case n := <-handlerChan: numHandlers += n case sig = <-sigChan: + log.Printf("got signal %s", sig) } } for _, ln := range listeners { ln.Close() }
- log.Printf("got signal %s", sig) if sig == syscall.SIGTERM { log.Printf("done") return @@ -409,9 +409,9 @@ func main() { case n := <-handlerChan: numHandlers += n case sig = <-sigChan: + log.Printf("got second signal %s", sig) } }
- log.Printf("got second signal %s", sig) log.Printf("done") } diff --git a/meek-server/meek-server.go b/meek-server/meek-server.go index c8c8d88..b0c9fa3 100644 --- a/meek-server/meek-server.go +++ b/meek-server/meek-server.go @@ -362,13 +362,13 @@ func main() { case n := <-handlerChan: numHandlers += n case sig = <-sigChan: + log.Printf("got signal %s", sig) } } for _, ln := range listeners { ln.Close() }
- log.Printf("got signal %s", sig) if sig == syscall.SIGTERM { log.Printf("done") return @@ -381,9 +381,9 @@ func main() { case n := <-handlerChan: numHandlers += n case sig = <-sigChan: + log.Printf("got second signal %s", sig) } }
- log.Printf("got second signal %s", sig) log.Printf("done") }
tor-commits@lists.torproject.org