diff --git a/client/internal/peer/handshaker.go b/client/internal/peer/handshaker.go index 8e5ad7120..86beb1f1e 100644 --- a/client/internal/peer/handshaker.go +++ b/client/internal/peer/handshaker.go @@ -94,7 +94,6 @@ func (h *Handshaker) Handshake(args HandshakeArgs) (*OfferAnswer, error) { return cachedOfferAnswer, nil } - h.log.Debugf("send offer") err := h.sendOffer(args) if err != nil { return nil, err diff --git a/client/internal/peer/worker_ice.go b/client/internal/peer/worker_ice.go index 5c49b4033..601f88934 100644 --- a/client/internal/peer/worker_ice.go +++ b/client/internal/peer/worker_ice.go @@ -120,6 +120,8 @@ func (w *WorkerICE) SetupICEConnection(hasRelayOnLocally bool) { w.conn.OnStatusChanged(StatusConnecting) + w.log.Debugf("trying to establish ICE connection with peer %s", w.config.Key) + remoteOfferAnswer, err := w.conn.DoHandshake() if err != nil { if errors.Is(err, ErrSignalIsNotReady) { diff --git a/client/internal/peer/worker_relay.go b/client/internal/peer/worker_relay.go index 25eb41738..a00e8ef90 100644 --- a/client/internal/peer/worker_relay.go +++ b/client/internal/peer/worker_relay.go @@ -49,6 +49,8 @@ func (w *WorkerRelay) SetupRelayConnection() { return } + w.log.Debugf("trying to establish Relay connection with peer %s", w.config.Key) + remoteOfferAnswer, err := w.conn.DoHandshake() if err != nil { if errors.Is(err, ErrSignalIsNotReady) { @@ -59,6 +61,7 @@ func (w *WorkerRelay) SetupRelayConnection() { } if !w.isRelaySupported(remoteOfferAnswer) { + w.log.Infof("Relay is not supported by remote peer") // todo should we retry? // if the remote peer doesn't support relay make no sense to retry infinity // but if the remote peer supports relay just the connection is lost we should retry @@ -68,12 +71,14 @@ func (w *WorkerRelay) SetupRelayConnection() { // the relayManager will return with error in case if the connection has lost with relay server currentRelayAddress, err := w.relayManager.RelayAddress() if err != nil { + w.log.Infof("local Relay connection is lost, skipping connection attempt") continue } srv := w.preferredRelayServer(currentRelayAddress.String(), remoteOfferAnswer.RelaySrvAddress) relayedConn, err := w.relayManager.OpenConn(srv, w.config.Key) if err != nil { + w.log.Infof("failed to open relay connection: %s", err) continue }