Skip to content

tls: cleanup onhandshakestart callback - #20466

Closed
apapirovski wants to merge 1 commit into
nodejs:masterfrom
apapirovski:patch-cleanup-onhandshakestart
Closed

tls: cleanup onhandshakestart callback#20466
apapirovski wants to merge 1 commit into
nodejs:masterfrom
apapirovski:patch-cleanup-onhandshakestart

Conversation

@apapirovski

Copy link
Copy Markdown
Contributor

Re-arrange and cleanup the flow of the onhandshakestart to be
more clear and less repetitive. Exit early in the case of a
first ever handshake for a given connection.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Re-arrange and cleanup the flow of the onhandshakestart to be
more clear and less repetitive. Exit early in the case of a
first ever handshake for a given connection.
@apapirovskiapapirovski added the tls Issues and PRs related to the tls subsystem. label May 2, 2018
Comment threadlib/_tls_wrap.js
if (++this.handshakes > tls.CLIENT_RENEG_LIMIT) {
// Defer the error event to the next tick. We're being called from OpenSSL's
// state machine and OpenSSL is not re-entrant. We cannot allow the user's
// callback to destroy the connection right now, it would crash and burn.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer necessary. We already defer the actual cleanup within destroy by using setImmediate. This is also backed up by the way renegotiation errors are handled below (which we also have tests for).

@apapirovski

Copy link
Copy Markdown
ContributorAuthor

@apapirovskiapapirovski added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 2, 2018
@addaleax

Copy link
Copy Markdown
Member

OS X failure seems unrelated, re-run: https://ci.nodejs.org/job/node-test-commit-osx/18327/

@apapirovski

Copy link
Copy Markdown
ContributorAuthor

Landed in 491ae12

@apapirovski
apapirovski deleted the patch-cleanup-onhandshakestart branch May 6, 2018 05:28
apapirovski added a commit that referenced this pull request May 6, 2018
Re-arrange and cleanup the flow of the onhandshakestart to be
more clear and less repetitive. Exit early in the case of a
first ever handshake for a given connection.
PR-URL: #20466
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request May 8, 2018
Re-arrange and cleanup the flow of the onhandshakestart to be
more clear and less repetitive. Exit early in the case of a
first ever handshake for a given connection.
PR-URL: #20466
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@MylesBorinsMylesBorins mentioned this pull request May 8, 2018
MylesBorins pushed a commit that referenced this pull request May 8, 2018
Re-arrange and cleanup the flow of the onhandshakestart to be
more clear and less repetitive. Exit early in the case of a
first ever handshake for a given connection.
PR-URL: #20466
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
MylesBorins pushed a commit that referenced this pull request May 9, 2018
Re-arrange and cleanup the flow of the onhandshakestart to be
more clear and less repetitive. Exit early in the case of a
first ever handshake for a given connection.
PR-URL: #20466
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.tlsIssues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@apapirovski@addaleax@bnoordhuis@BridgeAR