Commit d988e383 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

xcmp-queue: Fix handling of encoded blobs (#889)

* xcmp-queue: Fix handling of encoded blobs

With #701 we tried to fix some infinite loop related to encoded blobs, however that lead actually to
not being able to process encoded blobs at all. The reason for this is that `decode_all` doesn't
consume the given input. The point of this function is that it returns an error if the data couldn't
be decoded or there is still data left. However, this means that the check
`remaining_fragments.len() < last_remaining_fragments.len()` would always fail.

We remove the while loop, because we decode the entire fragment anyway or it fails. Aka, we don't
need to loop here. Next we remove the broken check and we directly reset the
`remaining_fragments` (because `decode_all` doesn't consume anything).

* Restore correct behavior

We need to use a while loop, because there can be multiple `Vec<u8>`s. We also need to use `decode`,
because `decode_all` would otherwise return an error if the input is not empty afterwards.

* Remove unused import
parent eea1a655
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment