wtclient: spin session key indices if required

If the tower returns CreateSessionCodeAlreadyExists in response to the
CreateSession message from the client, then skip forward a few key
indices until we find one that the server does not return the error
for. This will allow a client to recover after a data loss incident.
This commit is contained in:
Elle Mouton committed 2023-03-31 12:05:58 +02:00
1 parent 24016c35c7
commit ba33f6a697
3 files changed
+59 -36

No files matched your search

+5
View File
@@ -34,4 +34,9 @@ var (
// revoked state because the channel had not been previously registered
// with the client.
ErrUnregisteredChannel = errors.New("channel is not registered")
// ErrSessionKeyAlreadyUsed indicates that the client attempted to
// create a new session with a tower with a session key that has already
// been used in the past.
ErrSessionKeyAlreadyUsed = errors.New("session key already used")
)