Skip to content

Fix _readsegment dropping bytes read before end_tokens - #661

Open
malanore-z wants to merge 1 commit into
pinterest:masterfrom
malanore-z:fix-readsegment-data-loss
Open

malanore-z wants to merge 1 commit into
pinterest:masterfrom
malanore-z:fix-readsegment-data-loss

Conversation

@malanore-z

Copy link
Copy Markdown

_readsegment overwrote its buffer on each _recv(), discarding bytes read while the end_tokens had not appeared yet. This made raw_command return truncated responses when a reply arrived split across multiple socket reads. Accumulate the bytes read so far before reading more, matching _readline and _readvalue, and add a regression test.

_readsegment overwrote its buffer on each _recv(), discarding bytes read
while the end_tokens had not appeared yet. This made raw_command return
truncated responses when a reply arrived split across multiple socket
reads. Accumulate the bytes read so far before reading more, matching
_readline and _readvalue, and add a regression test.
@malanore-z
malanore-z requested review from a team and jparise as code owners October 13, 2026 18:06
@malanore-z

Copy link
Copy Markdown
Author

@jparise Hi, sorry to bother you. I've noticed this PR has been open for three weeks. Could you please take a look when you have some time?

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.

1 participant