0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00
Commit Graph

12565 Commits

Author SHA1 Message Date
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
James M Snell
3f6b9214bd doc: address use of profanity in code of conduct
PR-URL: https://github.com/nodejs/node/pull/3827
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Julien Gilli <jgilli@fastmail.fm>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
2015-11-16 12:48:43 -08:00
Felix Böhm
a95eb5c671 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>
2015-11-16 10:05:24 -08:00
Bryan English
cd1123a0fb doc: consistent reference-style links
Moved all the URLs in API docs to the bottom of the files as
reference-style links.

PR-URL: https://github.com/nodejs/node/pull/3845
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-16 07:36:59 -08:00
Rich Trott
a2144fce35 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>
2015-11-16 07:03:09 -08:00
Markus Tzoe
e2eb33483d build: fix configuring with prebuilt libraries
Fix configure_library() to produce correct LDFLAGS when configuring with
prebuilt 3rd-party libraries (libuv, openssl, etc) using `pkg-config' or
`--shared-{LIBRARY}-includes=xxx --shared-{LIBRARY}-libpath=xxx'.

PR-URL: https://github.com/nodejs/node/pull/3135
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-16 12:17:45 +01:00
Minwoo Jung
9d0396cd63 util: use Object.create(null) for dictionary object
Fixes https://github.com/nodejs/node/issues/3788
`arrayToHash()` needs to use `Object.create(null)` for its dictionary object.

Refs: https://github.com/nodejs/node/pull/3791
PR-URL: https://github.com/nodejs/node/pull/3831
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-15 18:48:42 -08:00
Michael Cornacchia
c0bac95147 test: fix path to module for repl test on Windows
Use path join to construct the path instead of concatenating strings.
Replace backslash with double backslash so that they are escaped
correctly in the string passed to REPL.

PR-URL: https://github.com/nodejs/node/pull/3608
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-15 16:33:11 -08:00
Steven R. Loomis
84f09647d0 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>
2015-11-14 16:38:40 -08:00
Stefan Budeanu
11ad744a92 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>
2015-11-14 09:13:56 -08:00
Myles Borins
a49b3af00b test: add test-zlib-flush-drain
This test assures that if flush is called while the zlib object needs
to be drained that it will defer the callback until after the drain.

PR-URL: https://github.com/nodejs/node/pull/3534
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-14 08:11:44 -08:00
Craig Cavalier
1736ad8264 zlib: only apply drain listener if given callback
When stream.flush() is called without a callback, an empty listener is
being added. Since flush may be called multiple times to push SSE's
down to the client, multiple noop listeners are being added. This in
turn causes the memory leak detected message.

PR-URL: https://github.com/nodejs/node/pull/3534
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-14 08:11:28 -08:00
Myles Borins
fa27c5634b zlib: pass kind to recursive calls to flush
Bug spotted by @bnoordhuis while doing code review on #3534

