Fix for truncation/corruption on long json responses in webconfig#1618
Open
mattaaron79 wants to merge 1 commit intoOpenStickCommunity:mainfrom
Open
Fix for truncation/corruption on long json responses in webconfig#1618mattaaron79 wants to merge 1 commit intoOpenStickCommunity:mainfrom
mattaaron79 wants to merge 1 commit intoOpenStickCommunity:mainfrom
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.
Description
Fixed truncated/corrupted json responses. In webconfig.cpp set_file_data() had a line which set the file index to its length. I think this was accidentally working, but with long json responses was causing responses to get truncated (I was observing a single character getting cut off the json response, the closing bracket). It's possible the index was wrapping around back around via a modulus operation somewhere, but set to 1 instead of 0. Looking at the dependency, the index should indicate how much of the file has been sent out so far, which I believe should always start at zero, as we are initializing the response here.
Proposed Changes
Type of Change
Testing Instructions
Testing is difficult here in the main branch, as our json responses aren't usually long enough to trigger the original bug, but I and other developers have noticed the bug with features that return longer responses (Pod, for example).