This commit is contained in:
Zoltán Papp
2024-07-24 18:01:43 +02:00
parent fdf9756808
commit 8568fbffdd
3 changed files with 21 additions and 13 deletions

View File

@@ -23,8 +23,6 @@ type State struct {
PubKey string
FQDN string
ConnStatus ConnStatus
connStatusRelay ConnStatus
connStatusICE ConnStatus
ConnStatusUpdate time.Time
Relayed bool
LocalIceCandidateType string

View File

@@ -8,7 +8,6 @@ import (
log "github.com/sirupsen/logrus"
"github.com/netbirdio/netbird/iface"
relayClient "github.com/netbirdio/netbird/relay/client"
)
@@ -32,7 +31,6 @@ type WorkerRelay struct {
parentCtx context.Context
log *log.Entry
config ConnConfig
wgInterface iface.IWGIface
relayManager relayClient.ManagerService
conn WorkerRelayCallbacks
@@ -120,7 +118,7 @@ func (w *WorkerRelay) wgStateCheck(conn net.Conn) {
w.conn.OnDisconnected()
return
}
resetTime := (lastHandshake.Add(wgHandshakeOvertime + wgHandshakePeriod)).Sub(time.Now())
resetTime := time.Until(lastHandshake.Add(wgHandshakeOvertime + wgHandshakePeriod))
timer.Reset(resetTime)
case <-w.ctx.Done():
return