svc/connect.in: Use new `FORCEKX -quiet' when attempting reconnect.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 28 Apr 2022 13:15:31 +0000 (14:15 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 30 Apr 2022 00:51:38 +0000 (01:51 +0100)
If the remote peer has forgotten us, and we must run a command to
reinform it of our existence, then we shouldn't immediately send key-
exchange messages because they'll probably be rejected.  Instead, use
the new `-quiet' option to cancel the cooling-off timer and wait for it
to contact us -- similarly to how we used `-cork' when adding the peer
in the first place.

svc/connect.in

index 9dda65b..cb64000 100644 (file)
@@ -445,7 +445,7 @@ class PingPeer (object):
       peer = Peer(me._peer)
       if me._connectp or me._knockp:
         S.warn('connect', 'reconnecting', me._peer)
-        S.forcekx(me._peer)
+        S.forcekx(me._peer, quiet = not me._knockp)
         if me._connectp: T.spawn(run_connect, peer, peer.get('connect'))
         me._timer = M.SelTimer(time() + me._every, me._time)
         me._sabotage = False