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

request-server: don't return EOF if there is an unexpected error #392

Merged
merged 3 commits into from
Nov 18, 2020

Conversation

drakkan
Copy link
Collaborator

@drakkan drakkan commented Nov 5, 2020

io.EOF means no error so convert to ErrUnexpectedEOF if we detect a transfer error

Copy link
Member

@davecheney davecheney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test. Thank you

@drakkan
Copy link
Collaborator Author

drakkan commented Nov 5, 2020

Please add a test. Thank you

Done, thank you

drakkan added a commit to drakkan/sftpgo that referenced this pull request Nov 16, 2020
Include this patch:

pkg/sftp#393

to avoid request accumulation (no underlying fd) if we return an error.
Before this patch the accumulated requests are released only when the
client disconnects.

We use our fork for now to include

pkg/sftp#392

too
request-server_test.go Outdated Show resolved Hide resolved
This way even if we do not read from this channel, there is not a
blocked goroutine left hanging
Copy link
Collaborator

@puellanivis puellanivis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot find anything else to even nitpick about. 😆

@drakkan
Copy link
Collaborator Author

drakkan commented Nov 18, 2020

I cannot find anything else to even nitpick about.

Thank you!

@drakkan drakkan merged commit 7230c61 into pkg:master Nov 18, 2020
drakkan added a commit to drakkan/sftpgo that referenced this pull request Nov 18, 2020
These patches are now merged upstream:

pkg/sftp#392
pkg/sftp#393
@drakkan drakkan deleted the transfereof branch November 26, 2020 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants