Repository navigation
Container reader: keep scanning past gaps over 4096 bytes - #153
Merged
Merged
Conversation
The resync scan between streams stopped after 4096 unrecognised bytes, so a larger gap silently dropped every later stream and section. The scan now continues to the next zlib signature or section header up to the end of the file; gap accounting is unchanged. Fixes IOExtend#20 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #20
NwcContainerReader.Readstopped looking for the next zlib signature or#LcUStreamheader after 4096 unrecognised bytes. A larger gap therefore silently dropped every later stream and section.MaxResyncGapis removed, and the scan now continues up to the end of the data. The scan is still a single linear pass, andGapBefore/TrailingGapaccounting is unchanged. The decompression limits in #19 are a separate issue and are not touched here.Test:
ContainerReaderTests.Read_LargeGaps_PreservesLaterStreamsSectionsAndGapAccountingbuilds a container with three compressed payloads, two sections and 5000-byte gaps, with and without a trailing gap. It checks every payload, the section of each stream,GapBeforeandTrailingGap. Both cases fail without the src change (1 section instead of 2).dotnet build NwcIO.slnxsucceeds, andNwcIO.Testspasses locally: 241 passed, and 2 skipped because they need private Navisworks files (.NET 10.0.400 on Windows, withglobal.jsonpinned down to it temporarily; not committed).The change was drafted with OpenAI Codex, then reviewed and verified with Claude Code.
🤖 Generated with Claude Code