Skip to content

Fix update of bytes read in the encoder state machine.#456

Open
orium wants to merge 1 commit intoNullus157:mainfrom
orium:fix-flush-encoder
Open

Fix update of bytes read in the encoder state machine.#456
orium wants to merge 1 commit intoNullus157:mainfrom
orium:fix-flush-encoder

Conversation

@orium
Copy link
Contributor

@orium orium commented Feb 11, 2026

Previously we were not updating the number of bytes read: we were just changing the local binding of read. This means that read was always zero and therefore the encoder never flushed.

Fixes #455

@orium orium force-pushed the fix-flush-encoder branch from 494f082 to 5996a6f Compare February 11, 2026 16:12
@orium
Copy link
Contributor Author

orium commented Feb 11, 2026

I'll try to add a test for this. Right now I'm investigating the failing tests.

@orium
Copy link
Contributor Author

orium commented Feb 11, 2026

I'll try to add a test for this. Right now I'm investigating the failing tests.

This seems to be another bug introduced in 8947fed. I've reverted that commit in this PR (first commit). I think the bug is that we were turning some Poll::Pending into Poll::Ready(Ok(0)) signaling an EOF when there's actually more data to read.

@orium orium changed the title Fix update of bytes read in the encoder state machine. [WIP!] Fix update of bytes read in the encoder state machine. Feb 11, 2026
@orium orium changed the title [WIP!] Fix update of bytes read in the encoder state machine. [WIP] Fix update of bytes read in the encoder state machine. Feb 11, 2026
@orium orium marked this pull request as draft February 11, 2026 18:02
@orium orium changed the title [WIP] Fix update of bytes read in the encoder state machine. Fix update of bytes read in the encoder state machine. Feb 11, 2026
@orium orium force-pushed the fix-flush-encoder branch from 4ed8167 to 2954200 Compare February 12, 2026 16:02
@orium orium marked this pull request as ready for review February 12, 2026 16:06
@orium
Copy link
Contributor Author

orium commented Feb 12, 2026

@NobodyXu This should be ready for review now.

Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks the encoder the change look good to me, but the decoder change really got me confused on what exactly is changed (its behavior is identical before and after this PR) and not related to this PR, can we have the decoder change reverted please?

@orium orium force-pushed the fix-flush-encoder branch from 2954200 to f87860a Compare February 13, 2026 10:20
Previously we were not updating the number of bytes read: we were just changing
the local binding of `read`. This means that read was always zero and therefore
the encoder never flushed.

Fixes Nullus157#455.
@orium orium force-pushed the fix-flush-encoder branch from f87860a to a093589 Compare February 13, 2026 16:09
Copy link
Collaborator

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM

I will ask @robjtede to also review just in case I'd make a mistake somewhere

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The encoder is never flushing

2 participants