tls: use .destroy(err) instead of destroy+emit#1711
Closed
indutny wants to merge 1 commit intonodejs:masterfrom
Closed
tls: use .destroy(err) instead of destroy+emit#1711indutny wants to merge 1 commit intonodejs:masterfrom
.destroy(err) instead of destroy+emit#1711indutny wants to merge 1 commit intonodejs:masterfrom
Conversation
Emit errors using `.destroy(err)` instead of `.destroy()` and
`.emit('error', err)`. Otherwise `close` event is emitted with the
`error` argument set to `false`, even if the connection was torn down
because of the error.
See: nodejs#1119
Contributor
|
LGTM. |
indutny
added a commit
that referenced
this pull request
May 22, 2015
Emit errors using `.destroy(err)` instead of `.destroy()` and
`.emit('error', err)`. Otherwise `close` event is emitted with the
`error` argument set to `false`, even if the connection was torn down
because of the error.
See: #1119
PR-URL: #1711
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Member
Author
|
Landed in 80342f6, thank you! |
indutny
pushed a commit
that referenced
this pull request
May 22, 2015
This fixes a race condition introduced in 80342f6. `socket.destroy(err)` only emits the passed error when `socket._writableState.errorEmitted === false`, `ssl.onerror` sets `errorEmitted = true` just before calling `socket.destroy()`. See: #1119 See: #1711 PR-URL: #1769 Reviewed-By: Fedor Indutny <fedor@indutny.com>
andrewdeandrade
pushed a commit
to andrewdeandrade/node
that referenced
this pull request
Jun 3, 2015
Emit errors using `.destroy(err)` instead of `.destroy()` and
`.emit('error', err)`. Otherwise `close` event is emitted with the
`error` argument set to `false`, even if the connection was torn down
because of the error.
See: nodejs/node#1119
PR-URL: nodejs/node#1711
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
andrewdeandrade
pushed a commit
to andrewdeandrade/node
that referenced
this pull request
Jun 3, 2015
This fixes a race condition introduced in 80342f6. `socket.destroy(err)` only emits the passed error when `socket._writableState.errorEmitted === false`, `ssl.onerror` sets `errorEmitted = true` just before calling `socket.destroy()`. See: nodejs/node#1119 See: nodejs/node#1711 PR-URL: nodejs/node#1769 Reviewed-By: Fedor Indutny <fedor@indutny.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emit errors using
.destroy(err)instead of.destroy()and.emit('error', err). Otherwisecloseevent is emitted with theerrorargument set tofalse, even if the connection was torn downbecause of the error.
See: #1119