net: Defer reading until listeners could be added
authorJames Hartig <fastest963@gmail.com>
Mon, 8 Jun 2015 22:25:06 +0000 (18:25 -0400)
committerBrendan Ashworth <brendan.ashworth@me.com>
Wed, 17 Jun 2015 21:49:02 +0000 (14:49 -0700)
commit061342a50075a23e04465e0ac2f33124ab56ea32
tree95672ba1205ad9040050c0d9a13b0b5be9fead71
parent7a3006efe421ed84e5d99888134b717b5e69f257
net: Defer reading until listeners could be added

Defer reading until user-land has a chance to add listeners. This
allows the TLS wrapper to listen for _tlsError and trigger a
clientError event if the socket already has data that could trigger.

Fixes: https://github.com/nodejs/io.js/issues/1114
PR-URL: https://github.com/nodejs/io.js/pull/1496
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
lib/_tls_wrap.js
test/parallel/test-tls-delayed-attach-error.js [new file with mode: 0644]
test/parallel/test-tls-delayed-attach.js