(stream, state)
| 25676 | // emit 'drain' before the write() consumer gets the 'false' return |
| 25677 | // value, and has a chance to attach a 'drain' listener. |
| 25678 | function onwriteDrain(stream, state) { |
| 25679 | if (state.length === 0 && state.needDrain) { |
| 25680 | state.needDrain = false; |
| 25681 | stream.emit('drain'); |
| 25682 | } |
| 25683 | } |
| 25684 | |
| 25685 | // if there's something in the buffer waiting, then process it |
| 25686 | function clearBuffer(stream, state) { |