platform/upstream/nodejs.git
8 years agotimers: optimize callback call: bind -> arrow
Andrei Sedoi [Thu, 26 Nov 2015 15:55:05 +0000 (15:55 +0000)]
timers: optimize callback call: bind -> arrow

ES6 arrow functions are much more efficient than `.bind()` functions.

PR-URL: https://github.com/nodejs/node/pull/4038
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodoc: document backlog for server.listen() variants
Jan Schär [Wed, 25 Nov 2015 20:56:11 +0000 (21:56 +0100)]
doc: document backlog for server.listen() variants

The backlog parameter is supported by all variations of
net.Server.listen(), but wasn't consistently documented. This
commit brings the documentation into a more consistent state.

Refs: https://github.com/nodejs/node/pull/4056
PR-URL: https://github.com/nodejs/node/pull/4025
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
8 years agodoc: fixup socket.remoteAddress
Arthur Gautier [Tue, 8 Dec 2015 16:55:45 +0000 (16:55 +0000)]
doc: fixup socket.remoteAddress

remoteAddress may be undefined under certain conditions

Signed-off-by: Arthur Gautier <baloo@gandi.net>
PR-URL: https://github.com/nodejs/node/pull/4198
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
8 years agodoc: add links and backticks around names
jpersson [Fri, 27 Nov 2015 23:30:32 +0000 (18:30 -0500)]
doc: add links and backticks around names

* add backticks around names
* add single quotes around event names
* add parenthesis after function names
* add internal links between different sections
* add external links to MDN for some JavaScript references
* sort the link definitions alphabetically

PR-URL: https://github.com/nodejs/node/pull/4054
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agocrypto: fix native module compilation with FIPS
Stefan Budeanu [Wed, 25 Nov 2015 00:17:49 +0000 (19:17 -0500)]
crypto: fix native module compilation with FIPS

Prevent OpenSSL's fipsld from being used to link native modules
because this requires the original OpenSSL source to be
available after Node's installation.

Fixes: https://github.com/nodejs/node/issues/3815
PR-URL: https://github.com/nodejs/node/pull/4023
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
8 years agotest: use platform-based timeout for reliability
Rich Trott [Wed, 25 Nov 2015 04:59:49 +0000 (20:59 -0800)]
test: use platform-based timeout for reliability

test-http-client-timeout-with-data fails on Raspberry Pi in CI from time
to time.

Use a platform-based timeout to improve reliability.

PR-URL: https://github.com/nodejs/node/pull/4015
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agobuffer: default to UTF8 in byteLength()
Tom Gallacher [Tue, 24 Nov 2015 21:48:03 +0000 (21:48 +0000)]
buffer: default to UTF8 in byteLength()

If an undefined encoding is passed to byteLength(),
assume that it is UTF8 immediately. This yields a
small speedup, as it prevents string operations on
the encoding argument.

PR-URL: https://github.com/nodejs/node/pull/4010
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agodoc: s/node.js/Node.js in readme
Rod Vagg [Tue, 24 Nov 2015 03:07:29 +0000 (14:07 +1100)]
doc: s/node.js/Node.js in readme

PR-URL: https://github.com/nodejs/node/pull/3998
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
8 years agotest: fix time resolution constraint
Gireesh Punathil [Mon, 23 Nov 2015 09:28:13 +0000 (04:28 -0500)]
test: fix time resolution constraint

The modification time of a file is assumed to happen at the
exact time when it was requested. As the utime API specification
delcares that the resolution of the result is 1 second,
relax the constrain to 1 second helps the test case to be
robust and consistent under different load conditions in the system

PR-URL: https://github.com/nodejs/node/pull/3981
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
8 years agotest: add TAP diagnostic message for retried tests
Rich Trott [Sat, 21 Nov 2015 20:37:49 +0000 (12:37 -0800)]
test: add TAP diagnostic message for retried tests

Tests on SmartOS are sometimes retried due to a SmartOS issue on CI.
When this happens, a TAP diagnostic message is written.

PR-URL: https://github.com/nodejs/node/pull/3960
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agonet: small code cleanup
Jan Schär [Fri, 20 Nov 2015 19:23:25 +0000 (20:23 +0100)]
net: small code cleanup

`options` is already a param of the function.

PR-URL: https://github.com/nodejs/node/pull/3943
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodoc: move fs.existsSync() deprecation message
Martin Forsberg [Fri, 20 Nov 2015 17:36:59 +0000 (18:36 +0100)]
doc: move fs.existsSync() deprecation message

This commit moves the deprecation message for fs.existsSync()
above the function description, making message placement
uniform across the documentation.

PR-URL: https://github.com/nodejs/node/pull/3942
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agofs,doc: use `target` instead of `destination`
yorkie [Wed, 25 Nov 2015 04:40:42 +0000 (12:40 +0800)]
fs,doc: use `target` instead of `destination`

PR-URL: https://github.com/nodejs/node/pull/3912
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agotest: add OS X to module loading error test
Evan Lucas [Wed, 18 Nov 2015 14:07:15 +0000 (08:07 -0600)]
test: add OS X to module loading error test

Previously, this test was not supported on OS X. This change makes sure
that it is no longer skipped.

PR-URL: https://github.com/nodejs/node/pull/3901
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agocrypto: disable crypto.createCipher in FIPS mode
Stefan Budeanu [Mon, 9 Nov 2015 05:00:56 +0000 (00:00 -0500)]
crypto: disable crypto.createCipher in FIPS mode

FIPS 140-2 disallows use of MD5, which is used to derive the
initialization vector and key for createCipher(). Modify
all tests to expect exceptions in FIPS mode when disallowed
API is used, or to avoid testing such API in FIPS Mode.

PR-URL: https://github.com/nodejs/node/pull/3754
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: Describe FIPSDIR environment variable
Stefan Budeanu [Fri, 6 Nov 2015 19:50:57 +0000 (14:50 -0500)]
doc: Describe FIPSDIR environment variable

As per the OpenSSL User Guide, it is possible to use the FIPSDIR
environment variable to specify a custom install path for the
validated cryptographic module.

PR-URL: https://github.com/nodejs/node/pull/3752
Reviewed-By: Michael Dawsson <michael_dawson@ca.ibm.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agotools: enforce `throw new Error()` with lint rule
Rich Trott [Sun, 8 Nov 2015 17:53:50 +0000 (09:53 -0800)]
tools: enforce `throw new Error()` with lint rule

Add linting rule requiring `throw new Error()` over `throw Error()`.

PR-URL: https://github.com/nodejs/node/pull/3714
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotools: Use `throw new Error()` consistently
Rich Trott [Sun, 8 Nov 2015 17:51:29 +0000 (09:51 -0800)]
tools: Use `throw new Error()` consistently

In preparation for a lint rule that will enforce `throw new Error()`
over `throw Error()`, fix the handful of instances in the code that
use `throw Error()`.

PR-URL: https://github.com/nodejs/node/pull/3714
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: skip instead of fail when mem constrained
Michael Cornacchia [Fri, 6 Nov 2015 17:51:48 +0000 (12:51 -0500)]
test: skip instead of fail when mem constrained

The current implementation of tests for strings with length at or
exceeding kStringMaxLength allocate a temporary buffer inside a try
block to skip the test if there is insufficient memory. This commit adds
an invocation of the garbage collector after the temporary buffer is
allocated so that memory is freed for later allocations.

Change the corresponding catch block to rethrow the original exception
instead of asserting the exception message to provide more information
about the exception.

Add an additional check before trying to allocate memory to immediately
skip the test on machines with insufficient total memory.

PR-URL: https://github.com/nodejs/node/pull/3697
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodoc: add warning about Windows process groups
Roman Klauke [Thu, 5 Nov 2015 19:08:34 +0000 (20:08 +0100)]
doc: add warning about Windows process groups

This commit adds a warning for Windows platforms. `process.kill` wont
kill a process group on Windows and instead it throws an error.

Refs: https://github.com/nodejs/node/issues/3617
PR-URL: https://github.com/nodejs/node/pull/3681
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agobuild: omit -gline-tables-only for --enable-asan
Ben Noordhuis [Thu, 5 Nov 2015 17:16:18 +0000 (18:16 +0100)]
build: omit -gline-tables-only for --enable-asan

`-gline-tables-only` is a clang-only flag.  Drop it, it's not needed for
address sanitizer-enabled builds and it makes it impossible to build
with gcc.

Fixes: https://github.com/nodejs/node/issues/3656
PR-URL: https://github.com/nodejs/node/pull/3680
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agodoc: add CTC meeting minutes 2015-10-28
Rod Vagg [Wed, 4 Nov 2015 11:56:17 +0000 (22:56 +1100)]
doc: add CTC meeting minutes 2015-10-28

PR-URL: https://github.com/nodejs/node/pull/3661
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: add final full stop in CONTRIBUTING.md
Emily Aviva Kapor-Mater [Thu, 29 Oct 2015 21:52:36 +0000 (14:52 -0700)]
doc: add final full stop in CONTRIBUTING.md

PR-URL: https://github.com/nodejs/node/pull/3576
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agotest: fix race condition in unrefd interval test
Michael Cornacchia [Tue, 27 Oct 2015 16:55:09 +0000 (12:55 -0400)]
test: fix race condition in unrefd interval test

Rely more on timers implementation rather than arbitrary timeouts.

Refs: https://github.com/nodejs/node/issues/1781
PR-URL: https://github.com/nodejs/node/pull/3550

Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodoc: add TSC meeting minutes 2015-10-21
Rod Vagg [Thu, 22 Oct 2015 03:42:27 +0000 (23:42 -0400)]
doc: add TSC meeting minutes 2015-10-21

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3480

8 years agodoc: add TSC meeting minutes 2015-10-14
Rod Vagg [Wed, 21 Oct 2015 02:43:47 +0000 (22:43 -0400)]
doc: add TSC meeting minutes 2015-10-14

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3463

8 years agoasync_wrap: call callback in destructor
Trevor Norris [Tue, 20 Oct 2015 18:20:10 +0000 (12:20 -0600)]
async_wrap: call callback in destructor

Call a user's callback to notify that the handle has been destroyed.
Only pass the id of the AsyncWrap instance since the object no longer
exists.

The object that's being destructed should never be inspected within the
callback or any time afterward.

