-
Notifications
You must be signed in to change notification settings - Fork 240
fix for #70 #120
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
base: master
Are you sure you want to change the base?
fix for #70 #120
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -562,8 +562,8 @@ FTP.prototype.get = function(path, zcomp, cb) { | |
| if (!done) { | ||
| done = true; | ||
| ondone(); | ||
| return; | ||
| } | ||
| return; | ||
| } | ||
| source._emit.apply(source, Array.prototype.slice.call(arguments)); | ||
| }; | ||
|
|
@@ -614,8 +614,8 @@ FTP.prototype.get = function(path, zcomp, cb) { | |
| // just like a 150 | ||
| if (code === 150 || code === 125) { | ||
| started = true; | ||
| cb(undefined, source); | ||
| sock.resume(); | ||
| cb(undefined, source); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the original problem with this order was that 'data' events would start emitting immediately when calling
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’d actually find it handy to have the stream paused by default and let consumers resume it when they are ready, this is kind of cosmetic but I think many users can be confused by the current behaviour. The other change (moving return within the if block) is not cosmetic, in my case, it made the lib completely unusable, there was no way I would receive the end event without it and that broke piping. Did
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, it makes sense to leave it paused nowadays, but in node v0.8 and earlier, it would have been unexpected. Perhaps making these changes, bumping the required node version, and releasing a new major would be best.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes that makes sense, for now we can still merge this one and change the Did On Wed, Jun 3, 2015 at 5:23 PM, Brian White notifications@github.com
|
||
| } else { | ||
| lastreply = true; | ||
| ondone(); | ||
|
|
||
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.
Is this change actually necessary?
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.
yes, definitely, without it, when end is reached the last bytes are never emitted because return is called before we emit them!!