Make the relay acknowledge all received commands
To that effect, bump liberty and the xC relay protocol version. Relay events have been reordered to improve forward compatibility. Also prevent use-after-free when serialization fails. xP now slightly throttles activity notifications, and indicates when there are unacknowledged commands.
This commit is contained in:
@@ -173,8 +173,11 @@ class RelayRPC {
|
||||
func send(data: RelayCommandData, callback: Callback? = nil) {
|
||||
self.commandSeq += 1
|
||||
let m = RelayCommandMessage(commandSeq: self.commandSeq, data: data)
|
||||
if let callback = callback {
|
||||
self.commandCallbacks[m.commandSeq] = callback
|
||||
self.commandCallbacks[m.commandSeq] = callback ?? { error, data in
|
||||
if data == nil {
|
||||
NSSound.beep()
|
||||
Logger().warning("\(error)")
|
||||
}
|
||||
}
|
||||
|
||||
var w = RelayWriter()
|
||||
|
||||
Reference in New Issue
Block a user