[pbs-devel] [PATCH v3 pxar 07/58] decoder/accessor: add optional payload input stream

Christian Ebner c.ebner at proxmox.com
Thu Apr 4 11:49:20 CEST 2024


On 4/4/24 10:46, Fabian Grünbichler wrote:
> On April 3, 2024 2:18 pm, Christian Ebner wrote:
>> On 4/3/24 12:38, Fabian Grünbichler wrote:
>>>> +
>>>> +                if let Some(payload_input) = self.payload_input.as_mut() {
>>>
>>> this condition (cted below)
>>>
>>>> +                    if seq_read_position(payload_input)
>>>> +                        .await
>>>> +                        .transpose()?
>>>> +                        .is_none()
>>>> +                    {
>>>> +                        // Skip payload padding for injected chunks in sequential decoder
>>>> +                        let to_skip = payload_ref.offset - self.payload_consumed;
>>>
>>> should we add a check here for the invariant that offsets should only
>>> ever be increasing? (and avoid an underflow for corrupt/invalid archives
>>> ;))
>>
>> This is called by both, seq and random access decoder instances, so that
>> will not be possible I guess.
> 
> but.. payload_consumed only ever goes up? if the offset then jumps back
> to a position before the payload_consumed counter, this will underflow
> (to_skip is unsigned)?

Ah yes, will add the check for just the sequential decoder case...





More information about the pbs-devel mailing list