(stream, state)
| 25355 | // emit 'drain' before the write() consumer gets the 'false' return |
| 25356 | // value, and has a chance to attach a 'drain' listener. |
| 25357 | function onwriteDrain(stream, state) { |
| 25358 | if (state.length === 0 && state.needDrain) { |
| 25359 | state.needDrain = false; |
| 25360 | stream.emit('drain'); |
| 25361 | } |
| 25362 | } |
| 25363 | |
| 25364 | // if there's something in the buffer waiting, then process it |
| 25365 | function clearBuffer(stream, state) { |