File tree 14 files changed +29
-17
lines changed
14 files changed +29
-17
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ const { internalBinding } = require ( 'internal/bootstrap/loaders' ) ;
3
4
const Stream = require ( 'stream' ) ;
4
5
const Readable = Stream . Readable ;
5
- const binding = process . binding ( 'http2' ) ;
6
+ const binding = internalBinding ( 'http2' ) ;
6
7
const constants = binding . constants ;
7
8
const {
8
9
ERR_HTTP2_HEADERS_SENT ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const {
10
10
11
11
assertCrypto ( ) ;
12
12
13
+ const { internalBinding } = require ( 'internal/bootstrap/loaders' ) ;
13
14
const assert = require ( 'assert' ) ;
14
15
const EventEmitter = require ( 'events' ) ;
15
16
const fs = require ( 'fs' ) ;
@@ -31,7 +32,6 @@ const {
31
32
owner_symbol,
32
33
} ,
33
34
} = require ( 'internal/async_hooks' ) ;
34
- const { internalBinding } = require ( 'internal/bootstrap/loaders' ) ;
35
35
const {
36
36
codes : {
37
37
ERR_HTTP2_ALTSVC_INVALID_ORIGIN ,
@@ -114,7 +114,7 @@ const {
114
114
const { isArrayBufferView } = require ( 'internal/util/types' ) ;
115
115
116
116
const { FileHandle } = process . binding ( 'fs' ) ;
117
- const binding = process . binding ( 'http2' ) ;
117
+ const binding = internalBinding ( 'http2' ) ;
118
118
const { ShutdownWrap } = process . binding ( 'stream_wrap' ) ;
119
119
const { UV_EOF } = internalBinding ( 'uv' ) ;
120
120
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- const binding = process . binding ( 'http2' ) ;
3
+ const { internalBinding } = require ( 'internal/bootstrap/loaders' ) ;
4
+ const binding = internalBinding ( 'http2' ) ;
4
5
const {
5
6
ERR_HTTP2_HEADER_SINGLE_VALUE ,
6
7
ERR_HTTP2_INVALID_CONNECTION_HEADERS ,
Original file line number Diff line number Diff line change @@ -80,10 +80,11 @@ let sessionStats;
80
80
let streamStats ;
81
81
82
82
function collectHttp2Stats ( entry ) {
83
+ const http2 = internalBinding ( 'http2' ) ;
83
84
switch ( entry . name ) {
84
85
case 'Http2Stream' :
85
86
if ( streamStats === undefined )
86
- streamStats = process . binding ( ' http2' ) . streamStats ;
87
+ streamStats = http2 . streamStats ;
87
88
entry . id =
88
89
streamStats [ IDX_STREAM_STATS_ID ] >>> 0 ;
89
90
entry . timeToFirstByte =
@@ -99,7 +100,7 @@ function collectHttp2Stats(entry) {
99
100
break ;
100
101
case 'Http2Session' :
101
102
if ( sessionStats === undefined )
102
- sessionStats = process . binding ( ' http2' ) . sessionStats ;
103
+ sessionStats = http2 . sessionStats ;
103
104
entry . type =
104
105
sessionStats [ IDX_SESSION_STATS_TYPE ] >>> 0 === 0 ? 'server' : 'client' ;
105
106
entry . pingRTT =
Original file line number Diff line number Diff line change @@ -2999,4 +2999,4 @@ HTTP_STATUS_CODES(V)
2999
2999
} // namespace http2
3000
3000
} // namespace node
3001
3001
3002
- NODE_BUILTIN_MODULE_CONTEXT_AWARE (http2, node::http2::Initialize)
3002
+ NODE_MODULE_CONTEXT_AWARE_INTERNAL (http2, node::http2::Initialize)
Original file line number Diff line number Diff line change
1
+ // Flags: --expose-internals
1
2
'use strict' ;
2
3
3
4
const common = require ( '../common' ) ;
4
5
if ( ! common . hasCrypto )
5
6
common . skip ( 'missing crypto' ) ;
6
7
const assert = require ( 'assert' ) ;
8
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
7
9
8
- const binding = process . binding ( 'http2' ) ;
10
+ const binding = internalBinding ( 'http2' ) ;
9
11
const http2 = require ( 'http2' ) ;
10
12
11
13
assert ( binding . Http2Session ) ;
Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ const common = require('../common');
5
5
if ( ! common . hasCrypto )
6
6
common . skip ( 'missing crypto' ) ;
7
7
8
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
8
9
const {
9
10
constants,
10
11
Http2Session,
11
12
nghttp2ErrorString
12
- } = process . binding ( 'http2' ) ;
13
+ } = internalBinding ( 'http2' ) ;
13
14
const http2 = require ( 'http2' ) ;
14
15
const { NghttpError } = require ( 'internal/http2/util' ) ;
15
16
Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ const common = require('../common');
5
5
if ( ! common . hasCrypto )
6
6
common . skip ( 'missing crypto' ) ;
7
7
const http2 = require ( 'http2' ) ;
8
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
8
9
const {
9
10
constants,
10
11
Http2Stream,
11
12
nghttp2ErrorString
12
- } = process . binding ( 'http2' ) ;
13
+ } = internalBinding ( 'http2' ) ;
13
14
const { NghttpError } = require ( 'internal/http2/util' ) ;
14
15
15
16
// tests error handling within additionalHeaders
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ const common = require('../common');
5
5
if ( ! common . hasCrypto )
6
6
common . skip ( 'missing crypto' ) ;
7
7
const http2 = require ( 'http2' ) ;
8
- const { Http2Stream } = process . binding ( 'http2' ) ;
8
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
9
+ const { Http2Stream } = internalBinding ( 'http2' ) ;
9
10
10
11
const server = http2 . createServer ( ) ;
11
12
Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ const common = require('../common');
5
5
if ( ! common . hasCrypto )
6
6
common . skip ( 'missing crypto' ) ;
7
7
const http2 = require ( 'http2' ) ;
8
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
8
9
const {
9
10
constants,
10
11
Http2Stream,
11
12
nghttp2ErrorString
12
- } = process . binding ( 'http2' ) ;
13
+ } = internalBinding ( 'http2' ) ;
13
14
const { NghttpError } = require ( 'internal/http2/util' ) ;
14
15
15
16
// tests error handling within respond
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ const fixtures = require('../common/fixtures');
10
10
11
11
const http2 = require ( 'http2' ) ;
12
12
13
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
13
14
const {
14
15
constants,
15
16
Http2Stream,
16
17
nghttp2ErrorString
17
- } = process . binding ( 'http2' ) ;
18
+ } = internalBinding ( 'http2' ) ;
18
19
const { NghttpError } = require ( 'internal/http2/util' ) ;
19
20
20
21
// tests error handling within processRespondWithFD
Original file line number Diff line number Diff line change @@ -5,11 +5,12 @@ const common = require('../common');
5
5
if ( ! common . hasCrypto )
6
6
common . skip ( 'missing crypto' ) ;
7
7
const http2 = require ( 'http2' ) ;
8
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
8
9
const {
9
10
constants,
10
11
Http2Stream,
11
12
nghttp2ErrorString
12
- } = process . binding ( 'http2' ) ;
13
+ } = internalBinding ( 'http2' ) ;
13
14
const { NghttpError } = require ( 'internal/http2/util' ) ;
14
15
15
16
// tests error handling within pushStream
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ if (!common.hasCrypto)
9
9
common . skip ( 'missing crypto' ) ;
10
10
const assert = require ( 'assert' ) ;
11
11
const { mapToHeaders, toHeaderObject } = require ( 'internal/http2/util' ) ;
12
-
12
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
13
13
const {
14
14
HTTP2_HEADER_STATUS ,
15
15
HTTP2_HEADER_METHOD ,
@@ -88,7 +88,7 @@ const {
88
88
HTTP2_HEADER_HOST ,
89
89
HTTP2_HEADER_KEEP_ALIVE ,
90
90
HTTP2_HEADER_PROXY_CONNECTION
91
- } = process . binding ( 'http2' ) . constants ;
91
+ } = internalBinding ( 'http2' ) . constants ;
92
92
93
93
{
94
94
const headers = {
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ if (!common.hasCrypto)
9
9
// by the http2 implementation.
10
10
11
11
const { updateOptionsBuffer } = require ( 'internal/http2/util' ) ;
12
- const { optionsBuffer } = process . binding ( 'http2' ) ;
12
+ const { internalBinding } = require ( 'internal/test/binding' ) ;
13
+ const { optionsBuffer } = internalBinding ( 'http2' ) ;
13
14
const { ok, strictEqual } = require ( 'assert' ) ;
14
15
15
16
const IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE = 0 ;
You can’t perform that action at this time.
0 commit comments