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

30880 Commits

Author SHA1 Message Date
Gabriel Schulhof
af83dcd5f4 doc: document n-api callback scope usage
Document that it is not necessary to open handle and/or callback scopes
inside finalizer, async work, thread-safe function etc. callbacks
unless for reasons documented in the section about object lifetime
management.

Link usage of callback signatures to their definition.

Fixes: https://github.com/nodejs/node/issues/33893
PR-URL: https://github.com/nodejs/node/pull/33915
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-06-23 15:50:43 -07:00
Rich Trott
d408ee1be3 tools: remove superfluous regex in tools/doc/json.js
Remove noCallOrProp from tools/doc/json.js. It is a negative lookahead
that is only used in one regex where it is placed immediately before a
terminating $, thus rendering it meaningless.

PR-URL: https://github.com/nodejs/node/pull/33998
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jamie Davis <davisjam@vt.edu>
2020-06-23 15:31:39 -07:00
legendecas
08a510a4e0 doc: clarify thread-safe function references
PR-URL: https://github.com/nodejs/node/pull/33871
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
2020-06-23 12:11:18 -07:00
Evan Lucas
f6dbba82bd internal: rename error-serdes for consistency
All other JavaScript files in lib use snake case, so make this
one consistent.

PR-URL: https://github.com/nodejs/node/pull/33793
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-23 11:33:12 -05:00
Rich Trott
680d7a04e7 doc: use npm team for npm upgrades in collaborator guide
The collaborator guide suggests pinging individuals about npm upgrades.
Change to pinging the npm team instead.

PR-URL: https://github.com/nodejs/node/pull/33999
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-06-23 06:41:43 -07:00
Rich Trott
076e4ed2d1 tools: update ESLint from 7.2.0 to 7.3.1
PR-URL: https://github.com/nodejs/node/pull/34000
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-23 05:24:47 -07:00
Rich Trott
27f3530da3 test: remove unnecessary eslint-disable comment
PR-URL: https://github.com/nodejs/node/pull/34000
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-23 05:24:44 -07:00
Robert Nagy
db0e991d52 fs: remove custom Buffer pool for streams
The performance benefit of using a custom pool are negligable.
Furthermore, it causes problems with Workers and transferrable.
Rather than further adding complexity for compat with Workers,
just remove the pooling logic.

Refs: https://github.com/nodejs/node/issues/33880#issuecomment-644430693
Fixes: https://github.com/nodejs/node/issues/31733

PR-URL: https://github.com/nodejs/node/pull/33981
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2020-06-23 13:27:01 +02:00
Maël Nison
e202df8e4b fs: implement lutimes
PR-URL: https://github.com/nodejs/node/pull/33399
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2020-06-23 09:14:28 +00:00
Rich Trott
86cbad837b doc: correct default values in http2 docs
The http2 docs include invalid JavaScript values as defaults for three
options. The intention was increased clarity, but we specify valid
values everywhere else in our docs, so let's do that for consistency.

PR-URL: https://github.com/nodejs/node/pull/33997
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 19:30:35 -07:00
Rich Trott
db52ae8b7f doc: use a single space between sentences
We mostly have a single space between the punctuation that ends a
sentence and the start of the next sentence. Change instances with two
spaces to one.

PR-URL: https://github.com/nodejs/node/pull/33995
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 19:29:18 -07:00
James M Snell
a8904e8eee
timers: introduce timers/promises
Move the promisified timers implementations into a new sub-module
to avoid the need to promisify. The promisified versions now return
the timers/promises versions.

Also adds `ref` option to the promisified versions

```js
const {
  setTimeout,
  setImmediate
} = require('timers/promises');

setTimeout(10, null, { ref: false })
  .then(console.log);

setImmediate(null, { ref: false })
  .then(console.log);

```

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33950
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-22 14:29:49 -07:00
WilliamConnatser
bfc0e3f0b0 doc: piping from async generators using pipeline()
PR-URL: https://github.com/nodejs/node/pull/33992
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 21:07:41 +02:00
Tobias Nießen
7b019fd3c9
crypto: allow KeyObjects in postMessage
This change allows sharing KeyObjects between threads via postMessage.
The receiver acquires a new KeyObject and a new KeyObjectHandle, but
refers to the same KeyObjectData:

+-------------------+
| NativeKeyObject 1 | ------------------------------------------+
+-------------------+                                           |
        ^                                                       |
     extends                                                    |
        |                                                       |
+-------------------+    +-------------------+                  |
| KeyObject 1  (JS) | -> | KeyObjectHandle 1 | --------------+  |
+-------------------+    +-------------------+               |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
+-------------------+                                        |  |
| NativeKeyObject 2 | ------------------------------------+  |  |
+-------------------+                                     |  |  |
        ^                                                 |  |  |
     extends                                              |  |  |
        |                                                 |  |  |
