0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 07:00:59 +01:00
Commit Graph

12 Commits

Author SHA1 Message Date
Matteo Collina
0857790656 stream: prevent 'end' to be emitted after 'error'
This PR adds _readableState.errorEmitted and add the tracking of it.

Fixes: https://github.com/nodejs/node/issues/6083

PR-URL: https://github.com/nodejs/node/pull/20104
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-20 15:12:22 +02:00
James M Snell
cef909797a http2: do not emit our own close emit in Http2Stream
Streams were recently updated to emit their own close event. The
Http2Stream was an exception because it included the close argument
with the close event. Refactor that to use the built in close.

PR-URL: https://github.com/nodejs/node/pull/19451
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-22 13:48:47 -07:00
Anna Henningsen
7bc8eb8da7
http2: refer to stream errors by name
Display the constant name instead of a stream error code
in the error message, because the numerical codes give absolutely
no clue about what happened when an error is emitted.

PR-URL: https://github.com/nodejs/node/pull/18966
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-04 13:52:31 +01:00
James M Snell
0babd181a0 http2: cleanup Http2Stream/Http2Session destroy
PR-URL: https://github.com/nodejs/node/pull/17406
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

This is a significant cleanup and refactoring of the
cleanup/close/destroy logic for Http2Stream and Http2Session.
There are significant changes here in the timing and ordering
of cleanup logic, JS apis. and various related necessary edits.
2017-12-18 10:19:21 -08:00
James M Snell
1b99542ea4 http2: use 'close' event instead of 'streamClosed'
PR-URL: https://github.com/nodejs/node/pull/17328
Fixes: https://github.com/nodejs/node/issues/15303
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Sebastiaan Deckers <sebdeckers83@gmail.com>
2017-11-28 10:30:39 -08:00
James M Snell
f55ee6e24a
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>
2017-09-28 02:01:06 -03:00
Matteo Collina
53c5bf546e http2: refactor error handling
This changes the error handling model of ServerHttp2Stream,
ServerHttp2Request and ServerHttp2Response.
An 'error' emitted on ServerHttp2Stream will not go to
'uncaughtException' anymore, but to the server 'streamError'.
On the stream 'error', ServerHttp2Request will emit 'abort', while
ServerHttp2Response would do nothing.
It also updates respondWith* to the new error handling.

Fixes: https://github.com/nodejs/node/issues/14963
PR-URL: https://github.com/nodejs/node/pull/14991
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-08-28 00:39:42 +04:00
Rich Trott
f912080bf2 Revert "http2: refactor error handling"
This reverts commit 4ca8ff264f.

That commit was landed without a green CI and is failing on Windows.

PR-URL: https://github.com/nodejs/node/pull/15047
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-26 13:13:17 -07:00
Matteo Collina
4ca8ff264f http2: refactor error handling
This changes the error handling model of ServerHttp2Stream,
ServerHttp2Request and ServerHttp2Response.
An 'error' emitted on ServerHttp2Stream will not go to
'uncaughtException' anymore, but to the server 'streamError'.
On the stream 'error', ServerHttp2Request will emit 'abort', while
ServerHttp2Response would do nothing

See: https://github.com/nodejs/node/issues/14963

PR-URL: https://github.com/nodejs/node/pull/14991
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-08-25 14:28:54 -07:00
Daniel Bevenius
1b719fe3d7 test: add crypto check to http2 tests
When building --without-ssl and running the tests some of the http2 test
fail with the following error message:

internal/util.js:82
    throw new errors.Error('ERR_NO_CRYPTO');
    ^

Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto
support
    at Object.assertCrypto (internal/util.js:82:11)
    at internal/http2/core.js:5:26
    at NativeModule.compile (bootstrap_node.js:586:7)
    at NativeModule.require (bootstrap_node.js:531:18)
    at http2.js:17:5
    at NativeModule.compile (bootstrap_node.js:586:7)
    at Function.NativeModule.require (bootstrap_node.js:531:18)
    at Function.Module._load (module.js:449:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)

This commit adds hasCrypto checks and skips the tests if there is no
crypto support.

PR-URL: https://github.com/nodejs/node/pull/14657
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-08 15:30:46 -07:00
James M Snell
59e509808a http2: address initial pr feedback
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:57:09 -07:00
James M Snell
b1e055696f http2: add tests and benchmarks
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2017-08-04 12:55:58 -07:00