-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Description
- Version: 5.1.1
- Platform: Linux bla-blah 3.13.0-86-generic lib: optimize require() path walking #130-Ubuntu SMP Mon Apr 18 18:27:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: _stream_writable.js
I am trying to close a writable stream using end()
with a callback. However, when end()
calls endWritable()
and state.finished
is set to false so the callback is set to trigger when the finish
event triggers. The problem is the state.finished
flag is only set within finishMaybe()
. This routine is only called from endWritable()
and afterWrite()
. However, once end()
is called you cannot write more data to the stream to trigger afterWrite()
to make state.finished = true
. It would seem that the end()
callback only works when the state.finished
is true.
I compared the 5.1.1 version of the code with the current master head within git. There have really been no changes to this area of the code.
My question is, How do I get the end()
callback to work? Is there a problem in the code? If so, is there a workaround? (so far I don't see one) Thanks for the time and any help.