Skip to content
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

fixed sending stream resulting in a zero byte file #995

Closed
wants to merge 2 commits into from

Conversation

mpipet
Copy link
Contributor

@mpipet mpipet commented Jun 2, 2016

When using SFTP put() with the STDIN file descriptor and the content is piped (and not redirected, see this), fstat (see here) returns a size of 0. Consequently an empty file is created on the remote system, even if the local file descriptor provides a non-empty stream.

This PR provides a solution by reading the stream even if size is equal to zero, and letting fread detect the end of file.

Let me know if anything more can be done to get this PR merged

Thanks !

-cleaned typo
@terrafrost
Copy link
Member

I rebased this into one commit and then cherry-picked this into 2.0 and master:

6c8affc

Thanks!

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.

None yet

2 participants