http2: make --expose-http2 flag a non-op

Make the `http2` module always available.
The `--expose-http2` cli flag is made a non-op

PR-URL: https://github.com/nodejs/node/pull/15535
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
James M Snell 2017-09-21 10:07:56 -07:00 committed by Ruben Bridgewater
parent e416b3ee36
commit f55ee6e24a
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
142 changed files with 12 additions and 174 deletions

View File

@ -6,7 +6,7 @@ const PORT = common.PORT;
const bench = common.createBenchmark(main, {
n: [1e3],
nheaders: [0, 10, 100, 1000],
}, { flags: ['--expose-http2', '--no-warnings'] });
}, { flags: ['--no-warnings'] });
function main(conf) {
const n = +conf.n;

View File

@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, {
requests: [100, 1000, 10000, 100000, 1000000],
streams: [100, 200, 1000],
clients: [1, 2]
}, { flags: ['--expose-http2', '--no-warnings'] });
}, { flags: ['--no-warnings'] });
function main(conf) {

View File

@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
requests: [100, 1000, 10000, 100000],
streams: [100, 200, 1000],
clients: [1, 2]
}, { flags: ['--expose-http2', '--no-warnings'] });
}, { flags: ['--no-warnings'] });
function main(conf) {
const n = +conf.requests;

View File

@ -6,7 +6,7 @@ const PORT = common.PORT;
const bench = common.createBenchmark(main, {
streams: [100, 200, 1000],
length: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024],
}, { flags: ['--expose-http2', '--no-warnings'] });
}, { flags: ['--no-warnings'] });
function main(conf) {
const m = +conf.streams;

View File

@ -175,13 +175,6 @@ added: v6.0.0
Silence all process warnings (including deprecations).
### `--expose-http2`
<!-- YAML
added: v8.4.0
-->
Enable the experimental `'http2'` module.
### `--abort-on-uncaught-exception`
<!-- YAML
added: v0.10

View File

@ -9,9 +9,6 @@ can be accessed using:
const http2 = require('http2');
```
*Note*: Node.js must be launched with the `--expose-http2` command line flag
in order to use the `'http2'` module.
## Core API
The Core API provides a low-level interface designed specifically around

View File

@ -130,10 +130,6 @@ Emit pending deprecation warnings.
.BR \-\-no\-warnings
Silence all process warnings (including deprecations).
.TP
.BR \-\-expose\-http2
Enable the experimental `'http2'` module.
.TP
.BR \-\-napi\-modules
Enable loading native modules compiled with the ABI-stable Node.js API (N-API)

View File

@ -510,9 +510,6 @@
const config = process.binding('config');
if (!config.exposeHTTP2)
delete NativeModule._source.http2;
NativeModule.require = function(id) {
if (id === 'native_module') {
return NativeModule;

View File

@ -78,15 +78,11 @@ function stripShebang(content) {
const builtinLibs = [
'assert', 'async_hooks', 'buffer', 'child_process', 'cluster', 'crypto',
'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net',
'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'http2', 'https', 'net',
'os', 'path', 'perf_hooks', 'punycode', 'querystring', 'readline', 'repl',
'stream', 'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'
];
const { exposeHTTP2 } = process.binding('config');
if (exposeHTTP2)
builtinLibs.push('http2');
function addBuiltinLibsToObject(object) {
// Make built-in modules available directly (loaded lazily).
builtinLibs.forEach((name) => {

View File

@ -244,9 +244,6 @@ std::string config_warning_file; // NOLINT(runtime/string)
// that is used by lib/internal/bootstrap_node.js
bool config_expose_internals = false;
// Set in node.cc by ParseArgs when --expose-http2 is used.
bool config_expose_http2 = false;
bool v8_initialized = false;
bool linux_at_secure = false;
@ -3801,7 +3798,6 @@ static void PrintHelp() {
" --abort-on-uncaught-exception\n"
" aborting instead of exiting causes a\n"
" core file to be generated for analysis\n"
" --expose-http2 enable experimental HTTP2 support\n"
" --trace-warnings show stack traces on process warnings\n"
" --redirect-warnings=file\n"
" write warnings to file instead of\n"
@ -3925,7 +3921,7 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env,
"--pending-deprecation",
"--no-warnings",
"--napi-modules",
"--expose-http2",
"--expose-http2", // keep as a non-op through v9.x
"--trace-warnings",
"--redirect-warnings",
"--trace-sync-io",
@ -4127,7 +4123,7 @@ static void ParseArgs(int* argc,
config_expose_internals = true;
} else if (strcmp(arg, "--expose-http2") == 0 ||
strcmp(arg, "--expose_http2") == 0) {
config_expose_http2 = true;
// Keep as a non-op through v9.x
} else if (strcmp(arg, "-") == 0) {
break;
} else if (strcmp(arg, "--") == 0) {

View File

@ -74,9 +74,6 @@ static void InitConfig(Local<Object> target,
if (config_expose_internals)
READONLY_BOOLEAN_PROPERTY("exposeInternals");
if (config_expose_http2)
READONLY_BOOLEAN_PROPERTY("exposeHTTP2");
READONLY_PROPERTY(target,
"bits",
Number::New(env->isolate(), 8 * sizeof(intptr_t)));

View File

@ -86,8 +86,6 @@ extern std::string openssl_config;
// that is used by lib/module.js
extern bool config_preserve_symlinks;
// Set in node.cc by ParseArgs when --expose-http2 is used.
extern bool config_expose_http2;
// Set in node.cc by ParseArgs when --experimental-modules is used.
// Used in node_config.cc to set a constant on process.binding('config')
// that is used by lib/module.js

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const {

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
// Verifies that uploading data from a client works

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,4 @@
// Flags: --expose-http2 --expose-internals
// Flags: --expose-internals
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,4 @@
// Flags: --expose-http2 --expose-internals
// Flags: --expose-internals
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const { mustCall, mustNotCall, hasCrypto, skip } = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const { mustCall,

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const { mustCall, hasCrypto, skip, expectsError } = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
// Tests http2.connect()

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
// Tests opening 100 concurrent simultaneous uploading streams over a single

View File

@ -1,8 +0,0 @@
// The --expose-http2 flag is not set
'use strict';
require('../common');
const assert = require('assert');
assert.throws(() => require('http2'), // eslint-disable-line crypto-check
/^Error: Cannot find module 'http2'$/);

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
// Tests the ability to minimally request a byte range with respondWithFD

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

View File

@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';
const common = require('../common');

Some files were not shown because too many files have changed in this diff Show More