summaryrefslogtreecommitdiff
path: root/SmartDeviceLink
diff options
context:
space:
mode:
authorGeorge Miller <George@livio.io>2022-08-12 13:43:23 -0400
committerGeorge Miller <George@livio.io>2022-08-12 13:43:23 -0400
commitdd1184def6adf3116b69c8ecffd791e7200b4819 (patch)
tree4d914df16eff1e4d8bb492fea6891a13f1976f18 /SmartDeviceLink
parent92fd7ce4de56f335d55fa34d82c374f6d61d09f4 (diff)
downloadsdl_ios-dd1184def6adf3116b69c8ecffd791e7200b4819.tar.gz
fixing a bug
I realized that if we threw an error, the next byte, even if valid, would be consumed in processing the ERROR_STATE. Can't have that. Losing valid bytes is unacceptable.
Diffstat (limited to 'SmartDeviceLink')
-rw-r--r--SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.m b/SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.m
index 893ed6512..90bc3b157 100644
--- a/SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.m
+++ b/SmartDeviceLink/private/SDLProtocolReceivedMessageProcessor.m
@@ -82,6 +82,10 @@ typedef NS_ENUM(NSUInteger, ProcessorState) {
messageReadyBlock(self.header, [self.payloadBuffer copy]);
[self resetState];
}
+ //If we end up in error state, trigger the reset so we can properly handle the next byte
+ if (_state == ERROR_STATE) {
+ [self resetState];
+ }
}
}