New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: handle `error` events with `_tlsError` #8889

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@indutny
Member

indutny commented Oct 1, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

tls

Description of change

Previously TLSSocket#_emitTLSError was used as an error event
handler. However that function can emit error event itself, so it is
not suitable for such use. Luckily the event can be emitted only when
the control is released, so this looping-error can't happen.

Replace the error handler for clarity and correctness.

cc @nodejs/crypto

tls: handle `error` events with `_tlsError`
Previously `TLSSocket#_emitTLSError` was used as an `error` event
handler. However that function can emit `error` event itself, so it is
not suitable for such use. Luckily the event can be emitted only when
the control is released, so this looping-error can't happen.

Replace the error handler for clarity and correctness.
@indutny

This comment has been minimized.

Show comment
Hide comment
@fhinkel

fhinkel approved these changes Oct 3, 2016

@cjihrig

cjihrig approved these changes Oct 3, 2016

@indutny

This comment has been minimized.

Show comment
Hide comment
@indutny

indutny Oct 3, 2016

Member

Landed in d33c4bf, thank you!

Member

indutny commented Oct 3, 2016

Landed in d33c4bf, thank you!

@indutny indutny closed this Oct 3, 2016

@indutny indutny deleted the indutny:feature/improve-tls-error-handling branch Oct 3, 2016

indutny added a commit that referenced this pull request Oct 3, 2016

tls: handle `error` events with `_tlsError`
Previously `TLSSocket#_emitTLSError` was used as an `error` event
handler. However that function can emit `error` event itself, so it is
not suitable for such use. Luckily the event can be emitted only when
the control is released, so this looping-error can't happen.

Replace the error handler for clarity and correctness.

PR-URL: #8889
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

jasnell added a commit that referenced this pull request Oct 6, 2016

tls: handle `error` events with `_tlsError`
Previously `TLSSocket#_emitTLSError` was used as an `error` event
handler. However that function can emit `error` event itself, so it is
not suitable for such use. Luckily the event can be emitted only when
the control is released, so this looping-error can't happen.

Replace the error handler for clarity and correctness.

PR-URL: #8889
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins

This comment has been minimized.

Show comment
Hide comment
@MylesBorins
Member

MylesBorins commented Oct 6, 2016

@indutny lts?

@indutny

This comment has been minimized.

Show comment
Hide comment
@indutny

indutny Oct 7, 2016

Member

@thealphanerd unnecessary, thanks!

Member

indutny commented Oct 7, 2016

@thealphanerd unnecessary, thanks!

@indutny indutny removed the lts-watch-v4.x label Oct 7, 2016

Fishrock123 added a commit that referenced this pull request Oct 11, 2016

tls: handle `error` events with `_tlsError`
Previously `TLSSocket#_emitTLSError` was used as an `error` event
handler. However that function can emit `error` event itself, so it is
not suitable for such use. Luckily the event can be emitted only when
the control is released, so this looping-error can't happen.

Replace the error handler for clarity and correctness.

PR-URL: #8889
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment