s3-upload-stream icon indicating copy to clipboard operation
s3-upload-stream copied to clipboard

Change handling of end override so finish gets called at a more appropriate time

Open wpears opened this issue 10 years ago • 0 comments

In the current version, by calling ws.originalEnd before cleaning up remaining data, a finish event is emitted which can cause problems if the user's code assumes finish means no more work will be done. I ran into this with pump, which will destroy a stream as soon as it gets a finish/close/end. Thus, the early finish was swallowing errors which would have otherwise been reported. Seems probable that, without this fix, the last flush of data could be accidentally blocked.

wpears avatar Jun 17 '15 21:06 wpears