+-------------------+    +-------------------+            |  |  |
| KeyObject 2  (JS) | -> | KeyObjectHandle 2 | --------+  |  |  |
+-------------------+    +-------------------+         |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
+-------------------+                                  |  |  |  |
| NativeKeyObject 3 | ------------------------------+  |  |  |  |
+-------------------+                               |  |  |  |  |
        ^                                           |  |  |  |  |
     extends                                        |  |  |  |  |
        |                                           v  v  v  v  v
+-------------------+    +-------------------+    +---------------+
| KeyObject 3  (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData |
+-------------------+    +-------------------+    +---------------+

Co-authored-by: Anna Henningsen <anna@addaleax.net>

PR-URL: https://github.com/nodejs/node/pull/33360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 20:50:38 +02:00
Tobias Nießen
7f185ec3c4
src: store key data in separate class
This separates key handles from the actual key data:

+-----------------+
| NativeKeyObject |
+-----------------+
        ^
     extends
        |
+-----------------+    +-----------------+    +---------------+
| KeyObject  (JS) | -> | KeyObjectHandle | -> | KeyObjectData |
+-----------------+    +-----------------+    +---------------+

PR-URL: https://github.com/nodejs/node/pull/33360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 20:50:36 +02:00
Tobias Nießen
5489f19093
src: add NativeKeyObject base class
+---------------------+
             |     BaseObject      |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |   NativeKeyObject   |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |      KeyObject      |
             +---------------------+
               /                 \
              /                   \
             /                     \
            /                       \
+---------------------+    +---------------------+
|   SecretKeyObject   |    | AsymmetricKeyObject |
+---------------------+    +---------------------+
                             /                 \
                            /                   \
                           /                     \
                          /                       \
              +---------------------+   +---------------------+
              |   PublicKeyObject   |   |   PrivateKeyObject  |
              +---------------------+   +---------------------+

PR-URL: https://github.com/nodejs/node/pull/33360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 20:50:34 +02:00
Tobias Nießen
1e27e0a4db
src: rename internal key handles to KeyObjectHandle
PR-URL: https://github.com/nodejs/node/pull/33360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 20:50:31 +02:00
Daniel Bevenius
adf14e2617
quic: fix lint error in node_quic_crypto
Currently, the following lint error is generated:
Running C++ linter...
File "src/quic/node_quic_crypto.cc" does not use "String"
make[1]: *** [Makefile:1336: tools/.cpplintstamp] Error 1

This commit removes the unused using declaration.

PR-URL: https://github.com/nodejs/node/pull/34019
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 11:32:41 -07:00
James M Snell
9f2e00fb99
quic: temporarily disable preferred address tests
The way the preferred address mechanism is supposed to work
is this: A server might be exposed via multiple network
interfaces / addresses. The preferred address is the one that
clients should use. If a client uses one of the non-preferred
addresses to initially connect to the server, the server will
include the preferred address in it's initial transport params
back to the client over the original connection. The client
then can make a choice: it can either choose to ignore the
advertised preferred address and continue using the original,
or it can transition the in-flight connection to the preferred
address without having to restart the connection. In the latter
case, the connection will start making use of the preferred
address but it might not do so immediately.

To test this mechanism properly, we should have our server
configured on multiple endpoints with one of those marked
as the preferred. The connection should start on one and preceed
uninterrupted to completion. If the preferred address policy
is "accept", the client will accept and transition to the servers
preferred address transparently, without interupting the flow.

The current test is deficient because the server is only listening
on a single address which is also advertised as the preferred.
While the client should get the advertisement, we're not actually
making use of the preferred address advertisement and nothing on
the connection changes

The ipv6 version of the test is also hanging on some platforms and
it's not entirely clear why yet.

PR-URL: https://github.com/nodejs/node/pull/33934
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-22 11:32:39 -07:00
Shelley Vohr
46ee8647c3
test: account for non-node basename
PR-URL: https://github.com/nodejs/node/pull/33952
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 11:28:20 -07:00
Anna Henningsen
0e7c8bdc0c
quic: return 0 from SSL_CTX_sess_set_new_cb callback
The callback passed to `SSL_CTX_sess_set_new_cb()` should return 1
if it takes ownership (i.e. holds a reference that is later freed
through `SSL_SESSION_free()`) of the passed session, and 0
otherwise.

Since we don’t take ownership of the session and instead only save
a serialized version of it, return 0 instead of 1. This closes
a memory leak reported when running
`sequential/test-quic-preferred-address-ipv6`.

PR-URL: https://github.com/nodejs/node/pull/33931
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-06-22 11:06:40 -07:00
Daniel Bevenius
a041723774
deps: fix indentation for sources in nghttp3.gyp
PR-URL: https://github.com/nodejs/node/pull/33942
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-22 11:03:14 -07:00
Daniel Bevenius
a0cbd676e7
deps: add defines to nghttp3/ngtcp2 gyp configs
This commit adds two defines to ngtcp2, 'HAVE_ARPA_INET_H' and
'HAVE_NETINET_IN_H', and one define to nghttp3, 'HAVE_ARPA_INET_H' when
the operating system in use is linux.

The motivation for this is that currently, there are compiler warnings
generated for these libraries similar to the following:

../deps/ngtcp2/lib/ngtcp2_conv.c: In function ‘ngtcp2_put_uint16be’:
../deps/ngtcp2/lib/ngtcp2_conv.c:129:7: warning:
implicit declaration of function ‘htons’ [-Wimplicit-function-declaration]
  129 |   n = htons(n);
      |       ^~~~~

The inclusion of 'arpa/inet.h' is guarded by the 'HAVE_ARPA_INET_H'
macro (see deps/ngtcp2/lib/ngtcp2_conv.h).

These headers are checked by the ngtcp2 and nghttp3 builds using CMake's
CheckIncludeFile, and if they are available the above macros are defined.

I'm not sure if we need to have something similar to those checks or
ifit is alright to add these defines for certain operating systems.
Hopefully others will chime in and advice on how to handle this in the
best way.

PR-URL: https://github.com/nodejs/node/pull/33942
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-22 11:03:10 -07:00
James M Snell
c7d859e756
quic: refactor and improve ipv6Only
Ignore `ipv6Only: true` when binding to `'udp4'` (this differs from
dgram which will still attempt to apply the flag and will fail during
bind). Improve the test so that it should work consistently.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33935
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-22 10:58:20 -07:00
Anna Henningsen
1b7434dfc0
quic: set up FunctionTemplates more cleanly
- Use `kInternalFieldCount`, similar to 0fac393d.
- Always inherit from the correct parent template, similar to 8a7201b2.
- Always provide a template class name.

PR-URL: https://github.com/nodejs/node/pull/33968
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 10:56:10 -07:00
Rich Trott
df144d2601 doc: revise text in dns module documentation introduction
PR-URL: https://github.com/nodejs/node/pull/33986
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 10:08:14 -07:00
gengjiawen
8ef86a920c
quic: fix clang warning
PR-URL: https://github.com/nodejs/node/pull/33963
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 08:47:01 -07:00
wenningplus
680644ae15 http: expose host and protocol on ClientRequest
Allow host and protocol to be inspected.

PR-URL: https://github.com/nodejs/node/pull/33803
Fixes: https://github.com/nodejs/node/issues/2461
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 16:52:29 +02:00
Shakil-Shahadat
73a7a24cce doc: update fs.md
First class heading is made to look like other headings.

PR-URL: https://github.com/nodejs/node/pull/33820
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-06-22 20:19:40 +05:30
Daniel Bevenius
013cd1ac6f quic: use Check instead of FromJust in node_quic.cc
PR-URL: https://github.com/nodejs/node/pull/33937
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-22 15:11:26 +02:00
gengjiawen
326a79ebb9 test: fix typo in test-quic-client-empty-preferred-address.js
PR-URL: https://github.com/nodejs/node/pull/33976
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 12:07:14 +00:00
gengjiawen
74cd70e568 test: fix typo in common/index.js
PR-URL: https://github.com/nodejs/node/pull/33976
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 12:07:11 +00:00
gengjiawen
25413b003c src: improve indention for upd_wrap.cc
PR-URL: https://github.com/nodejs/node/pull/33976
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 12:07:09 +00:00
gengjiawen
09330fc155 quic: fix clang-tidy performance-faster-string-find issue
PR-URL: https://github.com/nodejs/node/pull/33975
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 12:02:39 +00:00
gengjiawen
9743624c0b quic: fix typo in comments
PR-URL: https://github.com/nodejs/node/pull/33975
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-22 12:02:35 +00:00
Alba Mendez
b8ea47162d doc: warn that tls.connect() doesn't set SNI
Add a note warning users that when using tls.connect(),
the `servername` option must be set explicitely to enable
SNI, otherwise the connection could fail.

PR-URL: https://github.com/nodejs/node/pull/33855
Fixes: https://github.com/nodejs/node/issues/28167
Co-authored-by: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-06-22 09:41:44 +02:00
Daniel Bevenius
54374d4343 src: remove unnecessary ToLocalChecked call
PR-URL: https://github.com/nodejs/node/pull/33902
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-06-22 08:44:50 +02:00
Daniel Bevenius
122038c6a2 build: add target specific build_type variable
This commit add a target specific variable named 'build_type' to the
node and node_g targets.

The motivation for doing this is that both targets share the same
prerequisites, and the recepies are the same (apart from the build type)
so some duplication can be avoided.

PR-URL: https://github.com/nodejs/node/pull/33925
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-22 07:24:51 +02:00
Rich Trott
07b2ada00d doc: fix lexical sorting of bottom-references in dns doc
The links are sorted in lexical order except for the two RFC links which
are reversed. Fix that.

PR-URL: https://github.com/nodejs/node/pull/33987
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-21 21:29:24 -07:00
Rich Trott
f05c963f33 doc: change "GitHub Repo" to "Code repository"
"GitHub Repo & Issue Tracker" changed to "Code repository and issue
tracker".

PR-URL: https://github.com/nodejs/node/pull/33985
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-06-21 21:27:29 -07:00
Rich Trott
3de78ad69b doc: use Class: consistently
The docs contain 122 uses of `Class:` in headers and one use of `class:`
in headers. This changes that one instance to conform with the other
instances.

PR-URL: https://github.com/nodejs/node/pull/33978
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-21 18:02:49 -07:00
rickyes
7a5d3a2fc1 http: add maxTotalSockets to agent class
Add maxTotalSockets to determine how many sockets an agent can open.
Unlike maxSockets, The maxTotalSockets does not count by per origin.

PR-URL: https://github.com/nodejs/node/pull/33617
Fixes: https://github.com/nodejs/node/issues/31942
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-21 18:20:05 +02:00
Denys Otrishko
64d22c320c timers: fix multipleResolves in promisified timeouts/immediates
After successful timer finish the abort event callback would still
reject (already resolved promise) upon calling abortController.abort().

Signed-off-by: Denys Otrishko <shishugi@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/33949
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-21 17:26:36 +02:00
Robert Nagy
51a2df4439 fs: document why isPerformingIO is required
PR-URL: https://github.com/nodejs/node/pull/33982
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-21 17:23:20 +02:00
Robert Nagy
30cc54275d http: don't emit error after close
Refs: https://github.com/nodejs/node/issues/33591

PR-URL: https://github.com/nodejs/node/pull/33654
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-06-21 17:21:12 +02:00
James M Snell
fdf10adef8
meta: introduce codeowners again
The [Contributor's Survey
results](https://github.com/nodejs/TSC/pull/882) highlight the fact that
it is often not easy for contributors to know who the right people are
to talk to about a proposed change or who to ask for reviews of a given
subsystem. We briefly toyed around with codeowners before when GitHub
introduced it but just as quickly disabled it because the structure of
our repository made it exceedingly difficult to get right.

Rather than start with a codeowners for the entire project, I propose
that we start with a small experiment focused on specific subsystems.
Specifically, codeowners for modules, streams, net/tls, http/http2, and
quic (once that lands). We can expand out from there as we see how
things go with the minimal starter set. Initially this just enables
codeowners for the `quic` subsystem.

A couple of points:

1. A codeowner should always be a team, never an individual person
2. Each codeowner team should contain at least one TSC member (to
provide coverage for signing off on semver-major changes)
3. PRs touching any code with a codeowner must be signed off by at least
one person on the codeowner team

PR-URL: https://github.com/nodejs/node/pull/33895
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-06-19 17:51:37 -07:00
Pragyan Das
343cf1b3c1 doc: update WASM code sample
- Code sample updated by adding a hello-world (`demo.wat`) code example
- Step for compiling `.wat` to `.wasm` added (with reference to `wabt`
  tools)
- The sample code prints "hello world\n" in the console

This update adds a very minimal change to the existing sample and can be
treated as an extension.

PR-URL: https://github.com/nodejs/node/pull/33626
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-06-19 09:57:28 -07:00
Pranshu Srivastava
fdcd4893ff
http2: always call callback on Http2ServerResponse#end
Fixes: https://github.com/nodejs/node/issues/28001

PR-URL: https://github.com/nodejs/node/pull/33911
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-06-19 18:22:44 +02:00
Fábio Santos
e199fc5534
module: fix error message about importing names from cjs
When importing specific names from a CJS module, and renaming them using
`as`, the example fix in the error message erroneously contains the
keyword `as` in the destructuring variable declaration.

Example of this issue:

    import { parse as acornParse } from "acorn";
             ^^^^^
    SyntaxError: The requested module 'acorn' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
    For example:
    import pkg from 'acorn';
    const { parse as acornParse } = pkg;

PR-URL: https://github.com/nodejs/node/pull/33882
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-06-19 18:14:27 +02:00
Gus Caplan
178e52a7ea
lib: remove manual exception handling in queueMicrotask
PR-URL: https://github.com/nodejs/node/pull/33859
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-06-19 18:04:54 +02:00