summaryrefslogtreecommitdiff
path: root/test/parallel
Commit message (Collapse)AuthorAgeFilesLines
* lib: add ASCII fast path to getStringWidth()Anna Henningsen2019-09-021-0/+22
| | | | | | | | | | | | | | | | | | | | | A lot of strings that are going to be passed to `getStringWidth()` are ASCII strings, for which the calculation is rather easy and calling into C++ can be skipped. confidence improvement accuracy (*) (**) (***) misc/getstringwidth.js n=100000 type='ascii' *** 328.99 % ±21.73% ±29.25% ±38.77% misc/getstringwidth.js n=100000 type='emojiseq' 2.94 % ±7.66% ±10.19% ±13.26% misc/getstringwidth.js n=100000 type='fullwidth' 4.70 % ±5.64% ±7.50% ±9.76% PR-URL: https://github.com/nodejs/node/pull/29301 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* stream: don't deadlock on aborted streamRobert Nagy2019-09-021-0/+27
| | | | | | | | | | Not all streams (e.g. http.ClientRequest) will always emit 'close' after 'aborted'. PR-URL: https://github.com/nodejs/node/pull/29376 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* console: use getStringWidth() for character width calculationAnna Henningsen2019-09-021-0/+18
| | | | | | | | | | | | | | | | | This is more accurate for displayed full-width characters (e.g. CJK ones) and makes the calculations match the ones we use in the readline module. Fixes: https://github.com/nodejs/node/issues/29299 PR-URL: https://github.com/nodejs/node/pull/29300 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: remove Windows skipping of http keepalive request GC testRich Trott2019-08-301-5/+0
| | | | | | | | | | | | | | Remove code to skip Windows in test-http-server-keepalive-req-gc. The test now works reliably on Windows (I think). PR-URL: https://github.com/nodejs/node/pull/29354 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
* util: do not throw when inspecting detached ArrayBufferAnna Henningsen2019-08-291-0/+10
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29318 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Gus Caplan <me@gus.host>
* buffer: correct indexOf() error messageBrian White2019-08-283-2/+3
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29217 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* test: fix flaky test-http-server-keepalive-req-gcRich Trott2019-08-281-3/+1
| | | | | | | | | Use `server` to keep the event loop open until the `ongc` listener runs. PR-URL: https://github.com/nodejs/node/pull/29347 Fixes: https://github.com/nodejs/node/issues/29344 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
* src: allow --interpreted-frames-native-stack in NODE_OPTIONSMatheus Marchini2019-08-271-0/+3
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/27744 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> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* errors: provide defaults for unmapped uv errorscjihrig2019-08-271-0/+26
| | | | | | | | | | | libuv does not map 100% of errors. When an unmapped error is encountered, the Map returns undefined, which is then unsuccessfully destructured, causing an exception. This commit adds a default value in the event of an unmapped error. PR-URL: https://github.com/nodejs/node/pull/29288 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* test: use print() function in both Python 2 and 3Christian Clauss2019-08-261-1/+1
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29298 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
* http: reset parser.incoming when server request is finishedAnna Henningsen2019-08-262-3/+59
| | | | | | | | | | | | | | | This resolves a memory leak for keep-alive connections and does not regress in the way that 779a05d5d1bfe2eeb05386f did by waiting for the incoming request to be finished before releasing the `parser.incoming` object. Refs: https://github.com/nodejs/node/pull/28646 Refs: https://github.com/nodejs/node/pull/29263 Fixes: https://github.com/nodejs/node/issues/9668 PR-URL: https://github.com/nodejs/node/pull/29297 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* stream: fix readable state `awaitDrain` increase in recursionran2019-08-265-22/+50
| | | | | PR-URL: https://github.com/nodejs/node/pull/27572 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* console: display timeEnd with suitable time unitXavier Stouder2019-08-252-16/+31
| | | | | | | | | | | | When timeEnd function is called, display result with a suitable time unit instead of a big amount of milliseconds. Refs: https://github.com/nodejs/node/issues/29099 PR-URL: https://github.com/nodejs/node/pull/29251 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* test, http: add regression test for keepalive 'end' eventMatteo Collina2019-08-241-0/+29
| | | | | | | | | | This test covers a regression where 'end' was not emitted in the case of keepalive requests without parsing the full body. PR-URL: https://github.com/nodejs/node/pull/29263 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* net: allow reading data into a static bufferBrian White2019-08-231-0/+186
| | | | | | | | | Co-Authored-By: Anna Henningsen <anna@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/25436 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* fs: add recursive option to rmdir()cjihrig2019-08-231-0/+152
| | | | | | | | | | | | | This commit adds a recursive option to fs.rmdir(), fs.rmdirSync(), and fs.promises.rmdir(). The implementation is a port of the npm module rimraf. PR-URL: https://github.com/nodejs/node/pull/29168 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
* http: fix event listener leakRobert Nagy2019-08-231-1/+10
| | | | | | | | | Fixes: https://github.com/nodejs/node/issues/29239 PR-URL: https://github.com/nodejs/node/pull/29245 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* stream: async iterator destroy compatRobert Nagy2019-08-231-0/+41
| | | | | | | | | async iterator should not depend on internal API for better compat with streamlike objects. PR-URL: https://github.com/nodejs/node/pull/29176 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* test: add `emitClose: true` tests for fs streamsRich Trott2019-08-221-2/+25
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29212 Fixes: https://github.com/nodejs/node/issues/29177 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* buffer: correct concat() error messageBrian White2019-08-211-2/+2
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29198 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* stream: do not emit drain if stream endedRobert Nagy2019-08-201-0/+16
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29086 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* stream: disallow stream methods on finished streamRobert Nagy2019-08-202-0/+47
| | | | | | | | | | | | | | Invoke callback with ERR_STREAM_ALREADY_FINISHED error if `end()` is called on a finished stream. PR-URL: https://github.com/nodejs/node/pull/28687 Refs: https://github.com/nodejs/node/issues/28667 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* bootstrap: run preload prior to frozen-intrinsicsBradley Farias2019-08-201-0/+29
| | | | | | | | | | | | | This is used to allow people to run polyfills. Co-Authored-By: Anna Henningsen <github@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/28940 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* stream: add readableEndedRobert Nagy2019-08-192-0/+42
| | | | | | | | | | Adds a readableEnded property and improved finished compat with possible stream-like objects. PR-URL: https://github.com/nodejs/node/pull/28814 Refs: https://github.com/nodejs/node/issues/28813 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* tools: make code cache and snapshot deterministicBen Noordhuis2019-08-191-0/+17
| | | | | | | | | | | | | | | | Use a fixed random seed to ensure that the generated sources are identical across runs. The final node binary still reseeds itself on start-up so there should be no security implications caused by predictable random numbers (e.g., `Math.random()`, ASLR, the hash seed, etc.) Fixes: https://github.com/nodejs/node/issues/29108 PR-URL: https://github.com/nodejs/node/pull/29142 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* worker: fix crash when SharedArrayBuffer outlives creating threadAnna Henningsen2019-08-202-0/+55
| | | | | | | | | | | | | Keep a reference to the `ArrayBuffer::Allocator` alive for at least as long as a `SharedArrayBuffer` allocated by it lives. Refs: https://github.com/nodejs/node/pull/28788 Fixes: https://github.com/nodejs/node/issues/28777 Fixes: https://github.com/nodejs/node/issues/28773 PR-URL: https://github.com/nodejs/node/pull/29190 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* test: deflake test-tls-passphraseLuigi Pinca2019-08-191-24/+26
| | | | | | | | | | | | | | Move `socket.end()` to client. Fixes: https://github.com/nodejs/node/issues/28111 Refs: https://github.com/nodejs/node/pull/27569 PR-URL: https://github.com/nodejs/node/pull/29134 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* fs: add writev() promises versioncjihrig2019-08-191-0/+51
| | | | | | | | | | | | https://github.com/nodejs/node/pull/25925 added fs.writev() and fs.writevSync(), but did not include a Promises based equivalent. This commit adds the missing method. Refs: https://github.com/nodejs/node/pull/25925 PR-URL: https://github.com/nodejs/node/pull/29186 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib: rename validateSafeInteger to validateIntegercjihrig2019-08-191-0/+25
| | | | | | | | | | | | | | | validateInteger() was renamed to validateSafeInteger() in https://github.com/nodejs/node/pull/26572. However, this function also works with unsafe integers. This commit restores the old name, and adds some basic tests. PR-URL: https://github.com/nodejs/node/pull/29184 Refs: https://github.com/nodejs/node/pull/26572 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* lib,test: fix error message check after V8 updateMichaël Zasso2019-08-192-3/+3
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/28918 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* stream: do not emit after 'error'Robert Nagy2019-08-181-0/+17
| | | | | | | | | | | Do not emit 'prefinish' or 'finish' event after an error. PR-URL: https://github.com/nodejs/node/pull/28708 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* http2: remove callback-based paddingAnna Henningsen2019-08-172-52/+4
| | | | | | | | | | This option is not useful in practice, as mentioned in comments and the documentation, because the overhead of calling into JS makes it unreasonably expensive. PR-URL: https://github.com/nodejs/node/pull/29144 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* src: rename --security-reverts to ...-revertSam Roberts2019-08-171-1/+1
| | | | | | | | | | | | | | | | | | It was called --security-revert prior to 12.x, but changed in https://github.com/nodejs/node/pull/22490. See: https://github.com/nodejs/nodejs.org/pull/2412#issuecomment-521739752 PR-URL: https://github.com/nodejs/node/pull/29153 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* http,stream: add writableEndedRobert Nagy2019-08-174-0/+10
| | | | | | | | | | | | | | | | This is work towards resolving the response.finished confusion and future deprecation. Note that implementation-wise, streams have both an ending and ended state. However, in this case (in order to avoid confusion in user space) writableEnded is equal to writable.ending. The ending vs ended situation is internal state required for internal stream logic. PR-URL: https://github.com/nodejs/node/pull/28934 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* fs: add fs.writev() which exposes syscall writev()Anas Aboureada2019-08-162-0/+179
| | | | | | | | | | | | | fs with writev allow many buffers to be pushed to underlying OS APIs in one batch, so this should improve write speed to files. Refs: https://github.com/nodejs/node/issues/2298 PR-URL: https://github.com/nodejs/node/pull/25925 Fixes: https://github.com/nodejs/node/issues/2298 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* fs: allow int64 offset in fs.write/writeSync/fd.writeZach Bjornson2019-08-162-16/+24
| | | | | | | | | | | Ref https://github.com/nodejs/node/issues/26563 PR-URL: https://github.com/nodejs/node/pull/26572 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* fs: allow int64 offset in fs.read/readSync/fd.readZach Bjornson2019-08-161-0/+27
| | | | | | | | | | | | | | | | | | | | | Since v10.10.0, 'buf' can be any DataView, meaning the largest byteLength can be Float64Array.BYTES_PER_ELEMENT * kMaxLength = 17,179,869,176. 'offset' can now be up to 2**53 - 1. This makes it possible to tile reads into a large buffer. Breaking: now throws if read offset is not a safe int, is null or is undefined. Fixes https://github.com/nodejs/node/issues/26563 PR-URL: https://github.com/nodejs/node/pull/26572 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* tls: allow client-side sockets to be half-openedLuigi Pinca2019-08-172-0/+111
| | | | | | | | | | | Make `tls.connect()` support an `allowHalfOpen` option which specifies whether or not to allow the connection to be half-opened when the `socket` option is not specified. PR-URL: https://github.com/nodejs/node/pull/27836 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
* readline: establish y in cursorTo as optionalGerhard Stoebich2019-08-161-0/+8
| | | | | | | | | | | | | Parameter y in cursorTo() is optional and this is also verified by tests but docs don't state this. Besides that if the newly added parameter callback is used with no y, it's quite unhandy. This PR allows to simply omit y. PR-URL: https://github.com/nodejs/node/pull/29128 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* stream: fix destroy() behaviorRobert Nagy2019-08-166-35/+87
| | | | | | | | | | Ensure errorEmitted is always set. Only emit 'error' once. PR-URL: https://github.com/nodejs/node/pull/29058 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* stream: use lazy registration for drain for fast destinationsRobert Nagy2019-08-162-7/+23
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/29095 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* fs: add default options for *stat()Tony Brix2019-08-161-0/+11
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29114 Fixes: https://github.com/nodejs/node/issues/29113 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* http2: pause input processing if sending outputAnna Henningsen2019-08-151-0/+39
| | | | | | | | | | | | | | | If we are waiting for the ability to send more output, we should not process more input. This commit a) makes us send output earlier, during processing of input, if we accumulate a lot and b) allows interrupting the call into nghttp2 that processes input data and resuming it at a later time, if we do find ourselves in a position where we are waiting to be able to send more output. This is part of mitigating CVE-2019-9511/CVE-2019-9517. PR-URL: https://github.com/nodejs/node/pull/29122 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* http2: handle 0-length headers betterAnna Henningsen2019-08-151-0/+25
| | | | | | | | | | | Ignore headers with 0-length names and track memory for headers the way we track it for other HTTP/2 session memory too. This is intended to mitigate CVE-2019-9516. PR-URL: https://github.com/nodejs/node/pull/29122 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* http2: limit number of invalid incoming framesAnna Henningsen2019-08-151-0/+79
| | | | | | | | | | | | Limit the number of invalid input frames, as they may be pointing towards a misbehaving peer. The limit is currently set to 1000 but could be changed or made configurable. This is intended to mitigate CVE-2019-9514. PR-URL: https://github.com/nodejs/node/pull/29122 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* buffer: improve copy() performanceBrian White2019-08-142-9/+17
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29066 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* http: follow symbol naming conventionRobert Nagy2019-08-143-8/+8
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29091 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* test: skip test-fs-access if rootDaniel Bevenius2019-08-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if this test is run as the root user the following failure will occur: === release test-fs-access === Path: parallel/test-fs-access (node:46733) internal/test/binding: These APIs are for internal testing only. Do not use them. Can't clean tmpdir: /root/node/test/.tmp.522 Files blocking: [ 'read_only_file', 'read_write_file' ] /root/node/test/common/tmpdir.js:136 throw e; ^ Error: EACCES: permission denied, rmdir '/root/node/test/.tmp.522' at Object.rmdirSync (fs.js:693:3) at rmdirSync (/root/node/test/common/tmpdir.js:72:8) at rimrafSync (/root/node/test/common/tmpdir.js:41:7) at process.onexit (/root/node/test/common/tmpdir.js:121:5) at process.emit (events.js:214:15) { errno: -13, syscall: 'rmdir', code: 'EACCES', path: '/root/node/test/.tmp.522' } Command: ./node --expose-internals test/parallel/test-fs-access.js This commit adds a root user check and skips this test if running as the user root. PR-URL: https://github.com/nodejs/node/pull/29092 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
* buffer: improve ERR_BUFFER_OUT_OF_BOUNDS defaultcjihrig2019-08-146-6/+6
| | | | | | | | | | | | | | | | | This commit changes the default message used by ERR_BUFFER_OUT_OF_BOUNDS. Previously, the default message implied that the problematic was always a write, which is not accurate. PR-URL: https://github.com/nodejs/node/pull/29098 Fixes: https://github.com/nodejs/node/issues/29097 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* doc, lib, src, test, tools: fix assorted typosXhmikosR2019-08-125-5/+5
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29075 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>