fix: alienvault multipage disk read + rate limit skip - #67
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three issues in the AlienVault multipage fetch:
1. Disk read on resume without rate limit
When ResumePageNumber is greater than 1, pages 1..N are now read directly from disk and parsed, instead of re-fetching from the network. The rate limit sleep is skipped for disk reads.
2. Store NextPageURL in PageInfo metadata
SavePageData now accepts a nextPageURL parameter and stores it in the PageInfo struct. This allows accurate resume: on restart, the last saved next_page_url is used as the currentURL for the next network fetch, avoiding redundant re-fetching of already-saved pages.
3. Correct last-page detection for resumed fetches
Previously, a disk page with next_url empty could be mistaken for "no more pages". Now, when resuming (pageCount greater than or equal to startPage AND currentURL not equal to SourceURL), an empty response.Next is correctly identified as the last page of a previously interrupted run.
Changes