-
Notifications
You must be signed in to change notification settings - Fork 117
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
Fix timeout on RETR with TLS #233
base: main
Are you sure you want to change the base?
Conversation
@ldm314 I am still planning on getting this merged in, I will have some time next week to address this. |
@@ -7,57 +7,59 @@ module.exports = { | |||
if (!this.fs.read) return this.reply(402, 'Not supported by file system'); | |||
|
|||
const filePath = command.arg; | |||
return this.fs.read(filePath, {start: this.restByteCount}) |
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.
We had this.fs.read
wrapped in a Promise.try
block previously because it isn't necessarily going to return a promise in every implementation - best to include that, and your tests will begin passing again most likely.
Found solution, replace src/commands/registration/retr.js:
|
@ideadesignmedia Feel free to create another PR that eclipses this one! |
[edit; amended my comment so as to not say anything too wrong on the internet] So it seems WinSCP expects a 150 response before STOR and RETR with TLS+passive. For some hysterical reason, WinSCP does not wait for 150 without TLS. On the other hand, FileZilla does not wait for a 150 response up front, but unlike WinSCP it breaks if you send two 150's (which my comment suggested initially, altho the PR already took care of it) |
The issue looks to be either a race condition or sequencing error. I changed the RETR command to send the 150 response after opening the file, but before waiting for the socket to be connected. This resolved this issue with both WinSCP and an old hardware device I am working with.