control-channel: a matrix change resets the dial budget
This commit is contained in:
1 parent
5a9a1dd60a
commit
4e4a6d745c
2 files changed
+14
-4
No files matched your search
@@ -128,12 +128,19 @@ public final class ControlChannel: @unchecked Sendable {
|
||||
public func reconfigure(_ new: ChannelConfig) {
|
||||
queue.async { [self] in
|
||||
let full = new.needsFullReopen(comparedTo: config)
|
||||
let matrixChanged = new.matrixNames != config.matrixNames
|
||||
config = new
|
||||
if full {
|
||||
guard !full else {
|
||||
reopen()
|
||||
} else {
|
||||
updateClients(now: monotonicNow())
|
||||
return
|
||||
}
|
||||
if matrixChanged {
|
||||
// Editing the matrix is a reconnect trigger: a name added after
|
||||
// the connect budget expired must get its own 30 s to answer.
|
||||
dialers.removeAll()
|
||||
dialDeadline = monotonicNow() + ControlChannel.connectTimeout
|
||||
}
|
||||
updateClients(now: monotonicNow())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user