ogg icon indicating copy to clipboard operation
ogg copied to clipboard

Improve EOF processing for potential re-reading

Open zinid opened this issue 1 year ago • 1 comments

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 avatar Jun 29 '24 12:06 zinid

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

zinid avatar Jul 08 '24 08:07 zinid

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?

AlexTMjugador avatar Oct 13 '24 22:10 AlexTMjugador

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

zinid avatar Oct 14 '24 16:10 zinid