Commit 2a71f029 authored by Malte-Thorben Bruns's avatar Malte-Thorben Bruns Committed by Fedor Indutny
Browse files

tls: emit errors happening before handshake finish

This fixes a race condition introduced in 80342f64.
`socket.destroy(err)` only emits the passed error when
`socket._writableState.errorEmitted === false`, `ssl.onerror`
sets `errorEmitted = true` just before calling
`socket.destroy()`.

See: https://github.com/nodejs/io.js/issues/1119
See: https://github.com/nodejs/io.js/issues/1711
PR-URL: https://github.com/nodejs/io.js/pull/1769


Reviewed-By: default avatarFedor Indutny <fedor@indutny.com>
parent 2bb2f06b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment