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

ioutil.ReadAll never finishes downloading a file with disabled concurency #489

Closed
glebteterin opened this issue Jan 19, 2022 · 2 comments
Closed

Comments

@glebteterin
Copy link
Contributor

I'm connecting to a server with sftp.UseConcurrentReads(false), then open a file with Client.Open and read it to memory with ioutil.ReadAll. Due to the readAtSequential function (client.go) suppressing io.EOF error, the ioutil.ReadAll can't know when the file is fully read and won't finish.

I'm not sure I understand the reasoning for File.Read() doesn't return io.EOF, it seems like a bug introduced during refactoring. If so, would you accept a PR that fixes it?

@puellanivis
Copy link
Collaborator

OOooooof… yeah, this looks like it was copied from writeToSequential which has an entirely different semantic here. We definitely shouldn’t be swallowing the io.EOF for readAtSequential.

I’ll be happy to accept a PR. 👍

glebteterin added a commit to glebteterin/sftp that referenced this issue Jan 19, 2022
puellanivis added a commit that referenced this issue Jan 19, 2022
Fix missing io.EOF when concurency is disabled #489
@puellanivis
Copy link
Collaborator

Fixed in #490

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

No branches or pull requests

2 participants