Refs: https://github.com/nodejs/node/pull/3534#discussion_r43047477
PR-URL: https://github.com/nodejs/node/pull/3534
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-14 08:10:02 -08:00
Stefan Budeanu
8ac852fec0 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>
2015-11-14 07:53:42 -08:00
Stefan Budeanu
20cd932ce0 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>
2015-11-14 07:53:39 -08:00
Stefan Budeanu
4adaaa4897 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>
2015-11-14 07:53:35 -08:00
evan.lucas
70405d47c3 deps: backport bc2e393 from v8 upstream
Original commit message:

  [tools] Make gen-postmortem-metadata.py more reliable

  Instead of basing matches off of whitespace, walk the
  inheritance chain and include any classes that inherit
  from Object.

  R=machenbach@chromium.org,jkummerow@chromium.org
  NOTRY=true

  Review URL: https://codereview.chromium.org/1435643002

  Cr-Commit-Position: refs/heads/master@{#31964}

This adds some missing classes to postmortem info like
JSMap and JSSet.

PR-URL: https://github.com/nodejs/node/pull/3792
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-14 08:10:46 -06:00
Ben Noordhuis
34a35919e1 util: improve typed array formatting
Pretty-print typed arrays like regular arrays.  Speeds up formatting by
almost 300% because it no longer stringifies the array indices.

Pretty-print ArrayBuffer and DataView as well by including byteLength,
byteOffset and buffer properties in the stringified representation.

PR-URL: https://github.com/nodejs/node/pull/3793
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-11-14 13:32:14 +01:00
Imran Iqbal
8b57b31299 test: Fix test-cluster-worker-exit.js for AIX
test fails intermittently due to the assertion that the 'disconnect'
event should come before the 'exit' event. This is caused be the
non-deteministic behaviour of pollset_poll[1] on AIX
(see deps/uv/src/unix/aix.c). This API makes no garauntee for the order
in which file descriptors are returned. On linux epoll_wait[2] is used,
which also does not make a garauntee on order of file descriptors
returned. In the failing case we recieve our file descriptor with a
callback of uv__signal_event (which causes JavaScript to receive the
exit event) before our file descriptor with uv__stream_io as its
callback (which in turn causes JavaScript receive the disconnect event).
This change simply removes the assertion that the disconnect event
happens before exit event and processes the test regardless of which
event comes first.

[1] https://www-01.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.ai
x.basetrf1/pollset.htm
[2] http://linux.die.net/man/2/epoll_pwait

PR-URL: https://github.com/nodejs/node/pull/3666
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-13 21:01:18 -08:00
Rich Trott
3fea3cb627 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>
2015-11-13 20:45:08 -08:00
Jesse McCarthy
b445938a93 doc: add link to [customizing util.inspect colors].
PR-URL: https://github.com/nodejs/node/pull/3749
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-13 14:44:24 -08:00
Tom Gallacher
4270e7f0f7 doc: Updated streams simplified constructor API
The examples for implementing the simplified constructor API
was missing some details on its correct usages.

PR-URL: https://github.com/nodejs/node/pull/3602
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chris Dickinson <chris@neversaw.us>
2015-11-13 13:27:11 -08:00
Roman Klauke
406c596fbf 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>
2015-11-13 13:19:39 -08:00
Manuel B
3c56d5e9e3 doc: added what buf.copy returns
as of https://github.com/nodejs/node/blob/v5.x/src/node_buffer.cc#L555

buf.copy returns the number of bytes copied.

PR-URL: https://github.com/nodejs/node/pull/3555
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-13 13:15:37 -08:00
Tristian Flanagan
934149a808 doc: reword message.headers to indicate they are not read-only
message.headers states that the headers are read-only, when in fact they
are not. This change rewords the docs to a more appropriate description,
while not promoting this kind of behavior.

Fixes: #3146
PR-URL: https://github.com/nodejs/node/pull/3814
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-13 12:15:01 -08:00
Bryan English
4008961a07 doc: clarify duplicate header handling
This commit documents how duplicate HTTP headers are handled.

PR-URL: https://github.com/nodejs/node/pull/3810
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-11-13 13:25:39 -05:00
Stefan Budeanu
76f40f77f8 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>
2015-11-13 10:22:42 -08:00
Yosuke Furukawa
a776a86859 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>
2015-11-13 10:13:35 -08:00
Fedor Indutny
483a41c0ad tls: copy client CAs and cert store on CertCb
Copy client CA certs and cert store when asynchronously selecting
`SecureContext` during `SNICallback`. We already copy private key,
certificate, and certificate chain, but the client CA certs were
missing.

Fix: #2772
PR-URL: https://github.com/nodejs/node/pull/3537
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-13 12:48:19 -05:00
Vladimir Varankin
a5cce79ec3 console: delete timers that have ended
Currently, console timers that have been ended with timeEnd()
are not removed. This has the potential to leak memory. This
commit deletes ended timers from the containing Map.

PR-URL: https://github.com/nodejs/node/pull/3562
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-11-13 11:36:45 -05:00
Rich Trott
d9734b7cc9 test: refactor test-http-pipeline-flood
This extends fixes for test-https-pipeline-flood to hopefully fully
eliminate its flakiness on Windows in our continuous integration
process.

PR-URL: https://github.com/nodejs/node/pull/3636
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-13 05:16:21 -08:00