Share connection completion code
Across hard and soft reset.
This commit is contained in:
parent
c930cda065
commit
e900454504
|
@ -701,10 +701,7 @@ public class SessionProxy {
|
|||
enqueueControlPackets(code: .controlV1, key: negotiationKey.id, payload: cipherTextOut)
|
||||
|
||||
if negotiationKey.softReset {
|
||||
authenticator = nil
|
||||
negotiationKey.controlState = .connected
|
||||
connectedDate = Date()
|
||||
transitionKeys()
|
||||
completeConnection()
|
||||
}
|
||||
nextPushRequestDate = Date().addingTimeInterval(CoreConfiguration.retransmissionLimit)
|
||||
}
|
||||
|
@ -724,6 +721,14 @@ public class SessionProxy {
|
|||
}
|
||||
}
|
||||
|
||||
private func completeConnection() {
|
||||
setupEncryption()
|
||||
authenticator = nil
|
||||
negotiationKey.controlState = .connected
|
||||
connectedDate = Date()
|
||||
transitionKeys()
|
||||
}
|
||||
|
||||
// MARK: Control
|
||||
|
||||
// Ruby: handle_ctrl_pkt
|
||||
|
@ -888,11 +893,7 @@ public class SessionProxy {
|
|||
return
|
||||
}
|
||||
|
||||
setupEncryption()
|
||||
authenticator = nil
|
||||
negotiationKey.controlState = .connected
|
||||
connectedDate = Date()
|
||||
transitionKeys()
|
||||
completeConnection()
|
||||
|
||||
guard let remoteAddress = link?.remoteAddress else {
|
||||
fatalError("Could not resolve link remote address")
|
||||
|
|
Loading…
Reference in New Issue