@@ -17,11 +17,12 @@ import (
1717type trafficDecision int
1818
1919const (
20- doNothing trafficDecision = 0
21- deleteTunnel trafficDecision = 1 // delete the hostinfo on our side, do not notify the remote
22- closeTunnel trafficDecision = 2 // delete the hostinfo and notify the remote
23- swapPrimary trafficDecision = 3
24- migrateRelays trafficDecision = 4
20+ doNothing trafficDecision = 0
21+ deleteTunnel trafficDecision = 1 // delete the hostinfo on our side, do not notify the remote
22+ closeTunnel trafficDecision = 2 // delete the hostinfo and notify the remote
23+ swapPrimary trafficDecision = 3
24+ migrateRelays trafficDecision = 4
25+ tryRehandshake trafficDecision = 5
2526)
2627
2728type connectionManager struct {
@@ -193,6 +194,9 @@ func (n *connectionManager) doTrafficCheck(localIndex uint32, p, nb, out []byte,
193194
194195 case migrateRelays :
195196 n .migrateRelayUsed (hostinfo , primary )
197+
198+ case tryRehandshake :
199+ n .tryRehandshake (hostinfo )
196200 }
197201
198202 n .resetRelayTrafficCheck (hostinfo )
@@ -321,7 +325,8 @@ func (n *connectionManager) makeTrafficDecision(localIndex uint32, p, nb, out []
321325 delete (n .pendingDeletion , hostinfo .localIndexId )
322326
323327 if mainHostInfo {
324- n .tryRehandshake (hostinfo )
328+ decision = tryRehandshake
329+
325330 } else {
326331 if n .shouldSwapPrimary (hostinfo , primary ) {
327332 decision = swapPrimary
0 commit comments