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.
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
Implement preserve #81
Implement preserve #81
Changes from 6 commits
c3d1d4d
c053ea1
1931b92
6ea89a2
3b14bf5
3a2c847
43016bf
8bc0846
a8f3ca4
ed51210
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I am a bit lost here what this is supposed to mean.
Buffered
returns the number of bytes remaining in the read buffer, but as far as I see the buffer should already be empty since we read all its information for parsing the time message. We do not make anyAck
s in between so we do not expect another message back from the remote. My suggestion is to add more comments to this function to make it more clear why certain checks are necessary and what part of the protocol we are considering at each line in the code.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.
https://github.com/charmbracelet/wish/blob/e6e9fc4c8a253cf263334efa95d31e7af7034970/scp/scp.go#L128
wish is a popular ssh custom server. Their implementation allows for sending out the time and permissions in the same message. There is an argument that it's not following the protocol, but being so popular, I thought it would be nice to accommodate and take into consideration the instances in which someone could make a custom ssh implementation.
If you believe we shouldn't accommodate that kind of custom implementation, then I will remove that piece of logic to keep it clean.
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.
I see, I think you make a good argument for keeping it, but make sure that it does not interfere with implementations that do follow the protocol.
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.
What happens when
atime
is parsed in the wrong way so that it is differnet from zero but not the expected value? I would expect a comparison between the received value and the actual value here, would that be difficult to add?