From ffc62c792c9a5196cb4ce7a353287dfe20db6524 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Fri, 9 Oct 2026 14:12:35 +0200 Subject: New upstream version 3.3.0~beta1+dfsg --- DecoderOutputFramer.cpp | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'DecoderOutputFramer.cpp') diff --git a/DecoderOutputFramer.cpp b/DecoderOutputFramer.cpp index 92c9c1e9..151c6afb 100644 --- a/DecoderOutputFramer.cpp +++ b/DecoderOutputFramer.cpp @@ -10,7 +10,44 @@ void DecoderOutputFramer::drain (QIODevice& device, auto const rawLine = device.readLine (); Event event {EventType::Malformed, generation_, rawLine, {}}; - if (rawLine.startsWith ("")) + if (rawLine.startsWith (" version="}; + QByteArray const errorPrefix {" status="}; + if (line.startsWith (readyPrefix)) + { + auto const versionText = line.mid (readyPrefix.size ()); + bool valid = !versionText.isEmpty (); + for (auto const character : versionText) + valid = valid && character >= '0' && character <= '9'; + bool numeric {false}; + auto const version = versionText.toInt (&numeric); + if (valid && numeric && version > 0) + { + event.type = EventType::Ready; + event.protocolVersion = version; + } + } + else if (line.startsWith (errorPrefix)) + { + auto const status = line.mid (errorPrefix.size ()); + bool valid = !status.isEmpty (); + for (auto const character : status) + valid = valid && ((character >= 'a' && character <= 'z') + || (character >= '0' && character <= '9') + || character == '-'); + if (valid) + { + event.type = EventType::Error; + event.errorStatus = status; + } + } + } + else if (rawLine.startsWith ("")) { qint32 generation {0}; if (!generation_ && DecoderIpc::parseStart (rawLine, &generation)) @@ -20,6 +57,11 @@ void DecoderOutputFramer::drain (QIODevice& device, event.generation = generation; } } + else if (rawLine.startsWith (" ")) + event.type = EventType::Rejected; + } else if (rawLine.startsWith ("")) { DecoderIpc::Completion completion {}; -- cgit v1.2.3