Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-12-182019-12-18, Version 13.5.0 (Current)v13.5.0Myles Borins
Notable Changes: * cli: * add --trace-exit cli option (legendecas) https://github.com/nodejs/node/pull/30516 * http,https: * increase server headers timeout (Tim Costa) https://github.com/nodejs/node/pull/30071 * readline: * update ansi-regex (Ruben Bridgewater) https://github.com/nodejs/node/pull/30907 * promote \_getCursorPos to public api (Jeremy Albright) https://github.com/nodejs/node/pull/30687 * repl: * add completion preview (Ruben Bridgewater) https://github.com/nodejs/node/pull/30907 * util: * add Set and map size to inspect output (Ruben Bridgewater) https://github.com/nodejs/node/pull/30225 * wasi: * require CLI flag to require() wasi module (Colin Ihrig) https://github.com/nodejs/node/pull/30963 PR-URL: https://github.com/nodejs/node/pull/31010
2019-12-18wasi: require CLI flag to require() wasi modulecjihrig
This commit ensures that the WASI module cannot be require()'ed without a CLI flag while the module is still experimental. This fixes a regression from https://github.com/nodejs/node/pull/30778. PR-URL: https://github.com/nodejs/node/pull/30963 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2019-12-18cli: add --trace-exit cli optionlegendecas
It could be convenient to trace abnormal exit of the Node.js processes that printing stacktrace on each `process.exit` call with a cli option. This also takes effects on worker threads. PR-URL: https://github.com/nodejs/node/pull/30516 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-12-18src: unregister Isolate with platform before disposingAnna Henningsen
I previously thought the order of these calls was no longer relevant. I was wrong. This commit undoes the changes from 312c02d25e9, adds a comment explaining why I was wrong, and flips the order of the calls elsewhere for consistency, the latter having been the goal of 312c02d25e9. Fixes: https://github.com/nodejs/node/issues/30846 Refs: https://github.com/nodejs/node/pull/30181 PR-URL: https://github.com/nodejs/node/pull/30909 Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-18crypto: cast oaepLabel to unsigned char*Shelley Vohr
OpenSSL uses a macro without typechecking; since C++ does not implicitly cast void* this is needed to conform Node.js to the OpenSSL documentation. PR-URL: https://github.com/nodejs/node/pull/30917 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-18src: make debug_options getters publicShelley Vohr
This simplifies requires for those using DebugOptions, since debug_options was defined in src/node_options-inl.h and thus embedders would need to require an extra file to do what could trivially be consolidated into one. PR-URL: https://github.com/nodejs/node/pull/30494 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2019-12-18build: auto-load ICU data from --with-icu-default-data-dirStephen Gallagher
When compiled with `--with-intl=small` and `--with-icu-default-data-dir=PATH`, Node.js will use PATH as a fallback location for the ICU data. We will first perform an access check using fopen(PATH, 'r') to ensure that the file is readable. If it is, we'll set the icu_data_directory and proceed. There's a slight overhead for the fopen() check, but it should be barely measurable. This will be useful for Linux distribution packagers who want to be able to ship a minimal node binary in a container image but also be able to add on the full i18n support where needed. With this patch, it becomes possible to ship the interpreter as /usr/bin/node in one package for the distribution and to ship the data files in another package (without a strict dependency between the two). This means that users of the distribution will not need to explicitly direct Node.js to locate the ICU data. It also means that in environments where full internationalization is not required, they do not need to carry the extra content (with the associated storage costs). Refs: https://github.com/nodejs/node/issues/3460 Signed-off-by: Stephen Gallagher <sgallagh@redhat.com> PR-URL: https://github.com/nodejs/node/pull/30825 Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-18Working on v13.4.1Myles Borins
PR-URL: https://github.com/nodejs/node/pull/30937
2019-12-162019-12-17, Version 13.4.0 (Current)v13.4.0Myles Borins
This is a security release. For more details about the vulnerability please consult the npm blog: https://blog.npmjs.org/post/189618601100/binary-planting-with-the-npm-cli Notable Changes: * deps: * update npm to 6.13.4 https://github.com/nodejs/node/pull/30904 * update uvwasi (Anna Henningsen) https://github.com/nodejs/node/pull/30745 * upgrade to libuv 1.34.0 (Colin Ihrig) https://github.com/nodejs/node/pull/30783 * doc: * docs deprecate http finished (Robert Nagy) https://github.com/nodejs/node/pull/28679 * events: * add captureRejection option (Matteo Collina) https://github.com/nodejs/node/pull/27867 * http: * add captureRejection support (Matteo Collina) https://github.com/nodejs/node/pull/27867 * llhttp opt-in insecure HTTP header parsing (Sam Roberts) https://github.com/nodejs/node/pull/30567 * http2: * implement capture rection for 'request' and 'stream' events (Matteo Collina) https://github.com/nodejs/node/pull/27867 * net: * implement capture rejections for 'connection' event (Matteo Collina) https://github.com/nodejs/node/pull/27867 * repl: * support previews by eager evaluating input (Ruben Bridgewater) https://github.com/nodejs/node/pull/30811 * stream: * add support for captureRejection option (Matteo Collina) https://github.com/nodejs/node/pull/27867 * tls: * implement capture rejections for 'secureConnection' event (Matteo Collina) https://github.com/nodejs/node/pull/27867 * expose IETF name for current cipher suite (Sam Roberts) https://github.com/nodejs/node/pull/30637 * worker: * add argv constructor option (legendecas) https://github.com/nodejs/node/pull/30559 PR-URL: https://github.com/nodejs/node/pull/30937
2019-12-13module: conditional exports import conditionGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/30799 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
2019-12-13build: on Android, use android log library to print stack tracesGiovanni Campagna
And other errors like lost promises PR-URL: https://github.com/nodejs/node/pull/29388 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-13src: accept single argument in getProxyDetailsRuben Bridgewater
This makes sure this function stays backwards compatible in case it's accessed through the binding directly. Refs: https://github.com/nodejs/node/pull/29947#issuecomment-562987888 PR-URL: https://github.com/nodejs/node/pull/30858 Refs: https://github.com/nodejs/node/pull/30767 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-12-11build: ease DragonFlyBSD buildDavid Carlier
Implicitly pretending being FreeBSD and disable large pages for this platform. PR-URL: https://github.com/nodejs/node/pull/30201 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-12-10src: fix the false isatty() issue on IBMiXu Meng
On IBMi PASE isatty() always returns true for stdin, stdout and stderr. Use ioctl() instead to identify whether it's actually a TTY. PR-URL: https://github.com/nodejs/node/pull/30829 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-12-10http: llhttp opt-in insecure HTTP header parsingSam Roberts
Allow insecure HTTP header parsing. Make clear it is insecure. See: - https://github.com/nodejs/node/pull/30553 - https://github.com/nodejs/node/issues/27711#issuecomment-556265881 - https://github.com/nodejs/node/issues/30515 PR-URL: https://github.com/nodejs/node/pull/30567 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-12-09src: improve checked uv loop close outputAnna Henningsen
Addon developers may run into this when not closing libuv handles inside Workers. Previously, output may have included unhelpful statements such as `uv loop at ... has 0 active handles`, which may sound like everything’s supposed to be fine actually. So, instead of printing the active handle count, print the total handle count and mark active handles individually. Also, fix the test for this to work properly and make sure that parsing finishes properly. PR-URL: https://github.com/nodejs/node/pull/30814 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2019-12-09wasi: use memory-tracking allocatorAnna Henningsen
This: - Protects against memory leaks in uvwasi. - Allows tracking the allocated memory in heap dumps. PR-URL: https://github.com/nodejs/node/pull/30745 Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h Refs: https://github.com/nodejs/quic/pull/126 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-09http2: track nghttp2-allocated memory in heap snapshotAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/30745 Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h Refs: https://github.com/nodejs/quic/pull/126 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-09http2: use shared memory tracking implementationAnna Henningsen
The extensive testing done on http2 makes it easier to make sure the implementation is correct (and doesn’t diverge unnecessarily). Refs: https://github.com/nodejs/quic/pull/126 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/30745 Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-09src: port memory-tracking allocator from QUIC repoAnna Henningsen
This implements a memory-tracking allocator that can be used to provide memory allocation facilities to several thread-safe C libraries, including nghttp2, nghttp3, ngtcp3 and uvwasi. Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h Co-authored-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/30745 Refs: https://github.com/nodejs/quic/pull/126 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-09src: don't use deprecated OpenSSL APIsRosen Penev
The extra headers are needed when deprecated APIs are disabled as ssl.h no longer includes them implicitly. PR-URL: https://github.com/nodejs/node/pull/30812 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-12-09src: free preopen memory in WASI::New()cjihrig
PR-URL: https://github.com/nodejs/node/pull/30809 Refs: https://github.com/nodejs/node/issues/30257 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2019-12-09src: use checked allocations in WASI::New()cjihrig
PR-URL: https://github.com/nodejs/node/pull/30809 Refs: https://github.com/nodejs/node/issues/30257 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2019-12-09util: add internal sleep() functioncjihrig
PR-URL: https://github.com/nodejs/node/pull/30787 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-12-09util: improve performance inspecting proxiesRuben Bridgewater
This makes sure we do not retrieve the handler in case it's not required. This improves the performance a tiny bit for these cases. PR-URL: https://github.com/nodejs/node/pull/30767 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-09http2: streamline OnStreamRead streamline memory accountingDenys Otrishko
* avoid consecutive decrement/increment session memory calls. * only Resize the buffer when it is needed. * flip `stream_buf_offset_` condition to the LIKELY case. PR-URL: https://github.com/nodejs/node/pull/30351 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-12-09http2: small clean up in OnStreamReadDenys Otrishko
PR-URL: https://github.com/nodejs/node/pull/30351 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-12-09lib: delay access to CLI option to pre-executionJoyee Cheung
CLI options should not be added through the config binding, instead they are already available in the JS land via `require('internal/options')`. Also CLI options in principle should be processed in pre-execution instead of bootstrap scripts. PR-URL: https://github.com/nodejs/node/pull/30778 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-12-09module: add warnings for experimental flagsRongjian Zhang
PR-URL: https://github.com/nodejs/node/pull/30617 Fixes: https://github.com/nodejs/node/issues/30600 Reviewed-By: Guy Bedford <guybedford@gmail.com>
2019-12-09esm: make specifier flag clearly experimentalMyles Borins
`--es-module-specifier-resolution` is the only flagged portion of the ESM implementation that does not have the word experimental in the flag name. This commit changes the flag to: `--experimental-specifier-resolution` `--es-module-specifier-resolution` remains as an alias for backwards compatibility but it is no longer documented. PR-URL: https://github.com/nodejs/node/pull/30678 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
2019-12-09tls: expose IETF name for current cipher suiteSam Roberts
OpenSSL has its own legacy names, but knowing the IETF name is useful when trouble-shooting, or looking for more information on the cipher. PR-URL: https://github.com/nodejs/node/pull/30637 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-12-09src: delete redundant method in node_dir.hgengjiawen
PR-URL: https://github.com/nodejs/node/pull/30747 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-12-09src: remove redundant cast in node_dir.ccgengjiawen
PR-URL: https://github.com/nodejs/node/pull/30747 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-12-09src: improve node_crypto.cc memory allocationPriyanka Kore
This avoids heap allocations in common cases PR-URL: https://github.com/nodejs/node/pull/30751 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2019-12-09src: fix node_dir.cc memory allocationPriyanka Kore
PR-URL: https://github.com/nodejs/node/pull/30750 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2019-12-04Working on v13.3.1Ruben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/30774
2019-12-032019-12-03, Version 13.3.0 (Current)v13.3.0Ruben Bridgewater
Notable changes: * fs: * Reworked experimental recursive `rmdir()` (cjihrig) https://github.com/nodejs/node/pull/30644 * The `maxBusyTries` option is renamed to `maxRetries`, and its default is set to 0. The `emfileWait` option has been removed, and `EMFILE` errors use the same retry logic as other errors. The `retryDelay` option is now supported. `ENFILE` errors are now retried. * http: * Make maximum header size configurable per-stream or per-server (Anna Henningsen) https://github.com/nodejs/node/pull/30570 * http2: * Make maximum tolerated rejected streams configurable (Denys Otrishko) https://github.com/nodejs/node/pull/30534 * Allow to configure maximum tolerated invalid frames (Denys Otrishko) https://github.com/nodejs/node/pull/30534 * wasi: * Introduce initial WASI support (cjihrig) https://github.com/nodejs/node/pull/30258 PR-URL: https://github.com/nodejs/node/pull/30774
2019-12-02src: change header file in node_stat_watcher.ccReza Fatahi
change src/node_stat_watcher.cc to import `env-inl.h` instead of `env.h`. PR-URL: https://github.com/nodejs/node/pull/29976 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-12-01wasi: introduce initial WASI supportcjihrig
Co-authored-by: Gus Caplan <me@gus.host> Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com> Co-authored-by: Jiawen Geng <technicalcute@gmail.com> Co-authored-by: Tobias Nießen <tniessen@tnie.de> Co-authored-by: Chengzhong Wu <legendecas@gmail.com> PR-URL: https://github.com/nodejs/node/pull/30258 Refs: https://github.com/nodejs/node/pull/27850 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2019-12-01http: make maximum header size configurable per-stream or per-serverAnna Henningsen
Make `maxHeaderSize` a.k.a. `--max-header-size` configurable now that the legacy parser is gone (which only supported a single global value). Refs: https://github.com/nodejs/node/pull/30567 PR-URL: https://github.com/nodejs/node/pull/30570 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2019-11-30http2: fix session memory accounting after pausingMichael Lehenbauer
The ability to pause input processing was added in 8a4a193 but introduced a session memory accounting mismatch leading to potential NGHTTP2_ENHANCE_YOUR_CALM errors. After pausing (https://github.com/nodejs/node/blob/f36331c1bfa4c4c202346b05dc3bd672f653e4df/src/node_http2.cc#L871), the early return on line 873 skips the DecrementCurrentSessionMemory(stream_buf_.len) call below (line 878). When we later finished processing the input chunk (https://github.com/nodejs/node/blob/f36331c1bfa4c4c202346b05dc3bd672f653e4df/src/node_http2.cc#L1858), we were calling DecrementCurrentSessionMemory(stream_buf_offset_) [line 1875] which was a no-op since we just set stream_buf_offset_ to 0 [line 1873]. The correct amount to decrement by is still stream_buf_.len, since that's the amount we skipped previously (line 878). Fixes: https://github.com/nodejs/node/issues/29223 Refs: https://github.com/nodejs/node/commit/164ac5b241b96089e6bad5bb83ea416966b3245f PR-URL: https://github.com/nodejs/node/pull/30684 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2019-11-30src: clean up node_file.hAnna Henningsen
- Move inline functions into an `-inl.h` file - Move override function definitions into `.cc` files - Remove `using` statements from header files - Make data fields of classes private - Mark classes at the end of hierarchies as `final` This is also partially being done in an attempt to avoid a particular internal compiler error, see https://github.com/nodejs/node/pull/30475#issuecomment-554740850 for details. PR-URL: https://github.com/nodejs/node/pull/30530 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-11-30src: remove unused variable in node_dir.ccgengjiawen
PR-URL: https://github.com/nodejs/node/pull/30267 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-11-30dns: use length for building TXT stringAnna Henningsen
Rely on the length reported by C-Ares rather than `\0`-termination for creating the JS string for a dns TXT response. Fixes: https://github.com/nodejs/node/issues/30688 PR-URL: https://github.com/nodejs/node/pull/30690 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-11-30n-api: detach external ArrayBuffers on env exitAnna Henningsen
Make sure that `ArrayBuffer`s created using `napi_create_external_arraybuffer` are rendered unusable after its memory has been released. PR-URL: https://github.com/nodejs/node/pull/30551 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-11-30buffer: release buffers with free callbacks on env exitAnna Henningsen
Invoke the free callback for a given `Buffer` if it was created with one, and mark the underlying `ArrayBuffer` as detached. This makes sure that the memory is released e.g. when addons inside Workers create such `Buffer`s. PR-URL: https://github.com/nodejs/node/pull/30551 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-11-30doc: address nits for src/README.mdAnna Henningsen
Refs: https://github.com/nodejs/node/pull/30552#pullrequestreview-321954717 PR-URL: https://github.com/nodejs/node/pull/30693 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2019-11-30crypto: automatically manage memory for ECDSA_SIGTobias Nießen
Refs: https://github.com/nodejs/node/pull/29292 PR-URL: https://github.com/nodejs/node/pull/30641 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-11-30src: inline SetSNICallbackAnna Henningsen
Refs: https://github.com/nodejs/node/pull/30548#discussion_r348168855 PR-URL: https://github.com/nodejs/node/pull/30548 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2019-11-30src: use BaseObjectPtr to store SNI contextAnna Henningsen
Rather than relying on a link to the JS object, store a pointer to the C++ object directly. PR-URL: https://github.com/nodejs/node/pull/30548 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>