Skip to content
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: remove util and calls to util.format #3456

Closed
wants to merge 1 commit into from
Closed

tls: remove util and calls to util.format #3456

wants to merge 1 commit into from

Conversation

MylesBorins
Copy link
Contributor

Currently util.format is being used for string templating in tls.
By replacing all of the instances of util.format with backtick
string we can remove the need to require util in tls all together.

@MylesBorins
Copy link
Contributor Author

/cc @jasnell

host,
cert.subjectaltname);
reason =
`Host: ${host} is not in the cert's altnames: ${cert.subjectaltname}`;
Copy link
Member

Choose a reason for hiding this comment

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

Style nit: line continuations should indent by four spaces. Didn't the linter complain?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

linter did not complain. Fixing this right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So funny enough, if this line is indented an extra two characters it is over 80 :(

Copy link
Member

Choose a reason for hiding this comment

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

Hah, okay. You can break it in two, i.e.:

reason = `Host: ${host} is not in the cert's altnames: ` +
         `${cert.subjectaltname}`;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@Fishrock123
Copy link
Contributor

I'm a little concerned this may just be code churn, but it does get rid of the need to escape single quotes and stuff.

@Fishrock123 Fishrock123 added the tls Issues and PRs related to the tls subsystem. label Oct 20, 2015
@bnoordhuis
Copy link
Member

LGTM with a nit. This is the kind of churn I can live with: one less dependency and there are mild performance improvements to be gained.

@MylesBorins
Copy link
Contributor Author

I'm open to the idea that it might be churn. I would also like to do a perf test to see if switching between util / backticks offers any improvement (could be a perf decrease)

@jasnell
Copy link
Member

jasnell commented Oct 20, 2015

It's a wee bit churnish but it's the good kind, I think. LGTM

cert.subjectaltname);
reason =
`Host: ${host} is not in the cert's altnames:` +
`${cert.subjectaltname}`;
Copy link
Member

Choose a reason for hiding this comment

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

You're missing a space between the : and the cert.subjectaltname in the replacement text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good eye

@bnoordhuis
Copy link
Member

I started a node-test-pull-request CI run but I can't link to it. For some reason there's no build history after September 16...

@evanlucas
Copy link
Contributor

@evanlucas
Copy link
Contributor

Looks like they are no longer sorted :[

@MylesBorins
Copy link
Contributor Author

Is it just me or is that CI run not doing anything?

edit: it was just me... sigh

facepalm

@bnoordhuis
Copy link
Member

You have to click through to https://ci.nodejs.org/job/node-test-commit/894/ - some windows failures related to buildbots going AWOL, it seems.

@MylesBorins
Copy link
Contributor Author

@bnoordhuis should we re run the tests?

@jasnell
Copy link
Member

jasnell commented Oct 21, 2015

@thealphanerd ... wouldn't hurt to do another run.

@jasnell
Copy link
Member

jasnell commented Oct 21, 2015

@jasnell
Copy link
Member

jasnell commented Oct 21, 2015

Failures appear to be unrelated. Because this touches tls, @indutny ... quick review?

Currently util.format is being used for string templating in tls.
By replacing all of the instances of util.format with backtick
string we can remove the need to require util in tls all together.
@MylesBorins
Copy link
Contributor Author

just rebased against master

@indutny
Copy link
Member

indutny commented Oct 27, 2015

LGTM, sorry for delay, the notification was lost in my inbox.

@Trott
Copy link
Member

Trott commented Oct 29, 2015

Landed in 6b0c906

@Trott Trott closed this Oct 29, 2015
Trott pushed a commit that referenced this pull request Oct 29, 2015
Currently util.format is being used for string templating in tls.
By replacing all of the instances of util.format with backtick
string we can remove the need to require util in tls all together.

PR-URL: #3456
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
rvagg pushed a commit to rvagg/io.js that referenced this pull request Oct 29, 2015
Currently util.format is being used for string templating in tls.
By replacing all of the instances of util.format with backtick
string we can remove the need to require util in tls all together.

PR-URL: nodejs#3456
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
@rvagg rvagg mentioned this pull request Oct 29, 2015
@rvagg
Copy link
Member

rvagg commented Oct 30, 2015

suggesting this goes into v4.x-staging after having done some time in v5.0.0

@jasnell
Copy link
Member

jasnell commented Oct 30, 2015

Let's queue this up for post v4.2.2

MylesBorins pushed a commit that referenced this pull request Nov 30, 2015
Currently util.format is being used for string templating in tls.
By replacing all of the instances of util.format with backtick
string we can remove the need to require util in tls all together.

PR-URL: #3456
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
MylesBorins pushed a commit that referenced this pull request Dec 4, 2015
Currently util.format is being used for string templating in tls.
By replacing all of the instances of util.format with backtick
string we can remove the need to require util in tls all together.

PR-URL: #3456
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
@jasnell jasnell mentioned this pull request Dec 17, 2015
MylesBorins pushed a commit that referenced this pull request Dec 17, 2015
Currently util.format is being used for string templating in tls.
By replacing all of the instances of util.format with backtick
string we can remove the need to require util in tls all together.

PR-URL: #3456
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
MylesBorins pushed a commit that referenced this pull request Dec 23, 2015
Currently util.format is being used for string templating in tls.
By replacing all of the instances of util.format with backtick
string we can remove the need to require util in tls all together.

PR-URL: #3456
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants