Postpone keys setup until after PUSH_REPLY

And rename to setupEncryption() for ambiguity with SessionKey.
This commit is contained in:
Davide De Rosa 2018-09-02 00:17:01 +02:00
parent 0360a32d33
commit c01ac7e1e3
1 changed files with 3 additions and 3 deletions

View File

@ -848,8 +848,6 @@ public class SessionProxy {
return
}
setupKeys()
negotiationKey.controlState = .preIfConfig
nextPushRequestDate = Date().addingTimeInterval(negotiationKey.softReset ? CoreConfiguration.softResetDelay : CoreConfiguration.retransmissionLimit)
pushRequest()
@ -891,6 +889,8 @@ public class SessionProxy {
return
}
setupEncryption()
authenticator = nil
negotiationKey.startHandlingPackets(
withPeerId: peerId,
@ -1007,7 +1007,7 @@ public class SessionProxy {
}
// Ruby: setup_keys
private func setupKeys() {
private func setupEncryption() {
guard let auth = authenticator else {
fatalError("Setting up keys without having authenticated")
}