From f85b33a5b19803a9fb1ccfeea39484ca788d9821 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Thu, 21 Sep 2023 16:25:26 +0200 Subject: [PATCH] CoapPacket - Fixed bug in `fromBytes(ubyte[])` whereby we would parse the delta 0-12 option value correctly in the 0-12 length case but would never jump over it idx-wise - This effectively left us on the starting byte of the option value for the next round, instead of starting on the next `(option delta | option length)` --- source/doap/protocol/packet.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/doap/protocol/packet.d b/source/doap/protocol/packet.d index 1ba2abd..035e026 100644 --- a/source/doap/protocol/packet.d +++ b/source/doap/protocol/packet.d @@ -382,6 +382,9 @@ public class CoapPacket ubyte[] optionValue = data[idx..idx+optLen]; writeln("Option value: ", optionValue); + // Jump over the option value + idx+=optLen; + // Create the option and add it to the list of options CoapOption option; option.value = optionValue;