This commit make a breaking change. The init callback will now be passed
arguments in the order of provider, id, parent.

PR-URL: https://github.com/nodejs/node/pull/3461
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agoasync_wrap: new instances get uid
Trevor Norris [Mon, 19 Oct 2015 23:14:05 +0000 (17:14 -0600)]
async_wrap: new instances get uid

New instances of AsyncWrap are automatically assigned a unique id. The
value will be used in future commits to communicate additional
information via the async hooks.

While the largest value we can reliably communicate to JS is 2^53, even
if a new AsyncWrap is created every 100ns the uid won't reach its end
for 28.5 years.

PR-URL: https://github.com/nodejs/node/pull/3461
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agoasync_wrap: allow some hooks to be optional
Trevor Norris [Tue, 20 Oct 2015 18:18:15 +0000 (12:18 -0600)]
async_wrap: allow some hooks to be optional

Only enforce that the init callback is passed to setupHooks(). The
remaining hooks can be optionally passed.

Throw if async_wrap.enable() runs before setting the init callback or if
setupHooks() is called while async wrap is enabled.

Add test to verify calls throw appropriately.

PR-URL: https://github.com/nodejs/node/pull/3461
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agotools: add tap output to cpplint
Johan Bergström [Tue, 20 Oct 2015 10:24:53 +0000 (21:24 +1100)]
tools: add tap output to cpplint

Implement a crude TAP13 writer for cpplint. Does its job and
not much else. Only supports writing TAP output to file,
not vs7 or emacs formats.

PR-URL: https://github.com/nodejs/node/pull/3448
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agoutil: fix constructor/instanceof checks
Brian White [Thu, 15 Oct 2015 19:55:42 +0000 (15:55 -0400)]
util: fix constructor/instanceof checks

These new checks are similar to the one introduced in 089d68861,
but for other types of objects. Specifically, if an object was
created in a different context, the constructor object will not be
the same as the constructor object in the current context, so we
have to compare constructor names instead.

PR-URL: https://github.com/nodejs/node/pull/3385
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agodoc: add TSC meeting minutes 2015-10-07
Rod Vagg [Wed, 14 Oct 2015 11:51:47 +0000 (22:51 +1100)]
doc: add TSC meeting minutes 2015-10-07

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3364

8 years agodoc: add TSC meeting minutes 2015-09-30
Rod Vagg [Wed, 7 Oct 2015 11:18:56 +0000 (22:18 +1100)]
doc: add TSC meeting minutes 2015-09-30

PR-URL: https://github.com/nodejs/node/pull/3235
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
8 years agotools: enable prefer-const eslint rule
Sakthipriyan Vairamani [Thu, 8 Oct 2015 17:40:10 +0000 (23:10 +0530)]
tools: enable prefer-const eslint rule

Description from: http://eslint.org/docs/rules/prefer-const.html

If a variable is never modified, using the `const` declaration is
better. `const` declaration tells readers, "this variable is never
modified," reducing cognitive load and improving maintainability.

Refer: https://github.com/nodejs/node/issues/3118
PR-URL: https://github.com/nodejs/node/pull/3152
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agolib,test: update let to const where applicable
Sakthipriyan Vairamani [Thu, 8 Oct 2015 17:41:29 +0000 (23:11 +0530)]
lib,test: update let to const where applicable

As per the `prefer-const` eslint rule, few instances of `let` have been
identified to be better with `const`. This patch updates all those
instances.

Refer: https://github.com/nodejs/node/issues/3118
PR-URL: https://github.com/nodejs/node/pull/3152
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agobuild: Updates for AIX npm support - part 1
Michael Dawson [Tue, 29 Sep 2015 14:22:00 +0000 (10:22 -0400)]
build: Updates for AIX npm support - part 1

This PR is the first step enabling support for native modules
for AIX.  The main issue is that unlike linux where all
symbols within the Node executable are available to the shared
library for a native module (npm), on AIX the symbols must
be explicitly exported.  In addition, when the shared library is
built it must be linked using a list of the available symbols.

This patch covers the changes need to:

 1) Export the symbols when building the node executable
 2) Generate the file listing the symbols that can be used when
    building the shared library.

For AIX, it breaks the build process into 2 steps.  The first builds
a static library and then generates a node.exp file which contains
the symbols from that library.  The second builds the node executable
and uses the node.exp file to specify which symbols should be
exported.  In addition, it save the node.exp file so that it can
later be used in the creation of the shared library when building
a native module.

The following additional steps will be required in dependent projects
to fully enable AIX for native modules and are being worked
separately:

 - Updates to node-gyp to use node.exp when creating the
   shared library for a native module
 - Fixes to gyp related to copying files as covered in
      https://codereview.chromium.org/1368133002/patch/1/10001
 - Pulling in updated gyp versions to Node and node-gyp
 - Pulling latest libuv

These changes were done to minimize the change to other platforms
by working within the existing structure to add the 2 step process
for AIX without changing the process for other platforms.

PR-URL: https://github.com/nodejs/node/pull/3114
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agomodule: fix column offsets in errors
Tristian Flanagan [Mon, 14 Sep 2015 22:26:59 +0000 (18:26 -0400)]
module: fix column offsets in errors

