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

12595 Commits

Author SHA1 Message Date
Jan Schär
d7b199d9e3 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>
2015-11-24 16:00:51 -06:00
cjihrig
5169311bf9 util,src: allow lookup of hidden values
This commit adds an internal util method that makes hidden
values in the C++ layer visible in JS.

PR-URL: https://github.com/nodejs/node/pull/3988
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-24 15:49:50 -05:00
Rich Trott
658842280d 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>
2015-11-24 20:14:10 +01:00
Bryan English
6f87aa9a12 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>
2015-11-24 16:16:01 +01:00
Rich Trott
41519fd1a4 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>
2015-11-24 08:17:12 -08:00
Rich Trott
8d37bbe9e9 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>
2015-11-24 11:13:22 -05:00
Bryon Leung
2ccde01980 src: add BE support to StringBytes::Encode()
Versions of Node.js after v0.12 have relocated byte-swapping away from
the StringBytes::Encode function, thereby causing a nan test (which
accesses this function directly) to fail on big-endian machines.

This change re-introduces byte swapping in StringBytes::Encode,
done via a call to a function in util-inl. Another change in
NodeBuffer::StringSlice was necessary to avoid double byte swapping
in big-endian function calls to StringSlice.

PR-URL: https://github.com/nodejs/node/pull/3410
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-11-24 15:26:23 +01:00
Rich Trott
8bc8038687 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>
2015-11-23 12:21:10 -08:00
Rich Trott
487de19684 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>
2015-11-23 20:23:34 +01:00
Lewis Cowper
3becac2e60 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>
2015-11-23 14:47:55 +01:00
Tom Gallacher
d16def5326 doc: Adding best practises for crypto.pbkdf2
Added some information around usages of how to use iterations, how to
choose decent salts and updating the example to have a significant
work factor and to use sha512.

PR-URL: https://github.com/nodejs/node/pull/3290
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
2015-11-23 17:49:52 +09:00
Carl Lei
615fba3bcf doc: numeric flags to fs.open
This has been supperted for long but never tested nor documented.

PR-URL: https://github.com/nodejs/node/pull/3641
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-22 13:35:09 +01:00
Carl Lei
804cc7670d test: numeric flags to fs.open
This has been supperted for long but never tested nor documented.

PR-URL: https://github.com/nodejs/node/pull/3641
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-22 13:35:02 +01:00
Carl Lei
3f4409e571 doc: clarify that fs streams expect blocking fd
This clarifies that fs.createReadStream and fs.createWriteStream, when
passed a fd, expects the fd to be blocking, and suggests net.Socket as
an alternative.

PR-URL: https://github.com/nodejs/node/pull/3641
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-22 13:34:30 +01:00
Fedor Indutny
91ccbf0201 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>
2015-11-21 21:15:11 -05:00
Ben Noordhuis
c83d9b7065 crypto: update root certificates
Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl.

PR-URL: https://github.com/nodejs/node/pull/3951
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-21 21:33:30 +01:00
Ben Noordhuis
8c4deff55d tools: update certdata.txt
This is the latest certdata.txt from [0], last updated on 2015-11-13.

[0] https://hg.mozilla.org/mozilla-central/raw-file/64df3815df9c/security/nss/lib/ckfw/builtins/certdata.txt

PR-URL: https://github.com/nodejs/node/pull/3951
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-11-21 21:33:01 +01:00
yorkie
8b97249893 fs: fix the error report on fs.link(Sync)
As the Node.js documentation specified:

> fs.link(srcpath, dstpath, callback)

But when we run:

```js
> fs.link()
```

We will get the below:

```js
TypeError: dest path must be a string
    at TypeError (native)
    at Object.fs.link (fs.js:915:11)
    at repl:1:4
```

Just correct the message of relevant 2 errors in this PR :-)

PR-URL: https://github.com/nodejs/node/pull/3917
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-20 16:09:09 -08:00
Jan Schär
9472a0cfad 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>
2015-11-20 15:53:11 -08:00
Tristian Flanagan
dfee4e3712 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>
2015-11-20 16:26:24 -05:00
Alexander Gromnitsky
94c3507f5c 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>
2015-11-20 11:52:23 -08:00
Matt Loring
22478d3669 buffer: move checkFloat from lib into src
The type and range checks performed by this function can be done more
efficiently in native code.

PR-URL: https://github.com/nodejs/node/pull/3763
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-20 12:23:05 -07:00
Martin Forsberg
55b1eccae6 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>
2015-11-20 14:11:02 -05:00
Bryan English
174d4e484e test: http complete list of non-concat headers
The original test was only testing some of the headers that shouldn't be
concatenated as per lib/_http_incoming.js, so now the full list is
there.

'content-length` gives a parse error if you set it to a string, so the
test for that header uses numbers.

