joyent/node — pull request #6766 by indutny (2013-12-27 09:28:49+00:00)
Title: tls: fix pool usage race

When calling `encOut` in loop, `maybeInitFinished()` may invoke
`clearOut`'s loop, leading to the writing of interleaved data
(encrypted and cleartext) into the one shared pool.

Move `maybeInitFinished()` out of the loop and add assertion for
future.

backport of 60f777d

Please do a release with tihs.