0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

4369 Commits

Author SHA1 Message Date
cjihrig
0593528241 src: remove unused variable in node_crypto
env was unused since the ref'd commit

Ref: e34ee1d2c9
PR-URL: https://github.com/nodejs/node/pull/11361
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-02-15 10:41:08 -08:00
Ben Noordhuis
b738cbcdd3 src: remove unused typedef
Seems to have been overlooked in commit dd93c53 ("Make node::DLOpen use
uv_dlopen") from 2011.

PR-URL: https://github.com/nodejs/node/pull/11322
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-02-14 19:31:21 +01:00
cjihrig
784eb2fd65 child_process: exit spawnSync with null on signal
This commit sets the spawnSync() exit code to null when the
child is killed via signal. This brings the behavior more in
sync with spawn().

Fixes: https://github.com/nodejs/node/issues/11284
PR-URL: https://github.com/nodejs/node/pull/11288
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2017-02-14 11:44:24 -05:00
David Benjamin
e34ee1d2c9 crypto: remove unused access of tlsext_hostname
The return value of loadSession is ultimately ignored, so don't fill it
in. This inches Node closer to 1.1.0 compatibility and is less code.

Also remove a comment which appears to have long since become invalid.
It dates to 048e0e77e0 when the SNI value
was actually extracted from the session.

This also fixes a segfault should d2i_SSL_SESSION fail to parse the
input and return NULL. Add a test for this case based on
test-tls-session-cache.js.

PR-URL: https://github.com/nodejs/node/pull/10882
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-02-13 13:56:46 -08:00
Ben Noordhuis
c30fc8d495 src: support UTF-8 in compiled-in JS source files
Detect it when source files in lib/ are not ASCII.  Decode them as UTF-8
and store them as UTF-16 in the binary so they can be used as external
string resources without non-ASCII characters getting mangled.

Fixes: https://github.com/nodejs/node/issues/10673
PR-URL: https://github.com/nodejs/node/pull/11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-13 19:16:14 +01:00
Franziska Hinkelmann
02371985f1 src: fix delete operator on vm context
In the implementation of the vm module,
if a property is successfully deleted
on the sandbox, we also need to delete it
on the global_proxy object. Therefore, we
must not call args.GetReturnValue().Set().

We only intercept, i.e., call
args.GetReturnValue().Set(), in the
DeleterCallback, if Delete() failed, e.g. because
the property was read only.

PR-URL: https://github.com/nodejs/node/pull/11266
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-02-11 09:01:15 -08:00
Ben Noordhuis
291b599bba src: fix --icu-data-dir= regression
Commit a8734af ("src: make copies of startup environment variables")
from two weeks ago introduced a regression in the capturing of the
`--icu-data-dir=` switch: it captured the string up to the `=` instead
of what comes after it.

PR-URL: https://github.com/nodejs/node/pull/11255
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-02-11 15:24:30 +01:00
Ben Noordhuis
46345b9374 src: make --icu-data-dir= switch testable
Move some code around so we can properly test whether the switch
actually does anything.

PR-URL: https://github.com/nodejs/node/pull/11255
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-02-11 15:23:51 +01:00
Sam Roberts
59afa275ad crypto: support OPENSSL_CONF again
A side-effect of https://github.com/nodejs/node-private/pull/82
was to remove support for OPENSSL_CONF, as well as removing the default
read of a configuration file on startup.

Partly revert this, allowing OPENSSL_CONF to be used to specify a
configuration file to read on startup, but do not read a file by
default.

If the --openssl-config command line option is provided, its value is
used, not the OPENSSL_CONF environment variable.

Fix: https://github.com/nodejs/node/issues/10938
PR-URL: https://github.com/nodejs/node/pull/11006
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-02-09 12:26:39 -08:00
Sam Roberts
901e926d43 src: add SafeGetenv() to internal API
Allow it to be used anywhere in src/ that env variables with security
implications are accessed.
2017-02-09 12:19:14 -08:00
Ben Noordhuis
6af0bfe1a0 src: fix -Wunused-result compiler warning
Fix a warning that was introduced in commit 67af1ad ("src: refactor
CopyProperties to remove JS") from a few days ago.  This particular
change was suggested by me, mea culpa.

Fixes the following warning:

    ../src/node_contextify.cc:151:13: warning: ignoring return
    value of function declared with warn_unused_result attribute
    [-Wunused-result]
                sandbox_obj->DefineProperty(context, key, *desc);

PR-URL: https://github.com/nodejs/node/pull/11197
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-02-09 14:56:30 +01:00
Ben Noordhuis
a8734af442 src: make copies of startup environment variables
Mutations of the environment can invalidate pointers to environment
variables, so make `secure_getenv()` copy them out instead of returning
pointers.

PR-URL: https://github.com/nodejs/node/pull/11051
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-02-08 06:23:19 -08:00
Kirill Fomichev
e90f38270c
crypto: throw error in CipherBase::SetAutoPadding
Throw error after calling CipherBase#final

PR-URL: https://github.com/nodejs/node/pull/9405
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-02-07 13:07:55 +01:00
AnnaMag
67af1ad671 src: refactor CopyProperties to remove JS
CopyProperties() is refactored to use
the V8 5.5 DefineProperty() API call.
The change does not alter current behaviour.
It is a step prior to removing the function
CopyProperties, which becomes reduntant
after fixes of V8 SetNamedPropertyHandler
in 5.5. V8.

Strings used as property attributes
(value, enumerable etc) and accessors
are defined as persistent strings
in src/env.h

PR-URL: https://github.com/nodejs/node/pull/11102
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-05 09:59:51 +01:00
Franziska Hinkelmann
e116cbe320 src: don't overwrite non-writable vm globals
Check that the property doesn't have the read-only flag set before
overwriting it.

This is Ben Noordhuis previous commit, but keeping
is_contextual_store. is_contextual_store describes whether
this.foo = 42 or foo = 42 was called. The second is contextual
and will fail in strict mode if foo is used without
declaration. Therefore only do an early return if it is
a contextual store. In particular, don't do an early
return for Object.defineProperty(this, ...).

Fixes: https://github.com/nodejs/node/issues/10223
Refs: https://github.com/nodejs/node/pull/10227
PR-URL: https://github.com/nodejs/node/pull/11109
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-02-04 12:23:43 +01:00
Myk Melez
046f66a554 src: fix building --without-v8-plartform
* declare v8_platform.platform_ unconditionally

  v8_platform.platform_ is referenced by node::Start
  without regard to the value of NODE_USE_V8_PLATFORM,
  so it should be declared unconditionally, otherwise
  Node fails to compile when !NODE_USE_V8_PLATFORM.

* update v8_platform.StartInspector signature

  The call signature of v8_platform.StartInspector needs
  to be the same whether or not NODE_USE_V8_PLATFORM,
  otherwise Node will fail to compile if HAVE_INSPECTOR
  and !NODE_USE_V8_PLATFORM.

* don't call tracing_agent->Start w/nullptr

  node::tracing::Agent::Start can't accept a nullptr
  argument to its platform parameter, so don't call it
  when Node is compiled with NODE_USE_V8_PLATFORM=0.

* refactor tracing_agent into v8_platform

  Move tracing_agent global into the v8_platform struct,
  renaming it to tracing_agent_; CHECK(tracing_agent_ ==
  nullptr) in StartTracingAgent() to detect double calls;
  and relace another tracing_agent->Stop() call with a call
  to StopTracingAgent().

PR-URL: https://github.com/nodejs/node/pull/11088
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-02-03 14:49:23 -08:00
Shigeki Ohtsu
d4464241d7 crypto: Remove expired certs from CNNIC whitelist
CNNIC Whitelist was updated with removing expired certificates.

Fixes: https://github.com/nodejs/node/pull/1895
PR-URL: https://github.com/nodejs/node/pull/9469
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-02-04 00:20:10 +09:00
Shigeki Ohtsu
89217d1450 crypto: add cert check issued by StartCom/WoSign
When tls client connects to the server with certification issued by
either StartCom or WoSign listed in StartComAndWoSignData.inc, check
notBefore of the server certificate and CERT_REVOKED error returns if
it is after 00:00:00 on October 21, 2016.

See for details in
https://blog.mozilla.org/security/2016/10/24/distrusting-new-wosign-and-startcom-certificates/,
https://security.googleblog.com/2016/10/distrusting-wosign-and-startcom.html
and
https://support.apple.com/en-us/HT204132

Fixes: https://github.com/nodejs/node/issues/9434
PR-URL: https://github.com/nodejs/node/pull/9469
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-02-04 00:19:59 +09:00
Timothy Gu
c7e1be8991 src: remove usage of V8 deprecated API in node_url.cc
Also:

- Avoid using 'override' as variable name
- Use explicit static_cast instead of C-style cast

PR-URL: https://github.com/nodejs/node/pull/11066
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-01-31 23:55:38 -08:00
James M Snell
03e89b3ff2 process: add --redirect-warnings command line argument
The --redirect-warnings command line argument allows process warnings
to be written to a specified file rather than printed to stderr.

Also adds an equivalent NODE_REDIRECT_WARNINGS environment variable.

If the specified file cannot be opened or written to for any reason,
the argument is ignored and the warning is printed to stderr.

If the file already exists, it will be appended to.

PR-URL: https://github.com/nodejs/node/pull/10116
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-30 11:11:47 -08:00
Anna Henningsen
0d290a2ae0 src: fix v8 local handling in node_url.cc
Calling `.As<Object>()` on a non-object aborts in debug mode,
but `node_url.cc` relied on it. Address that by using `Local<Value>`
until it has been confirmed that the handle actually is an object.

PR-URL: https://github.com/nodejs/node/pull/11064
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-30 09:39:16 -08:00
Aashil Patel
5d27cc1d0d src: fix the misalinged text on "node --help"
The alignment of the argument descriptions in the "node --help"
text is off. This commit fixes the issue by adding two spaces
before each of the argument description.

PR-URL: https://github.com/nodejs/node/pull/10948
Fixes: https://github.com/nodejs/node/issues/10935
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
2017-01-27 16:31:55 -08:00
Michaël Zasso
91ab09fe2a src: update NODE_MODULE_VERSION to 52
V8 5.5 is not API/ABI compatible with 5.4.
This commit increments NODE_MODULE_VERSION by one.

Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md
PR-URL: https://github.com/nodejs/node/pull/9618
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-01-26 22:46:18 +01:00
Ben Noordhuis
bfd3c7e626 src: move trace_event.h include to internal header
Move the include from src/node.h to src/node_internals.h.

trace_event.h is not shipped in binary-only and headers-only tarballs,
making it currently impossible to build add-ons against them.

PR-URL: https://github.com/nodejs/node/pull/10959
Refs: https://github.com/nodejs/citgm/pull/226#issuecomment-274066280
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2017-01-26 01:48:25 +01:00
Anna Henningsen
3e851cf18b
Revert "src: don't overwrite non-writable vm globals"
This reverts commit 524f693872.

Fixes: https://github.com/nodejs/node/issues/10806
Fixes: https://github.com/nodejs/node/issues/10492
Ref: https://github.com/nodejs/node/pull/10227
PR-URL: https://github.com/nodejs/node/pull/10920
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-01-25 15:43:51 -08:00
John Barboza
0a9f360c98
src: support "--" after "-e" as end-of-options
When the double dash "--" appears after "-e <script>" on the
command line, it indicates the end of options and the beginning
of positional parameters for the script.

PR-URL: https://github.com/nodejs/node/pull/10651
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-25 00:24:40 +01:00
Travis Meisenheimer
5ea98fb17d crypto: return the retval of HMAC_Update
Fixes coverity scan issue 55489.

PR-URL: https://github.com/nodejs/node/pull/10891
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-01-24 14:26:22 -08:00
Adam Majer
33012e9866 crypto: ability to select cert store at runtime
PR-URL: https://github.com/nodejs/node/pull/8334
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-24 13:45:23 -08:00
Adam Majer
3aa17e4e51 crypto: Use system CAs instead of using bundled ones
NodeJS can already use an external, shared OpenSSL library. This
library knows where to look for OS managed certificates. Allow
a compile-time option to use this CA store by default instead of
using bundled certificates.

In case when using bundled OpenSSL, the paths are also valid for
majority of Linux systems without additional intervention. If
this is not set, we can use SSL_CERT_DIR to point it to correct
location.

Fixes: https://github.com/nodejs/node/issues/3159
PR-URL: https://github.com/nodejs/node/pull/8334
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-24 13:45:07 -08:00
Adam Majer
3ada5ae641 crypto: do not use pointers to std::vector
The pointer to std::vector is unnecessary, so replace it with standard
instance. Also, make the for() loop more readable by using actual type
instead of inferred - there is no readability benefit here from
obfuscating the type.

PR-URL: https://github.com/nodejs/node/pull/8334
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-24 13:44:50 -08:00
Daniel Bevenius
00679c3779 src: remove unnecessary req_wrap_obj
The req_wrap_obj is only used in one place which is setting up the
arguments for the MakeCallback call. Removing it to simplify the code
somewhat.

PR-URL: https://github.com/nodejs/node/pull/10942
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-01-23 09:36:10 -08:00
Alexey Orlenko
c8c79b937f src: add a missing space in node_os.cc
This commit makes a small stylistic fix adding a missing space in
GetOSType function in node_os.cc

PR-URL: https://github.com/nodejs/node/pull/10931
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-23 09:33:31 -08:00
cjihrig
f69e59daae src: add NODE_NO_WARNINGS to --help output
This commit adds a description of the NODE_NO_WARNINGS
environment variable to the --help output. This was overlooked
in 49902124a9.

Refs: https://github.com/nodejs/node/pull/10842
PR-URL: https://github.com/nodejs/node/pull/10918
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-23 11:32:25 -05:00
Joyee Cheung
a647d82f83 process: improve process.hrtime
* Add benchmarks for diffing a previous result
* Improvements to the documentation, including type annotation
* Update the outdated comments in src/node.cc, improve comments
  in lib/internal/process.js
* Check the argument is an Array Tuple with length 2

PR-URL: https://github.com/nodejs/node/pull/10764
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-01-23 21:30:18 +08:00
Adam Langley
a57e2f2138 crypto: freelist_max_len is gone in OpenSSL 1.1.0
The freelist_max_len member of SSL* (and the freelist itself) has been
removed in OpenSSL 1.1.0. Thus this change will be necessary at some
point but, for now, it makes it a little easier to build with 1.1.0
without breaking anything for previous versions of OpenSSL.

PR-URL: https://github.com/nodejs/node/pull/10859
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
2017-01-23 15:17:07 +09:00
Birunthan Mohanathas
dcab88d529 url: add return value to ToUnicode/ToAscii stubs
This fixes compilation errors like:

  node\src\node_url.cc(134) : error C4716: 'node::url::ToUnicode': must
  return a value

PR-URL: https://github.com/nodejs/node/pull/10893
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-01-22 18:17:12 -08:00
Eugene Ostroukhov
ba776b3a56 inspector: no crash when WS server can't start
This change also changes error message to make it consistent with the
one printed by the debugger.

Fixes: https://github.com/nodejs/node/issues/10858
PR-URL: https://github.com/nodejs/node/pull/10878
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-20 09:10:37 -08:00
Eugene Ostroukhov
295bd11468 test: have inspector test pick an open port
This ensures that cctest can be ran concurrently with other instances of
cctest or while the node is ran with --inspect.

Ref: https://github.com/nodejs/node/issues/10858
PR-URL: https://github.com/nodejs/node/pull/10861
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-19 11:00:09 -08:00
cjihrig
8f3ff98f0e child_process: allow Infinity as maxBuffer value
Fixes: https://github.com/nodejs/node/pull/10767
PR-URL: https://github.com/nodejs/node/pull/10769
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-17 10:47:28 -05:00
Stewart X Addison
0f0f3d3330 build: don't squash signal handlers with --shared
An application using node built as a shared library may legitimately
implement its own signal handling routines. Current behaviour is
to squash all signal handlers on node startup. This change will
stop that behaviour when node is built as a shared library.

PR-URL: https://github.com/nodejs/node/pull/10539
Fixes: https://github.com/nodejs/node/issues/10520
Refs: https://github.com/nodejs/node/pull/615
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-01-17 14:10:13 +00:00
Ben Noordhuis
77be180f49 src: remove unused PROTOCOL_JSON array
Overlooked when moving code around in commit 42da740 ("inspector: split
HTTP/WS server from the inspector".)

PR-URL: https://github.com/nodejs/node/pull/10407
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2017-01-16 06:47:16 +01:00
Alexey Orlenko
d85d120593 src: enable writev for pipe handles on Unix
This commit enables writev for Unix Domain Sockets on supported
platforms thus enabling cork/uncork functionality for them and
improving IPC performance.

Fixes: https://github.com/nodejs/node/issues/5095
PR-URL: https://github.com/nodejs/node/pull/10677
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-11 16:32:44 -08:00
Kirill Fomichev
1ef401ce92 crypto: use check macros in CipherBase::SetAuthTag
PR-URL: https://github.com/nodejs/node/pull/9395
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-10 17:32:51 -08:00
Jason Ginchereau
58c38c2d2e src: fix TracingController cleanup
This fixes an incorrect deletion of the `TracingController` instance,
which in some environments could cause an error about an invalid
pointer passed to `free()`. The `TracingController` instance is
actually owned by a `unique_ptr` member of the platform, so calling
`platform::SetTracingController(nullptr)` is the correct way to
delete it. But before that, the `TraceBuffer` must be deleted in
order for the tracing loop to exit; that is accomplished by calling
`TracingController::Initialize(nullptr)`.

PR-URL: https://github.com/nodejs/node/pull/10623
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-01-07 13:56:43 +01:00
Daniel Bevenius
6d3c5b78c8 src: reduce test_inspector_socket_server output
Currently, when test/cctest/test_inspector_socket_server.cc is run there
is output written to stderr by src/inspector_socket_server.cc which is
interleaved with the gtest report:

Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URLs in Chrome:
  ...

The goal of this commit is to remove the above logged information
by introducing an out_ member in the InspectorSocketServer class
which defaults to stderr (keeping the current behavior).

Setting out_ to NULL is supported in which case nothing will be written
and is what the test has been configured with. When working on specific
test case the appropriate output stream can be specified for the
ServerHolder constructor to limit logging to that test case.

PR-URL: https://github.com/nodejs/node/pull/10537
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-06 20:13:12 +01:00
Yann Pringault
334be0feba src: fix space for module version mismatch error
PR-URL: https://github.com/nodejs/node/pull/10606
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-01-06 10:14:07 -05:00
James M Snell
81228497c5 url: do not decode arbitrary %2e sequences in paths
Per a recent change to the URL spec, arbitrary %2e sequences
in URL paths that are not single or double dot segments are
not to be decoded.

Refs: https://github.com/whatwg/url/issues/87
Refs: https://github.com/whatwg/url/pull/156
Refs: d93247d5cb
Fixes: https://github.com/nodejs/node/issues/10598
PR-URL: https://github.com/nodejs/node/pull/10602
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-05 20:25:07 -08:00
Josh Gavant
6ff3b03240 src, inspector: add --inspect-brk option
add an --inspect-brk option which breaks on
first line of user script. same behavior as old
--debug-brk flag.

PR-URL: https://github.com/nodejs/node/pull/8979
Reviewed-By: Eugene Ostroukhov <eostroukhov@chromium.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@keybase.io>
2017-01-03 15:47:40 -08:00
Michaël Zasso
db18dd8356 url: improve spec compliance of WHATWG URL
This patch contains the following changes:

url: make IPv4 parser more spec compliant

* Return int64_t from ParseNumber to prevent overflow for valid big numbers
* Don't throw when there are more than 4 parts (it cannot be an IP
address)
* Correctly interpret the address and don't always throw when there are
numbers > 255

Ref: https://url.spec.whatwg.org/#concept-ipv4-parser
Fixes: https://github.com/nodejs/node/issues/10306

url: percent encode fragment to follow spec change

Ref: https://github.com/whatwg/url/issues/150
Ref: 373dbedbbf

url: fix URL#search setter

The check for empty string must be done before removing the leading '?'.

Ref: https://url.spec.whatwg.org/#dom-url-search

url: set port to null if an empty string is given

This is to follow a spec change.

Ref: https://github.com/whatwg/url/pull/113

url: fix parsing of paths with Windows drive letter

test: update WHATWG URL test fixtures

PR-URL: https://github.com/nodejs/node/pull/10317
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2017-01-01 10:52:35 +01:00
Sam Roberts
d9ac34cb79 crypto: use CHECK_NE instead of ABORT or abort
Use of abort() was added in 34febfbf4, and changed to ABORT()
in 21826ef21a, but conditional+ABORT() is better expressesed
using a CHECK_xxx() macro.

See: https://github.com/nodejs/node/pull/9409#discussion_r93575328

PR-URL: https://github.com/nodejs/node/pull/10413
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-12-29 13:32:43 -08:00