TUN-2788: cloudflared should store one ConnDigest per HA connection

This commit is contained in:
Adam Chalmers
2020-03-06 17:25:34 -06:00
parent db9b6541d0
commit 5376df5439
2 changed files with 13 additions and 12 deletions

View File

@@ -95,8 +95,8 @@ type ReconnectTunnelCredentialManager interface {
ReconnectToken() ([]byte, error)
EventDigest() ([]byte, error)
SetEventDigest(eventDigest []byte)
ConnDigest() ([]byte, error)
SetConnDigest(connDigest []byte)
ConnDigest(connID uint8) ([]byte, error)
SetConnDigest(connID uint8, connDigest []byte)
}
type dupConnRegisterTunnelError struct{}
@@ -286,7 +286,7 @@ func ServeTunnel(
// check if we can use Quick Reconnects
if config.UseQuickReconnects {
if digest, connDigestErr := credentialManager.ConnDigest(); connDigestErr == nil {
if digest, connDigestErr := credentialManager.ConnDigest(connectionID); connDigestErr == nil {
connDigest = digest
}
}
@@ -392,7 +392,7 @@ func RegisterTunnel(
return processRegisterTunnelError(registrationErr, config.Metrics, register)
}
credentialManager.SetEventDigest(registration.EventDigest)
credentialManager.SetConnDigest(registration.ConnDigest)
credentialManager.SetConnDigest(connectionID, registration.ConnDigest)
return processRegistrationSuccess(config, logger, connectionID, registration, register)
}