Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pavel-kirienko opened this issue Jul 12, 2023 · 0 comments

Comments

@pavel-kirienko
Copy link
Member

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
)

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

No branches or pull requests

1 participant