Improve EOF processing for potential re-reading
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.
Hello, could we please have this pull request reviewed? Is there anything I should improve?
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?
Hello, I think this is not relevant for me anymore, I will close the PR.