joyent/node — pull request #5253 by isaacs (2013-04-08 18:04:08+00:00)
Title: stream: call write cb before finish event

Since 049903e, an end callback could be called before a write
callback if end() is called before the write is done. This patch
resolves the issue.

In collaboration with @gne

Fixes felixge/node-formidable#209
Fixes #5215