GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — process,tls: stop relying on process.features by jasnell · Pull Request #21087 · nodejs/node

Conversation

@jasnell

@jasnell jasnell commented Jun 1, 2018

Copy link
Copy Markdown
Member

The process.features property is mutable by userland such that
delete process.features will cause SNI and ALPN support for fail.
Add the necessary properties to process.config('binding') so that
we are not relying on a user-modifiable object.

Also clean up the GetFeatures funciton just a bit.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell
process,tls: stop relying on process.features
b5a3841
The `process.features` property is mutable by userland such that
`delete process.features` will cause SNI and ALPN support for fail.
Add the necessary properties to `process.config('binding')` so that
we are not relying on a user-modifiable object.

Also clean up the `GetFeatures` funciton just a bit.
@jasnell
jasnell requested a review from addaleax June 1, 2018 22:02
@jasnell jasnell added tls Issues and PRs related to the tls subsystem. process Issues and PRs related to the process subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. labels Jun 1, 2018
@jasnell

jasnell commented Jun 1, 2018

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-pull-request/15218/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

addaleax
addaleax approved these changes Jun 1, 2018
View reviewed changes
Comment thread src/node.cc Outdated
Local<Boolean> tls_ocsp = trueValue;
#else
Local<Boolean> tls_ocsp = False(env->isolate());
Local<Boolean> tls_ocsp = falseValue;

@addaleax addaleax Jun 1, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

style nit: true_value and false_value

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
devsnek
devsnek approved these changes Jun 1, 2018
View reviewed changes

@devsnek devsnek left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

lgtm with addaleax's nit fixed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell
[Squash] nit
f91ce4c
mscdex
mscdex reviewed Jun 2, 2018
View reviewed changes
Comment thread src/node.cc
EscapableHandleScope scope(env->isolate());
Isolate* isolate = env->isolate();
EscapableHandleScope scope(isolate);
Local<Boolean> true_value = True(isolate);

@mscdex mscdex Jun 2, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why do we need these two separate variables instead of using True(isolate) and False(isolate) inline like before?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mscdex
mscdex reviewed Jun 2, 2018
View reviewed changes
Comment thread src/node.cc
Local<Boolean> debug = true_value;
#else
Local<Value> debug = False(env->isolate());
Local<Boolean> debug = false_value;

@mscdex mscdex Jun 2, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Instead of making this change multiple times, what if we instead removed the temporary variables instead and just set the values directly in the obj->Set() calls? For example:

obj->Set(FIXED_ONE_BYTE_STRING(isolate, "debug"),
#if defined(DEBUG) && DEBUG
         True(isolate)
#else
         False(isolate)
#endif
        );

or something similar or maybe even write a macro for this?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis bnoordhuis mentioned this pull request Jun 2, 2018
lib,src: remove openssl feature conditionals #21094
Closed
@bnoordhuis

bnoordhuis commented Jun 2, 2018

Copy link
Copy Markdown
Member

In the words of the great poet Zappa: I've got a better idea!

See #21094, we can get rid of the conditionals altogether, they're remnants from when we supported older versions of openssl.

jasnell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Jun 2, 2018

Copy link
Copy Markdown
Member Author

Even better.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Jun 2, 2018

Copy link
Copy Markdown
Member Author

Closing in favor of #21094!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell closed this Jun 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax approved these changes
+2 more reviewers
@mscdex mscdex mscdex left review comments
@devsnek devsnek devsnek approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. process Issues and PRs related to the process subsystem. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@jasnell @bnoordhuis @mscdex @addaleax @devsnek
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.