Skip to content

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
…157#418)"

This reverts commit 8947fed.

This introduced a bug. I think it's because we turn some `Poll::Pending` into
`Poll::Ready(Ok(0))` signaling an EOF when there's actually more data to read.
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 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.

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

1 participant