Skip to content

Redundant check for frame_index==0 in the high-overhead transfer reassembler #307

Description

@pavel-kirienko

Transfers may not begin with the first frame in the presence of frame reordering:

# DETECT NEW TRANSFERS. Either a newer TID or TID-timeout is reached.
# Restarting the transfer reassembly only makes sense if the new frame is a start of transfer.
# Otherwise, the new transfer would be impossible to reassemble anyway since the first frame is lost.
# As we can reassemble transfers with out-of-order frames, we need to also take into account the case
# when the first frame arrives when we already have some data from this transfer stored,
# in which case we must suppress the transfer-ID condition.
is_future_transfer_id = frame.transfer_id > self._transfer_id
is_tid_timeout = (
frame.index == 0
and frame.transfer_id != self._transfer_id
and timestamp.monotonic - self._ts.monotonic > transfer_id_timeout
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions