joyent/node — pull request #5567 by indutny (2013-05-27 10:47:04+00:00)
Title: tls: invoke write cb only after opposite read end

_NOTE: There's a problem with clienthello parser failure test, and I'm still investigating it._

Stream's `._write()` callback should be invoked only after it's opposite
stream has finished processing incoming data, otherwise `finish` event
fires too early and connection might be closed while there's some data
to send to the client.

see #5544