Skip to content

SftpFileStream: No longer track write position separately #199

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

Merged
merged 12 commits into from
Jul 16, 2017

Conversation

drieseng
Copy link
Member

Reading from the SftpFileStream will now also affect the position at which a subsequent write will be performed. The position at which a write is performed in the server file is now always the current position minus the position in the buffer.

Also see #194.

Reading from the SftpFileStream will not also affect the position at which a subsequent write will be performed.
The position at which a write is performed in the server file is now always the current position minus the position in the buffer.
@drieseng
Copy link
Member Author

drieseng commented Mar 19, 2017

If and when we decide to accept this - or a similar - PR, we should also discuss the thread safety of this class.

drieseng and others added 11 commits June 5, 2017 19:10
…to read buffer when the read buffer is empty and count is greater than the number of bytes read from the server.

Lazily initialize read and write buffer.
When a server returns less number of bytes than the read buffer size, this *may* indicate that EOF has been reached. A subsequent (SSH_FXP_READ) server request is necessary to make sure EOF has effectively been reached.
Breaking out of the read loop avoids reading from the server twice to determine EOF: once in the read loop,
and once upon the next Read or ReadByte invocation.
@drieseng drieseng merged commit a9a38d7 into develop Jul 16, 2017
@drieseng drieseng deleted the sftpfilestream branch July 16, 2017 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant