From 881f078759a5e6a54239ed28eb8c2b0647239a05 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Fri, 25 Jun 2021 10:58:42 +0200 Subject: [PATCH] Removed engine.Stop --- cmd/up.go | 6 ------ connection/engine.go | 17 ----------------- 2 files changed, 23 deletions(-) diff --git a/cmd/up.go b/cmd/up.go index 91edf1a8d30..2646c8fd30b 100644 --- a/cmd/up.go +++ b/cmd/up.go @@ -39,12 +39,6 @@ var ( iFaceBlackList[config.IFaceBlackList[i]] = struct{}{} } engine := connection.NewEngine(signalClient, config.StunTurnURLs, config.WgIface, config.WgAddr, iFaceBlackList) - defer func() { - err := engine.Stop() - if err != nil { - log.Fatal(err) - } - }() err = engine.Start(myKey, config.Peers) if err != nil { diff --git a/connection/engine.go b/connection/engine.go index 0f5c4841440..80928e0a35f 100644 --- a/connection/engine.go +++ b/connection/engine.go @@ -46,23 +46,6 @@ func NewEngine(signal *signal.Client, stunsTurns []*ice.URL, wgIface string, wgA iFaceBlackList: iFaceBlackList, } } -func (e *Engine) Stop() error { - err := iface.Delete() - if err != nil { - log.Errorf("error while deleting Wireguard interface") - return err - } - - err = e.signal.Close() - if err != nil { - log.Errorf("error while closing a connection to the signal server") - return err - } - for _, c := range e.conns { - c.Close() //nolint - } - return nil -} // Start creates a new tunnel interface and listens to signals from the Signal service. // It also creates an Go routine to handle each peer communication from the config file