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

Improve EOF processing for potential re-reading #43

Closed
wants to merge 1 commit into from

Conversation

zinid
Copy link

@zinid zinid commented Jun 29, 2024

This update improves EOF processing by saving and restoring the position, allowing the caller to re-read if necessary. This approach matches the strategy used in the seek_absgp() function. This change only applies to the read_packet_expected() function.

There is a minor API change though: instead of returning NoCapturePatternFound when a premature EOF is reached, it now returns UnexpectedEof. I believe this change won't cause any difficulties for users.

@zinid zinid force-pushed the rewind-on-eof branch 9 times, most recently from 0466a72 to b5c6633 Compare June 29, 2024 17:48
@zinid
Copy link
Author

zinid commented Jul 8, 2024

Hello, could we please have this pull request reviewed? Is there anything I should improve?

@AlexTMjugador
Copy link
Contributor

AlexTMjugador commented Oct 13, 2024

Hi @zinid, thanks for the PR! In PR #44, I've fixed the CI check that was failing due to a too low MSRV. It might be a good idea to rebase this PR on top of the latest master to take advantage of that fix 😄

On the other hand, for what it's worth, I'm not sure I understand the need for this improvement. Typically, an end-of-file condition is final, meaning the stream won’t ever produce more data. The only exception that comes to mind is when another process appends to the same file, but that sounds like a rare and not so useful case to handle. What's your use case for these changes?

@zinid
Copy link
Author

zinid commented Oct 14, 2024

Hello, I think this is not relevant for me anymore, I will close the PR.

@zinid zinid closed this Oct 14, 2024
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.

2 participants