-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chunked: fix unmarshaling of file names #1879
chunked: fix unmarshaling of file names #1879
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does
xattrs
need this as well? - If this does not use
StringsBuf
, the fields should not be counted incount
- (I am ambivalent about the concept of
StringsBuf
, there is no documented rationale. Is it to save on per-object allocation cost?) - That
ReadStringAsSlice
does not process escapes is understandable but not immediately obvious to me. Consider turninggetString([]byte)
into agetStringWithoutEscapes(iter)
, to document that behavior in one place (and to save a bit on code size / repetitiveness).
The getString() function was used to extract string values, but it doesn't handle escaped characters. Replace it with iter.ReadString() that is slower but handles escaped characters correctly. Closes: containers#1878 Signed-off-by: Giuseppe Scrivano <[email protected]>
ab17050
to
f388a77
Compare
yeah it was done exactly for that reason, but now that we are not using for For now, I've simplified the implementation and dropped the StringsBuf performance hack, we can revisit later if needed |
(Just to be explicit, I’m completely fine with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for correctness, the simplification is nice.
I have no idea what’s the performance impact, I trust your judgement on this.
/lgtm |
The getString() function was used to extract string values, but it doesn't handle escaped characters. Replace it with iter.ReadString() that is slower but handles escaped characters correctly.
Closes: #1878