Because Node modules are wrapped, errors on the first line
of a file leak the wrapper to the user and report the wrong
column number. This commit adds a line break to the module
wrapper so that the first line is treated the same as all
other lines. To compensate for the additional line, a line
offset of -1 is also applied to errors.

Fixes: https://github.com/nodejs/node/issues/2860
PR-URL: https://github.com/nodejs/node/pull/2867
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodoc: update irc channels: #node.js and #node-dev
Nelson Pecora [Tue, 8 Sep 2015 20:25:57 +0000 (16:25 -0400)]
doc: update irc channels: #node.js and #node-dev

IRC (general questions): irc.freenode.net #node.js
IRC (node core development): irc.freenode.net #node-dev

PR-URL: https://github.com/nodejs/node/pull/2743
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodebugger: also exit when the repl emits 'exit'
Felix Böhm [Thu, 13 Aug 2015 18:21:30 +0000 (20:21 +0200)]
debugger: also exit when the repl emits 'exit'

Exit the debug repl when repl emits 'exit'

Refs: https://github.com/nodejs/node-v0.x-archive/issues/5637
Fixes: https://github.com/nodejs/node-v0.x-archive/issues/5631
PR-URL: https://github.com/nodejs/node/pull/2369
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agoNow working on v4.2.5
James M Snell [Wed, 23 Dec 2015 17:01:52 +0000 (09:01 -0800)]
Now working on v4.2.5

8 years ago2015-12-23, Version 4.2.4 "Argon" (LTS) Release v4.2.4
James M Snell [Thu, 17 Dec 2015 21:21:24 +0000 (13:21 -0800)]
2015-12-23, Version 4.2.4 "Argon" (LTS) Release

Maintenance Update

Notable changes

* Roughly 78% of the commits are documentation and test
  improvements
