Merge branch 'floating-reconnection-issues'
This commit is contained in:
commit
ec1a0bca3a
|
@ -403,6 +403,12 @@ extension TunnelKitProvider: GenericSocketDelegate {
|
|||
if reasserting {
|
||||
log.debug("Disconnection is recoverable, tunnel will reconnect in \(reconnectionDelay) milliseconds...")
|
||||
tunnelQueue.schedule(after: .milliseconds(reconnectionDelay)) {
|
||||
|
||||
// give up if reasserting cleared in the meantime
|
||||
guard self.reasserting else {
|
||||
return
|
||||
}
|
||||
|
||||
self.connectTunnel(upgradedSocket: upgradedSocket, preferredAddress: socket.remoteAddress)
|
||||
}
|
||||
return
|
||||
|
@ -456,9 +462,7 @@ extension TunnelKitProvider: SessionProxyDelegate {
|
|||
public func sessionDidStop(_: SessionProxy, shouldReconnect: Bool) {
|
||||
log.info("Session did stop")
|
||||
|
||||
if shouldReconnect {
|
||||
reasserting = true
|
||||
}
|
||||
reasserting = shouldReconnect
|
||||
socket?.shutdown()
|
||||
}
|
||||
|
||||
|
|
|
@ -979,7 +979,7 @@ public class SessionProxy {
|
|||
if let error = error {
|
||||
self?.queue.sync {
|
||||
log.error("Failed LINK write during control flush: \(error)")
|
||||
self?.deferStop(.reconnect, SessionError.failedLinkWrite)
|
||||
self?.deferStop(.shutdown, SessionError.failedLinkWrite)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -1097,7 +1097,7 @@ public class SessionProxy {
|
|||
if let error = error {
|
||||
self?.queue.sync {
|
||||
log.error("Data: Failed LINK write during send data: \(error)")
|
||||
self?.deferStop(.reconnect, SessionError.failedLinkWrite)
|
||||
self?.deferStop(.shutdown, SessionError.failedLinkWrite)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -1143,7 +1143,7 @@ public class SessionProxy {
|
|||
if let error = error {
|
||||
self?.queue.sync {
|
||||
log.error("Failed LINK write during send ack for packetId \(controlPacket.packetId): \(error)")
|
||||
self?.deferStop(.reconnect, SessionError.failedLinkWrite)
|
||||
self?.deferStop(.shutdown, SessionError.failedLinkWrite)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue