From 4b933697066205cae180a67a789fb35cbf27d112 Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Wed, 26 Aug 2020 09:17:33 +0300 Subject: [PATCH] fix not reading_until_length after buckets --- code/espurna/rfbridge.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/espurna/rfbridge.cpp b/code/espurna/rfbridge.cpp index 061c2799..68febdf0 100644 --- a/code/espurna/rfbridge.cpp +++ b/code/espurna/rfbridge.cpp @@ -199,6 +199,7 @@ struct RfbParser { void read_until_length(uint8_t c) { _payload.push_back(c); + if ((_payload_offset + _payload_length) == _payload.size()) { switch (_payload_code) { case CodeLearnOk: @@ -243,6 +244,8 @@ struct RfbParser { void reset() { _payload.clear(); + _payload_length = 0u; + _payload_offset = 0u; _payload_code = 0u; _state = &RfbParser::start; }