* domains:
  - Fix handling of uncaught exceptions (Julien Gilli)
    [#3884](https://github.com/nodejs/node/pull/3884)
* deps:
  - Upgrade to npm 2.14.12 (Kat Marchán)
    [#4110](https://github.com/nodejs/node/pull/4110)
  - Backport 819b40a from V8 upstream (Michaël Zasso)
    [#3938](https://github.com/nodejs/node/pull/3938)
  - Updated node LICENSE file with new npm license (Kat Marchán)
    [#4110](https://github.com/nodejs/node/pull/4110)

8 years agodeps: upgrade to npm 2.14.12
Kat Marchán [Tue, 1 Dec 2015 23:06:08 +0000 (15:06 -0800)]
deps: upgrade to npm 2.14.12

PR-URL: https://github.com/nodejs/node/pull/4110
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodomains: fix handling of uncaught exceptions
Julien Gilli [Tue, 3 Nov 2015 01:56:24 +0000 (17:56 -0800)]
domains: fix handling of uncaught exceptions

Fix node exiting due to an exception being thrown rather than emitting
an `'uncaughtException'` event on the process object when:
1. no error handler is set on the domain within which an error is thrown
2. an `'uncaughtException'` event listener is set on the process

Also fix an issue where the process would not abort in the proper
function call if an error is thrown within a domain with no error
handler and `--abort-on-uncaught-exception` is used.

Fixes #3607 and #3653.

PR: #3884
PR-URL: https://github.com/nodejs/node/pull/3884
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agometa: remove use of profanity in source
Myles Borins [Wed, 2 Dec 2015 18:47:45 +0000 (10:47 -0800)]
meta: remove use of profanity in source

The CoC requests to avoid the casual use of profanity.

PR-URL: https://github.com/nodejs/node/pull/4122
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
8 years agodoc: standardize references to node.js in docs
Scott Buchanan [Thu, 3 Dec 2015 19:11:22 +0000 (14:11 -0500)]
doc: standardize references to node.js in docs

trivial commit to fix a couple inconsistent references to
the name of the project

PR-URL: https://github.com/nodejs/node/pull/4136
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agodoc: fix internal link to child.send()
Luigi Pinca [Tue, 1 Dec 2015 08:10:12 +0000 (09:10 +0100)]
doc: fix internal link to child.send()

PR-URL: https://github.com/nodejs/node/pull/4089
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodoc: reword https.Agent example text
Jan Krems [Mon, 30 Nov 2015 18:40:02 +0000 (10:40 -0800)]
doc: reword https.Agent example text

PR-URL: https://github.com/nodejs/node/pull/4075
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agotest: refactor test-http-exit-delay
Rich Trott [Sat, 28 Nov 2015 03:40:56 +0000 (19:40 -0800)]
test: refactor test-http-exit-delay

test-http-exit-delay was introduced to confirm the removal of a 1 second
delay that can occur when exiting node after an http request.

This change refactors the test for simplicity and also in the hopes of
either eliminating flakiness on CI or, if not that, at least making
the source of the flakiness easier to track down.

Ref: https://github.com/nodejs/node/commit/16b59cbc
Fixes: https://github.com/nodejs/node/issues/4045
PR-URL: https://github.com/nodejs/node/pull/4055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agostream_wrap: error if stream has StringDecoder
Fedor Indutny [Sat, 5 Dec 2015 21:03:30 +0000 (16:03 -0500)]
stream_wrap: error if stream has StringDecoder

If `.setEncoding` was called on input stream - all emitted `data` will
be `String`s instances, not `Buffer`s. This is unacceptable for
`StreamWrap`, and should not lead to the crash.

Fix: https://github.com/nodejs/node/issues/3970
PR-URL: https://github.com/nodejs/node/pull/4031
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agoconfigure: `v8_use_snapshot` should be `true`
Fedor Indutny [Sun, 22 Nov 2015 01:21:11 +0000 (20:21 -0500)]
configure: `v8_use_snapshot` should be `true`

`v8_use_snapshot` should be either `true` or `false`, not 1 or 0.

PR-URL: https://github.com/nodejs/node/pull/3962
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
8 years agobuild: update signtool description, add url
Rod Vagg [Tue, 24 Nov 2015 23:36:25 +0000 (10:36 +1100)]
build: update signtool description, add url

PR-URL: https://github.com/nodejs/node/pull/4011
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Alexis Campailla <orangemocha@nodejs.org>
8 years agotest: fix cluster-disconnect-handles flakiness
Santiago Gimeno [Tue, 24 Nov 2015 20:39:24 +0000 (21:39 +0100)]
test: fix cluster-disconnect-handles flakiness

Sometimes the test was timing out because the worker process remained
stuck in the breakpoint and didn't exit. This could happen because the
continue was sent before the breakpoint was set. If that's the case,
with this change, a new continue command is sent so the worker process
can end.

PR-URL: https://github.com/nodejs/node/pull/4009
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agobuffer: fix writeInt{B,L}E for some neg values
Peter A. Bigot [Mon, 23 Nov 2015 22:12:46 +0000 (16:12 -0600)]
buffer: fix writeInt{B,L}E for some neg values

The algorithm used to convert negative values to hex generates incorrect
values when the low byte(s) of the value are zero because a carried
subtraction is applied prematurely.

Fixes: https://github.com/nodejs/node/issues/3992
PR-URL: https://github.com/nodejs/node/pull/3994
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
8 years agotest: don't check the # of chunks in test-http-1.0
Santiago Gimeno [Sat, 21 Nov 2015 21:29:37 +0000 (22:29 +0100)]
test: don't check the # of chunks in test-http-1.0

As it can happen that the HTTP response is received in more than
one TCP chunk.

PR-URL: https://github.com/nodejs/node/pull/3961
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
8 years agotest: fix cluster-worker-isdead
Santiago Gimeno [Sat, 21 Nov 2015 14:33:51 +0000 (15:33 +0100)]
test: fix cluster-worker-isdead

Check if the worker 'isDead' instead of 'isConnected' as the
'disconnect' event is not guaranteed to be received before the
'exit' event.
Remove the 'net' dependency as it is not used.

PR-URL: https://github.com/nodejs/node/pull/3954
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
8 years agodoc: add HTTP working group
James M Snell [Thu, 19 Nov 2015 16:42:59 +0000 (08:42 -0800)]
doc: add HTTP working group

Charter for the HTTP Working Group

PR-URL: https://github.com/nodejs/node/pull/3919
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
8 years agodoc: update WORKING_GROUPS.md - add missing groups
Michael Dawson [Tue, 20 Oct 2015 15:39:29 +0000 (11:39 -0400)]
doc: update WORKING_GROUPS.md - add missing groups

Add Benchmarking and Post-Mortem workgroups as they
were missing.

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
PR-URL: https://github.com/nodejs/node/pull/3450

8 years agotest: add test for repl.defineCommand()
Bryan English [Thu, 19 Nov 2015 01:42:05 +0000 (17:42 -0800)]
test: add test for repl.defineCommand()

It also tests displayPrompt by checking for '> '.

PR-URL: https://github.com/nodejs/node/pull/3908
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodoc: fix the exception description
yorkie [Wed, 4 Nov 2015 08:17:21 +0000 (16:17 +0800)]
doc: fix the exception description

A value shouldn't be described as doing inherit from some class, more
strictly, the value is an instance of the class `Error`.

PR-URL: https://github.com/nodejs/node/pull/3658
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Stephan Belanger <admin@stephenbelanger.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
8 years agoconfigure: use __ARM_ARCH to determine arm version
João Reis [Wed, 2 Dec 2015 02:37:08 +0000 (02:37 +0000)]
configure: use __ARM_ARCH to determine arm version

Before this change, configure used processor specific macro defines
(like __ARM_ARCH_6M__) to detect the arm processor version. This
changes configure to use __ARM_ARCH, that should be defined to the
correct version.

Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/node/pull/4123

8 years agoconfigure: respect CC_host in host arch detection
João Reis [Wed, 2 Dec 2015 04:54:02 +0000 (04:54 +0000)]
configure: respect CC_host in host arch detection

When cross compiling, GYP uses the variables CC_host and CXX_host to
find the host compiler, if they are defined. This ensures that
variable is used, if defined, when detecting the host architecture.

Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/4117

8 years agodoc: clarify v4.2.3 notable items
Rod Vagg [Fri, 4 Dec 2015 11:12:59 +0000 (22:12 +1100)]
doc: clarify v4.2.3 notable items

* Include reference to CVE-2015-8027
* Fix "socket may no longer have a socket" reference
* Expand on non-existent parser causing the error
* Soften language for CVE-2015-3193 as impact may not be as great as
  expected
* Clarify that CVE-2015-3194 affects TLS servers using _client
  certificate authentication_
* Include reference to CVE-2015-6764
* Remove links to nodejs/node-private in commits list

PR-URL: https://github.com/nodejs/node/pull/4155
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agodeps: Updated node LICENSE file with new npm license
Kat Marchán [Wed, 2 Dec 2015 18:50:51 +0000 (10:50 -0800)]
deps: Updated node LICENSE file with new npm license

PR-URL: https://github.com/nodejs/node/pull/4110
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: mark test flaky on FreeBSD
Rich Trott [Wed, 25 Nov 2015 06:12:36 +0000 (22:12 -0800)]
test: mark test flaky on FreeBSD

Mark test-net-socket-local-address flaky on FreeBSD. It times out with
some frequency on CI.

Ref: https://github.com/nodejs/node/issues/2475
PR-URL: https://github.com/nodejs/node/pull/4016
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
8 years agotest: mark cluster-net-send test flaky on windows
Rich Trott [Tue, 24 Nov 2015 16:31:11 +0000 (08:31 -0800)]
test: mark cluster-net-send test flaky on windows

See https://github.com/nodejs/node/issues/3957 for details and examples
failures.

Ref: https://github.com/nodejs/node/issues/3957
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/node/pull/4006

8 years agotest: remove flaky designation from ls-no-sslv3
Rich Trott [Sun, 1 Nov 2015 01:53:21 +0000 (18:53 -0700)]
test: remove flaky designation from ls-no-sslv3

This test was marked flaky after failing in CI on arm7-wheezy two months
ago. It has not failed there since. This commit removes the flaky
designation.

Fixes: https://github.com/nodejs/node/issues/2554
PR-URL: https://github.com/nodejs/node/pull/3620
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agodoc: fix color of linked code blocks
jpersson [Sun, 29 Nov 2015 17:51:24 +0000 (12:51 -0500)]
doc: fix color of linked code blocks

Links nested in backticks were not visually distinguishable before, this
fixes them.

PR-URL: https://github.com/nodejs/node/pull/4068
Reviewed-By: Roman Reiss <me@silverwind.io>
8 years agotest: mark fork regression test flaky on windows
Rich Trott [Wed, 25 Nov 2015 17:47:41 +0000 (09:47 -0800)]
test: mark fork regression test flaky on windows

See https://github.com/nodejs/node/issues/3635 for details and failure
examples.

Ref: https://github.com/nodejs/node/issues/3635
PR-URL: https://github.com/nodejs/node/pull/4005
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodoc: fix typo in README
Rich Trott [Tue, 24 Nov 2015 06:32:09 +0000 (22:32 -0800)]
doc: fix typo in README

PR-URL: https://github.com/nodejs/node/pull/4000
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
8 years agodoc: message.header duplication correction
Bryan English [Tue, 24 Nov 2015 02:27:54 +0000 (18:27 -0800)]
doc: message.header duplication correction

The old version of the text here was slightly incorrect, so it
just defers the details to the section in which they're fully
described.

PR-URL: https://github.com/nodejs/node/pull/3997
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
8 years agotest: skip test if in FreeBSD jail
Rich Trott [Tue, 24 Nov 2015 00:01:35 +0000 (16:01 -0800)]
test: skip test if in FreeBSD jail

Test test-net-socket-local-address is flaky in FreeBSD jail but robust
otherwise.

Fixes: https://github.com/nodejs/node/issues/2475
PR-URL: https://github.com/nodejs/node/pull/3995
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agotest: fix test-domain-exit-dispose-again
Julien Gilli [Mon, 23 Nov 2015 21:13:40 +0000 (13:13 -0800)]
test: fix test-domain-exit-dispose-again

test-domain-exit-dispose-again had been written for node v0.10.x, and
was using the fact that callbacks scheduled with `process.nextTick`
wouldn't run if the domain attached to it was disposed.

This is not longer the case, and as a result the test would not catch
any regression: it would always pass.

This change rewrites that test to check that the current domain is
cleared properly when processing the rest of the timers list if a
timer's callback throws an error. This makes the test fail without the
original fix, and pass with the original fix, as expected.

PR: #3990
PR-URL: https://github.com/nodejs/node/pull/3990
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agodoc: replace sane with reasonable
Lewis Cowper [Mon, 23 Nov 2015 09:06:53 +0000 (10:06 +0100)]
doc: replace sane with reasonable

Removing ableist language because we don't need to make the comparison
to people with mental health issues to get our point across.

PR-URL: https://github.com/nodejs/node/pull/3980
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agotest: remove flaky status for cluster test
Rich Trott [Mon, 23 Nov 2015 03:29:14 +0000 (19:29 -0800)]
test: remove flaky status for cluster test

The test did not fail after 9999 runs in continuous integration.

Remove it's flaky status.

Fixes: https://github.com/nodejs/node/issues/2557
PR-URL: https://github.com/nodejs/node/pull/3975
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
8 years agotest: address flaky test-http-client-timeout-event
Rich Trott [Sun, 22 Nov 2015 04:10:52 +0000 (20:10 -0800)]
test: address flaky test-http-client-timeout-event

Use common.platformTimeout() to make test more reliable on Raspberry Pi.

Fixes: https://github.com/nodejs/node/issues/2555
PR-URL: https://github.com/nodejs/node/pull/3968

Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
8 years agodoc: fix rare case of misaligned columns
Roman Reiss [Sat, 21 Nov 2015 00:19:04 +0000 (01:19 +0100)]
doc: fix rare case of misaligned columns

By using the same unit for the offset of the main column as used for the
left column width, we ensure that browsers render the columns
conistently.

Ref: https://github.com/nodejs/help/issues/32

PR-URL: https://github.com/nodejs/node/pull/3948
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
8 years agonet: add local address/port for better errors
Jan Schär [Fri, 20 Nov 2015 21:16:55 +0000 (22:16 +0100)]
net: add local address/port for better errors

Adds localAddress and localPort to req so we have better error messages.
Also fixes a case where ex is used before it is declared.

PR-URL: https://github.com/nodejs/node/pull/3946
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
8 years agodoc: fix broken references
Alexander Gromnitsky [Fri, 20 Nov 2015 19:28:11 +0000 (21:28 +0200)]
doc: fix broken references

PR-URL: https://github.com/nodejs/node/pull/3944
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Myles Borins <mborins@us.ibm.com>
8 years agotest: retry on smartos if ECONNREFUSED
Rich Trott [Fri, 20 Nov 2015 18:15:31 +0000 (10:15 -0800)]
test: retry on smartos if ECONNREFUSED

SmartOS has a bug that causes unexpected ECONNREFUSED errors.

See https://smartos.org/bugview/OS-2767

If ECONNREFUSED on SmartOS, retry the test one time.

Fixes: https://github.com/nodejs/node/issues/3864
Fixes: https://github.com/nodejs/node/issues/2815
PR-URL: https://github.com/nodejs/node/pull/3941
Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 years agodoc: add reference for buffer.inspect()
cjihrig [Thu, 19 Nov 2015 17:16:29 +0000 (12:16 -0500)]
doc: add reference for buffer.inspect()

This commit refers readers to util.inspect() for an explanation
of buffer.inspect().

Fixes: https://github.com/nodejs/node/issues/3918
PR-URL: https://github.com/nodejs/node/pull/3921
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
8 years agodoc: clarify module loading behavior
cjihrig [Thu, 19 Nov 2015 17:05:47 +0000 (12:05 -0500)]
doc: clarify module loading behavior

The module loading system will not append node_modules to a
path already ending in node_modules. This used to be documented,
but it was lost.

Fixes: https://github.com/nodejs/node/issues/3873
PR-URL: https://github.com/nodejs/node/pull/3920
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
8 years agotest: avoid test timeouts on rpi
Stefan Budeanu [Wed, 18 Nov 2015 16:40:32 +0000 (11:40 -0500)]
test: avoid test timeouts on rpi

Generating 1024-bit primes on rpi test machines sometimes
causes timeouts. Avoid this situation by using 256-bit
primes when not running in FIPS mode.

PR-URL: https://github.com/nodejs/node/pull/3902
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
8 years agotest: fix flaky test-child-process-spawnsync-input
Rich Trott [Tue, 17 Nov 2015 05:42:47 +0000 (21:42 -0800)]
test: fix flaky test-child-process-spawnsync-input

Move portion of `test-child-process-spawnsync-input.js` (that has been
flaky on CentOS in CI) to its own file. This allows us to more easily
eliminate the cause of the flakiness without affecting other unrelated
portions of the test.

Fixes: https://github.com/nodejs/node/issues/3863
PR-URL: https://github.com/nodejs/node/pull/3889
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: move test-specific function out of common
Rich Trott [Tue, 17 Nov 2015 05:17:16 +0000 (21:17 -0800)]
test: move test-specific function out of common

common.checkSpawnSyncRet is only used in one test. Move it out of
common.js and into that test (test-child-process-spawnsync-input.js).

PR-URL: https://github.com/nodejs/node/pull/3871
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agomodule: cache regular expressions
Evan Lucas [Tue, 17 Nov 2015 00:50:14 +0000 (18:50 -0600)]
module: cache regular expressions

None of these regular expressions will change, so there is no need to
generate them every time in hot code paths.

Provides a small performance improvement in module loading. (5-10%)

PR-URL: https://github.com/nodejs/node/pull/3869
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: module loading error fix solaris #3798
fansworld-claudio [Mon, 16 Nov 2015 13:59:39 +0000 (10:59 -0300)]
test: module loading error fix solaris #3798

- refactor test to accept multiple error messages per platform
- add new message to be found in Solaris 11.3 as per #3798

PR-URL: https://github.com/nodejs/node/pull/3855
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
8 years agotest: skip test if FreeBSD jail will break it
Rich Trott [Sun, 15 Nov 2015 22:41:19 +0000 (14:41 -0800)]
test: skip test if FreeBSD jail will break it

`test/internet/test-dgram-broadcast-multi-process.js` fails if it is in
a FreeBSD jail. This issue is with the way FreeBSD jails work and not
with Node. Skip the test if in a FreeBSD jail.

PR-URL: https://github.com/nodejs/node/pull/3839
Fixes: https://github.com/nodejs/node/issues/2472
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
8 years agotest: fix flaky SmartOS test
Rich Trott [Sun, 15 Nov 2015 04:43:27 +0000 (20:43 -0800)]
test: fix flaky SmartOS test

SmartOS has an issue where it will trigger ECONNREFUSED when it should
not. See https://smartos.org/bugview/OS-2767.

This change adds logic to test-net-server-max-connections.js to work
around the issue.

Fixes: https://github.com/nodejs/node/issues/2663
PR-URL: https://github.com/nodejs/node/pull/3830
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: run pipeline flood test in parallel
Rich Trott [Fri, 13 Nov 2015 13:34:57 +0000 (05:34 -0800)]
test: run pipeline flood test in parallel

PR-URL: https://github.com/nodejs/node/pull/3811
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agobuild: fix --with-intl=system-icu for x-compile
Steven R. Loomis [Fri, 13 Nov 2015 02:10:26 +0000 (18:10 -0800)]
build: fix --with-intl=system-icu for x-compile

* add toolset stuff to icu-system.gyp
* update docs

Fixes: https://github.com/nodejs/node/issues/3801
PR-URL: https://github.com/nodejs/node/pull/3808
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agoquerystring: Parse multiple separator characters
Yosuke Furukawa [Thu, 12 Nov 2015 17:43:48 +0000 (02:43 +0900)]
querystring: Parse multiple separator characters

Fix querystring.parse to handle multiple separator characters

PR-URL: https://github.com/nodejs/node/pull/3807
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agochild_process: add safety checks on stdio access
cjihrig [Thu, 12 Nov 2015 19:30:20 +0000 (14:30 -0500)]
child_process: add safety checks on stdio access

When a child process is spawned, there is no guarantee that stdout
and stderr will be created successfully. This commit adds checks
before attempting to access the streams.

PR-URL: https://github.com/nodejs/node/pull/3799
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agobuffer: let WriteFloatGeneric silently drop values
P.S.V.R [Mon, 16 Nov 2015 02:59:07 +0000 (10:59 +0800)]
buffer: let WriteFloatGeneric silently drop values

Documentation currently states that setting noAssert and passing a value
larger than can fit in the Buffer will cause data to be silently
dropped. Change implementation to match documented behavior.

Fixes: https://github.com/nodejs/node/issues/3766
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
8 years agotest: skip/replace weak crypto tests in FIPS mode
Stefan Budeanu [Tue, 10 Nov 2015 19:56:52 +0000 (14:56 -0500)]
test: skip/replace weak crypto tests in FIPS mode

FIPS 140-2 does not permit the use of MD5 and RC4, skip or tests
that use them, or substitute with stronger crypto where applicable.

PR-URL: https://github.com/nodejs/node/pull/3757
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: James Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
8 years agotest: stronger crypto in test fixtures
Stefan Budeanu [Tue, 10 Nov 2015 21:56:18 +0000 (16:56 -0500)]
test: stronger crypto in test fixtures

Several test fixtures use use weak crypto (e.g. RC4 or MD5).
Rgenerated the test fixtures to be compatible with FIPS mode.

PR-URL: https://github.com/nodejs/node/pull/3759
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
8 years agotest: increase crypto strength for FIPS standard
Stefan Budeanu [Tue, 10 Nov 2015 21:33:25 +0000 (16:33 -0500)]
test: increase crypto strength for FIPS standard

Use stronger crypto (larger keys, etc.) for arbitrary tests so
they will pass in both FIPS and non-FIPS mode without altering
the original intent of the test cases.

PR-URL: https://github.com/nodejs/node/pull/3758
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: add hasFipsCrypto to test/common.js
Stefan Budeanu [Thu, 12 Nov 2015 22:28:04 +0000 (17:28 -0500)]
test: add hasFipsCrypto to test/common.js

Utility function for tests to check if OpenSSL is using
a FIPS verified cryptographic provider.

PR-URL: https://github.com/nodejs/node/pull/3756
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotest: add test for invalid DSA key size
Stefan Budeanu [Fri, 13 Nov 2015 01:49:21 +0000 (20:49 -0500)]
test: add test for invalid DSA key size

Check that invalid DSA key sizes are rejected in FIPS mode.

PR-URL: https://github.com/nodejs/node/pull/3756
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agocrypto: DSA parameter validation in FIPS mode
Stefan Budeanu [Tue, 10 Nov 2015 16:50:32 +0000 (11:50 -0500)]
crypto: DSA parameter validation in FIPS mode

FIPS 180-4 requires specific (L,N) values. OpenSSL will crash if an
invalid combination is used, so we must check the input sanity first.

PR-URL: https://github.com/nodejs/node/pull/3756
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: James M Snell <jasnell@gmail.com>
8 years agotls: Use SHA1 for sessionIdContext in FIPS mode
Stefan Budeanu [Mon, 9 Nov 2015 23:19:11 +0000 (18:19 -0500)]
tls: Use SHA1 for sessionIdContext in FIPS mode

FIPS 140-2 disallows use of MD5, which is used to derive the
default sessionIdContext for tls.createServer().

PR-URL: https://github.com/nodejs/node/pull/3755
Reviewed-By: Fedor Indutny <fedor@indutny.com>