PR-URL: https://github.com/nodejs/node/pull/3930
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-20 12:42:03 -05:00
Stefan Budeanu
56a2b9a246 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>
2015-11-20 09:35:58 -08:00
Michael Cornacchia
6de82c69a0 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>
2015-11-20 12:29:30 -05:00
Minwoo Jung
d01eb6882f lib: add 'pid' prefix in internal/util
This PR improves `prefix` in `util` that we've agreed on
https://github.com/nodejs/node/pull/3833
(separate code for javascript to move the printing function
to C++ directly)

PR-URL: https://github.com/nodejs/node/pull/3878
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-20 09:24:53 -08:00
cjihrig
ca2e8b292f readline: deprecate undocumented exports
This commit moves several of readline's undocumented functions
into an internal module. Specifically, isFullWidthCodePoint,
stripVTControlCharacters, getStringWidth, and emitKeys are
moved to the internal module. The existing public exports
of the first three functions are given a deprecation notice.

Refs: https://github.com/nodejs/node/pull/3847
Fixes: https://github.com/nodejs/node/issues/3836
PR-URL: https://github.com/nodejs/node/pull/3862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2015-11-19 17:01:25 -05:00
Stefan Budeanu
e499ea849c 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>
2015-11-19 16:31:11 -05:00
cjihrig
5900d14966 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>
2015-11-19 13:12:00 -05:00
cjihrig
5f3ed61094 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>
2015-11-19 13:02:32 -05:00
Wyatt Preul
007cfea308 util: remove pump
Remove util.pump and associated tests

PR-URL: https://github.com/nodejs/node/pull/2531
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-18 14:28:35 -08:00
Wyatt Preul
a2c0aa84e0 tty: Remove deprecated setRawMode wrapper
PR-URL: https://github.com/nodejs/node/pull/2528
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-18 13:16:02 -08:00
Wyatt Preul
4cf19ad1bb util: Remove exec, has been deprecated for years
PR-URL: https://github.com/nodejs/node/pull/2530
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-18 13:04:16 -08:00
Stefan Budeanu
e4e5b13efd 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.

Fixes: https://github.com/nodejs/node/issues/3881
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>
2015-11-18 09:52:07 -08:00
Rich Trott
ac319c3547 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>
2015-11-18 07:58:17 -08:00
yorkie
72e3dd9f43 process: throw on non-function to nextTick()
This commit causes process.nextTick() to throw when its callback
argument is not a function.

PR-URL: https://github.com/nodejs/node/pull/3860
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-11-18 10:52:01 -05:00
Evan Lucas
339d3840c8 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>
2015-11-18 09:43:57 -06:00
fansworld-claudio
9a628e2dac 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>
2015-11-18 08:01:13 -06:00
Jeremiah Senkpiel
29cd1195ec 2015-11-17, Version 5.1.0 (Stable)
PR-URL: https://github.com/nodejs/node/pull/3736
2015-11-17 16:52:26 -05:00
Jackson Tian
b33e9da8f9 debugger: introduce exec method for debugger
In debugger, the usage of `repl` very ugly. I'd like there is a `p`
like gdb. So the `exec` is coming.

Usage:

```
$ ./iojs debug ~/git/node_research/server.js
< Debugger listening on port 5858
connecting to 127.0.0.1:5858 ... ok
break in /Users/jacksontian/git/node_research/server.js:1
> 1 var http = require('http');
  2
  3 http.createServer(function (req, res) {
debug> exec process.title
/Users/jacksontian/git/io.js/out/Release/iojs
debug>
```

And the `repl`:

```
debug> repl
Press Ctrl + C to leave debug repl
> process.title
'/Users/jacksontian/git/io.js/out/Release/iojs'
debug>
(^C again to quit)
```

The enter and leave debug repl is superfluous.

R-URL: https://github.com/nodejs/node/pull/1491
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-17 12:11:40 -08:00
Rod Vagg
8ceb36cb53 doc: document release types in readme
PR-URL: https://github.com/nodejs/node/pull/3482
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-11-17 22:09:25 +11:00
Rod Vagg
7ed09a36ec doc: replace head of readme with updated text
PR-URL: https://github.com/nodejs/node/pull/3482
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-11-17 22:08:53 +11:00
Evan Lucas
4fed62c876 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>
2015-11-16 23:02:36 -08:00
Tristian Flanagan
e3949b2ca1 doc: sort repl alphabetically
Reorders, with no contextual changes, the repl documentation with class
definitions at the top and alphabetically.

PR-URL: https://github.com/nodejs/node/pull/3859
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-16 22:45:53 -08:00
Rich Trott
b3857723d3 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>
2015-11-16 22:37:32 -08:00
P.S.V.R
0ed3a7c11b 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>
2015-11-16 21:27:21 -07:00
Stefan Budeanu
df268f97bc tls: use SHA1 for sessionIdContext
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/3866
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-16 17:26:23 -05:00
Stefan Budeanu
424ae5d4ac 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>
2015-11-16 16:47:00 -05:00
Rich Trott
5b80ca9339 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>
2015-11-16 13:25:26 -08:00