Closed oskarkv closed 1 year ago
Yeah, looks like a bug. I think it's because when primitive-codec
is returning the remaining bytes, it does so by calling rewind-bytes
and then drop-bytes
. Unfortunately, rewind-bytes
sets the position to 0, breaking stuff.
On top of that SingleBufferSequence's drop-bytes-
fn was ALSO ignoring position... I think I have a fix. See #64
I'm using gloss from 5cc3fb6166dfbb05f1590d46f0a1601496acf697
I have this code:
And it works as expected, it prints:
So far, so good. But if I try the following buffer instead
it doesn't work as I expect. I expect it to have the same result as the first buffer, but it doesn't. This is printed:
So, it almost works. If I increase the
(int 5)
to(int 6)
it saysInsufficient bytes to decode frame.
, so it reads the5
and uses it as the length, but then also includes those bytes in the result, before calling thepost-decode
function. Is that really how it's supposed to work?