aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/service/service_tunnel.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-16 16:47:28 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-16 17:14:52 +0200
commitd260908423e877c04bf386de6a6f644dcf8ebd70 (patch)
treed1c41aa36d5f6305b03d8274d85d6ab454c682bf /service/service_tunnel.go
parentservice: print useragent in log (diff)
downloadwireguard-windows-d260908423e877c04bf386de6a6f644dcf8ebd70.tar.xz
wireguard-windows-d260908423e877c04bf386de6a6f644dcf8ebd70.zip
service: silently ignore routes that won't have a gateway
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--service/service_tunnel.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/service/service_tunnel.go b/service/service_tunnel.go
index 11234960..2d66bf32 100644
--- a/service/service_tunnel.go
+++ b/service/service_tunnel.go
@@ -105,8 +105,19 @@ func (service *tunnelService) Execute(args []string, r <-chan svc.ChangeRequest,
return
}
defer func() {
+ logIt := func(a ...interface{}) {
+ if logger != nil {
+ logger.Error.Println(a...)
+ } else {
+ log.Println(a...)
+ }
+ }
if x := recover(); x != nil {
- log.Printf("%v:\n%s", x, string(debug.Stack()))
+ for _, line := range append([]string{fmt.Sprint(x)}, strings.Split(string(debug.Stack()), "\n")...) {
+ if len(strings.TrimSpace(line)) > 0 {
+ logIt(line)
+ }
+ }
panic(x)
}
}()