summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-06-02src: use stack-allocated Environment instancesBen Noordhuis
Makes it easier to reason about the lifetime of the Environment object. PR-URL: https://github.com/nodejs/node/pull/7090 Refs: https://github.com/nodejs/node/pull/7082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-06-02src: move env init logic into Environment classBen Noordhuis
PR-URL: https://github.com/nodejs/node/pull/7090 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-06-02lib,src: reset zero fill flag on exceptionBen Noordhuis
Exceptions thrown from the Uint8Array constructor would leave it disabled. Regression introduced in commit 27e84dd ("lib,src: clean up ArrayBufferAllocator") from two days ago. A follow-up commit will add a regression test. PR-URL: https://github.com/nodejs/node/pull/7093 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-06-02src: add linebreak to inspector messageNicolas Romer
Add linebreak to inspector ready message to wrap properly in 80 column (default) terminal windows. Fixes: https://github.com/nodejs/node/issues/7067 PR-URL: https://github.com/nodejs/node/pull/7070 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-06-01async_wrap: pass uid to JS as doubleTrevor Norris
Passing the uid via v8::Integer::New() converts it to a uint32_t. Which will trim the value early. Instead use v8::Number::New() to convert the int64_t to a double so that JS can see the full 2^53 range of uid's. PR-URL: https://github.com/nodejs/node/pull/7096 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2016-06-01src: fix --without-inspector buildAnna Henningsen
Use `HAVE_INSPECTOR` as the 0/1 boolean macro that it is, as opposed to a defined/not-defined boolean. PR-URL: https://github.com/nodejs/node/pull/7078 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2016-06-01lib,src: clean up ArrayBufferAllocatorBen Noordhuis
Remove the direct dependency on node::Environment (which is per-context) from node::ArrayBufferAllocator (which is per-isolate.) Contexts that want to toggle the zero fill flag, now do so through a field that is owned by ArrayBufferAllocator. Better, still not great. PR-URL: https://github.com/nodejs/node/pull/7082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-06-01lib,src: drop dependency on v8::Private::ForApi()Ben Noordhuis
Said function requires that a v8::Context has been entered first, introducing a chicken-and-egg problem when creating the first context. PR-URL: https://github.com/nodejs/node/pull/7082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-06-01src: make IsolateData creation explicitBen Noordhuis
Make it easier to reason about the lifetime and the ownership of the IsolateData instance by making its creation explicit and by removing reference counting logic. The creator of the Environment is now responsible for passing in the IsolateData instance and for keeping it alive as long as the Environment is alive. PR-URL: https://github.com/nodejs/node/pull/7082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-06-01src: move IsolateData out of EnvironmentBen Noordhuis
A follow-up commit is going to make IsolateData creation explicit. In order for that to work, it needs to move out of Environment. PR-URL: https://github.com/nodejs/node/pull/7082 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-05-30src,lib: v8-inspector supportPavel Feldman
This change introduces experimental v8-inspector support. This brings the DevTools debug protocol allowing Node.js to be debugged with Chrome DevTools native, or through other debuggers supporting that protocol. Partial WebSocket support, to the extent required by DevTools, is included. This is derived from the implementation in Blink. v8-inspector support can be disabled by the --without-inspector configure flag. PR-URL: https://github.com/nodejs/node/pull/6792 Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: addaleax - Anna Henningsen <anna@addaleax.net> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-05-26dgram: copy the list in sendMatteo Collina
This commit fix a possible crash situation in dgram send(). A crash is possible if an array is passed, and then altered after the send call, as the call to libuv is wrapped in process.nextTick(). It also avoid sending an empty array to libuv by allocating an empty buffer. It also does some cleanup inside send() to increase readability. It removes test flakyness by use common.mustCall and common.platformTimeout. Fixes situations were some events were not asserted to be emitted. Fixes: https://github.com/nodejs/node/issues/6616 PR-URL: https://github.com/nodejs/node/pull/6804 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-25src: add include guards to internal headersBen Noordhuis
For consistency with the newly added src/base64.h header, check that NODE_WANT_INTERNALS is defined and set in internal headers. PR-URL: https://github.com/nodejs/node/pull/6948 Refs: https://github.com/nodejs/node/pull/6910 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-05-24src: no abort from getter if object isn't wrappedTrevor Norris
v8::Object::GetAlignedPointerFromInternalField() returns a random value if Wrap() hasn't been run on the object handle. Causing v8 to abort if certain getters are accessed. It's possible to access these getters and functions during class construction through the AsyncWrap init() callback, and also possible in a subset of those scenarios while running the persistent handle visitor. Mitigate this issue by manually setting the internal aligned pointer field to nullptr in the BaseObject constructor and add necessary logic to return appropriate values when nullptr is encountered. PR-URL: https://github.com/nodejs/node/pull/6184 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-05-24stream_base: always use Base template classTrevor Norris
First cast the pointer to the child Base class before casting to the parent class to make sure it returns the correct pointer. PR-URL: https://github.com/nodejs/node/pull/6184 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-05-24tls_wrap: do not abort on new TLSWrap()Trevor Norris
Though the TLSWrap constructor is only called via TLSWrap::Wrap() (i.e. tls_wrap.wrap()) internally, it is still exposed to JS. Don't allow the application to abort by inspecting the instance before it has been wrap'd by another handle. PR-URL: https://github.com/nodejs/node/pull/6184 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-05-24src: always clear wrap before persistent Reset()Trevor Norris
In case the handle is stored and accessed after the associated C++ class was destructed, set the internal pointer to nullptr so any getters/setters can return accordingly without aborting the application. PR-URL: https://github.com/nodejs/node/pull/6184 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-05-24src: inherit first from AsyncWrapTrevor Norris
To make sure casting a class of multiple inheritance from a void* to AsyncWrap succeeds make AsyncWrap the first inherited class. PR-URL: https://github.com/nodejs/node/pull/6184 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-05-24vm: don't abort process when stack space runs outAnna Henningsen
Make less assumptions about what objects will be available when vm context creation or error message printing fail because V8 runs out of JS stack space. Ref: https://github.com/nodejs/node/issues/6899 PR-URL: https://github.com/nodejs/node/pull/6907 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-23string_bytes: Make base64 encode/decode reusableEugene Ostroukhov
Node already has support for base64 encoding and decoding that is not visible outside the string_bytes.cc file. Our work on providing a support for the Chrome inspector protocol (https://github.com/nodejs/node/pull/6792) requires base64 encoding support. Rather then introducing a second copy of the base64 encoder, we suggest moving this code into a separate header. PR-URL: https://github.com/nodejs/node/pull/6910 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
2016-05-23udp: use libuv API to get file descriptorSaúl Ibarra Corretgé
Refs: https://github.com/nodejs/node/pull/6838 PR-URL: https://github.com/nodejs/node/pull/6908 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-05-19src: add node::FreeEnvironment public APICheng Zhao
Since debugger::Agent's interface is not exported, third party embedders will have linking errors if they call Environment's destructor directly. PR-URL: https://github.com/nodejs/node/pull/3098 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-19unix,stream: fix getting the correct fd for a handleSaúl Ibarra Corretgé
On OSX it's possible that the fd is replaced, so use the proper libuv API to get the correct fd. PR-URL: https://github.com/nodejs/node/pull/6753 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-05-18src: fix without-intl buildAnna Henningsen
In 5d38d543cd, an additional property in node_config.cc was added whose definition depends on having the local `env` variable declared, which in turn depended on `NODE_HAVE_I18N_SUPPORT` being defined. Moving `env = ...` out of the `#ifdef` block allows building via `./configure --without-intl` again. PR-URL: https://github.com/nodejs/node/pull/6820 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-17src: refactor require('constants')James M Snell
The require('constants') module is currently undocumented and mashes together unrelated constants. This refactors the require('constants') in favor of distinct os.constants, fs.constants, and crypto.constants that are specific to the modules for which they are relevant. The next step is to document those within the specific modules. PR-URL: https://github.com/nodejs/node/pull/6534 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
2016-05-13src,module: add --preserve-symlinks command line flagJames M Snell
Add the `--preserve-symlinks` flag. This makes the changes added in #5950 conditional. By default the old behavior is used. With the flag set, symlinks are preserved, switching to the new behavior. This should be considered to be a temporary solution until we figure out how to solve the symlinked peer dependency problem in a more general way that does not break everything else. Additional test cases are included. PR-URL: https://github.com/nodejs/node/pull/6537 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-11handle_wrap: IsRefed() -> HasRef()Jeremiah Senkpiel
Rename slightly to HasRef() at bnoordhuis’ request. Better reflects what we actually do for this check. Refs: https://github.com/nodejs/node/pull/6395 Refs: https://github.com/nodejs/node/pull/6204 Refs: https://github.com/nodejs/node/pull/6401 Refs: https://github.com/nodejs/node/pull/6382 Refs: https://github.com/nodejs/node/pull/6381 PR-URL: https://github.com/nodejs/node/pull/6546 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-05-11Revert "handle_wrap: IsRefed -> Unrefed, no isAlive check"Jeremiah Senkpiel
This reverts commit 9bb5a5e2a127010807f5b8a8bf4cf34109271c55. This API is not suitable because it depended on being able to potentially access the handle's flag after the handle was already cleaned up. Since this is not actually possible (obviously, oops) this newer API no longer makes much sense, and the older API is more suitable. API comparison: IsRefed -> Has a strong reference AND is alive. (Deterministic) Unrefed -> Has a weak reference OR is dead. (Less deterministic) Refs: https://github.com/nodejs/node/pull/6395 Refs: https://github.com/nodejs/node/pull/6204 Refs: https://github.com/nodejs/node/pull/6401 Refs: https://github.com/nodejs/node/pull/6382 Fixes: https://github.com/nodejs/node/pull/6381 PR-URL: https://github.com/nodejs/node/pull/6546 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Conflicts: src/handle_wrap.cc test/parallel/test-handle-wrap-isrefed-tty.js test/parallel/test-handle-wrap-isrefed.js
2016-05-10src: fix sporadic deadlock in SIGUSR1 handlerBen Noordhuis
Calling v8::Debug::DebugBreak() directly from the signal handler is unsafe because said function tries to grab a mutex. Work around that by starting a watchdog thread that is woken up from the signal handler, which then calls v8::Debug::DebugBreak(). Using a watchdog thread also removes the need to use atomic operations so this commit does away with that. Fixes: https://github.com/nodejs/node/issues/5368 PR-URL: https://github.com/nodejs/node/pull/5904 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-05-07src,lib: minor --debug-brk cleanupAli Ijaz Sheikh
Minor cleanup of how --debug-brk works: * We no longer need to use command line flags to expose the debug object. * Do not depend on the existence of global.v8debug as a mechanism to determine if --debug-brk was specified. * We no longer need to set a dummy listener with --debug-brk. PR-URL: https://github.com/nodejs/node/pull/6599 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
2016-05-05src: don't use locale-sensitive strcasecmp()Ben Noordhuis
strcasecmp() is affected by the current locale as configured through e.g. the LC_ALL environment variable and the setlocale() libc function. It can result in unpredictable results across systems so replace it with a function that isn't susceptible to that. PR-URL: https://github.com/nodejs/node/pull/6582 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-05-05src: remove unused #include statementBen Noordhuis
strcasecmp() is not used in src/node_http_parser.cc so there is no need to include its header file. PR-URL: https://github.com/nodejs/node/pull/6582 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-05-05src: remove pre-openssl 1.0 legacy codeBen Noordhuis
SSL_CIPHER and SSL_METHOD are always const with the version of openssl that we support, no need to check OPENSSL_VERSION_NUMBER first. PR-URL: https://github.com/nodejs/node/pull/6582 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-05-05crypto: disable ssl compression at build timeBen Noordhuis
SSL compression was first disabled at runtime in March 2011 in commit e83c6959 ("Disable compression with OpenSSL.") for performance reasons and was later shown to be vulnerable to information leakage (CRIME.) Let's stop compiling it in altogether. This commit removes a broken CHECK from src/node_crypto.cc; broken because sk_SSL_COMP_num() returns -1 for a NULL stack, not 0. As a result, node.js would abort when linked to an OPENSSL_NO_COMP build of openssl. PR-URL: https://github.com/nodejs/node/pull/6582 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-05-04intl: Don't crash if v8BreakIterator not availableSteven R. Loomis
If the undocumented v8BreakIterator does not have data available, monkeypatch it to throw an error instead of crashing. Fixes: https://github.com/nodejs/node/issues/3111 PR-URL: https://github.com/nodejs/node/pull/4253 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-04buffer: fix lastIndexOf index underflow issueAnna Henningsen
Fix `buffer.lastIndexOf()` for the case that the first character of the needle is contained in the haystack, but in a location that makes it impossible to be part of a full match. For example, when searching for 'abc' in 'abcdef', only the 'cdef' part needs to be searched for 'c', because earlier locations can be excluded by index calculations alone. Previously, such a search would result in an assertion failure. This applies only to Node.js v6, as `lastIndexOf` was added in it. PR-URL: https://github.com/nodejs/node/pull/6511 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-05-04buffer: fix lastIndexOf crash for overlong needleAnna Henningsen
Return -1 in `Buffer.lastIndexOf` if the needle is longer than the haystack. The previous check only tested the corresponding condition for forward searches. This applies only to Node.js v6, as `lastIndexOf` was added in it. Fixes: https://github.com/nodejs/node/issues/6510 PR-URL: https://github.com/nodejs/node/pull/6511 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-05-04src: fix FindFirstCharacter argument alignmentAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/6511 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-05-04buffer: fix UCS2 indexOf for odd buffer lengthAnna Henningsen
Fix `buffer.indexOf` for the case that the haystack has odd length and the needle is not found in it. `StringSearch()` would return the length of the buffer in multiples of `sizeof(uint16_t)`, but checking that against `haystack_length` would not work if the latter one was odd. PR-URL: https://github.com/nodejs/node/pull/6511 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-05-04buffer: fix needle length misestimation for UCS2Anna Henningsen
Use `StringBytes::Size` to determine the needle string length instead of assuming latin-1 or UTF-8. Previously, `Buffer.indexOf` could fail with an assertion failure when the needle's byte length, but not its character count, exceeded the haystack's byte length. PR-URL: https://github.com/nodejs/node/pull/6511 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-05-04src: add O_NOATIME constantRich Trott
Add O_NOATIME flag on Linux for use with `fs.open()`. PR-URL: https://github.com/nodejs/node/pull/6492 Fixes: https://github.com/nodejs/node/issues/2182 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-03util: fix inspecting of proxy objectsJames M Snell
In certain conditions, inspecting a Proxy object can lead to a max call stack error. Avoid that by detecting the Proxy object and outputting information about the Proxy object itself. Fixes: https://github.com/nodejs/node/issues/6464 PR-URL: https://github.com/nodejs/node/pull/6465 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-04-29process: add process.cpuUsage() - implementation, doc, testsPatrick Mueller
Add process.cpuUsage() method that returns the user and system CPU time usage of the current process PR-URL: https://github.com/nodejs/node/pull/6157 Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-04-29src: unify implementations of Utf8Value etc.Anna Henningsen
Unify the common code of `Utf8Value`, `TwoByteValue`, `BufferValue` and `StringBytes::InlineDecoder` into one class. Always make the result zero-terminated for the first three. This fixes two problems in passing: * When the conversion of the input value to String fails, make the buffer zero-terminated anyway. Previously, this would have resulted in possibly reading uninitialized data in multiple places in the code. An instance of that problem can be reproduced by running e.g. `valgrind node -e 'net.isIP({ toString() { throw Error() } })'`. * Previously, `BufferValue` copied one byte too much from the source, possibly resulting in an out-of-bounds memory access. This can be reproduced by running e.g. `valgrind node -e \ 'fs.openSync(Buffer.from("node".repeat(8192)), "r")'`. Further minor changes: * This lifts the `out()` method of `StringBytes::InlineDecoder` to the common class so that it can be used when using the overloaded `operator*` does not seem appropiate. * Hopefully clearer variable names. * Add checks to make sure the length of the data does not exceed the allocated storage size, including the possible null terminator. PR-URL: https://github.com/nodejs/node/pull/6357 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-04-27src: simplify handlewrap state tracking logicBen Noordhuis
This also updates the tests to expect that a closed handle has no reference count. PR-URL: https://github.com/nodejs/node/pull/6395 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-27src: use libuv's refcounting directlyBen Noordhuis
Don't implement an additional reference counting scheme on top of libuv. Libuv is the canonical source for that information so use it directly. PR-URL: https://github.com/nodejs/node/pull/6395 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-262016-04-26, Version 6.0.0 (Current) ReleaseJames M Snell
The following significant (semver-major) changes have been made since the previous Node v5.0.0 release. * Buffer * New Buffer constructors have been added [#4682](https://github.com/nodejs/node/pull/4682) * Previously deprecated Buffer APIs are removed [#5048](https://github.com/nodejs/node/pull/5048), [#4594](https://github.com/nodejs/node/pull/4594) * Improved error handling [#4514](https://github.com/nodejs/node/pull/4514) * Cluster * Worker emitted as first argument in 'message' event [#5361](https://github.com/nodejs/node/pull/5361). * Crypto * Improved error handling [#3100](https://github.com/nodejs/node/pull/3100), [#5611](https://github.com/nodejs/node/pull/5611) * Simplified Certificate class bindings [#5382](https://github.com/nodejs/node/pull/5382) * Improved control over FIPS mode [#5181](https://github.com/nodejs/node/pull/5181) * pbkdf2 digest overloading is deprecated [#4047](https://github.com/nodejs/node/pull/4047) * Dependencies * Reintroduce shared c-ares build support [#5775](https://github.com/nodejs/node/pull/5775). * V8 updated to 5.0.71.31 [#6111](https://github.com/nodejs/node/pull/6111). * DNS * Add resolvePtr API to query plain DNS PTR records [#4921](https://github.com/nodejs/node/pull/4921). * Domains * Clear stack when no error handler [#4659](https://github.com/nodejs/node/pull/4659). * File System * The `fs.realpath()` and `fs.realpathSync()` methods have been updated to use a more efficient libuv implementation. This change includes the removal of the `cache` argument and the method can throw new errors [#3594](https://github.com/nodejs/node/pull/3594) * FS apis can now accept and return paths as Buffers [#5616](https://github.com/nodejs/node/pull/5616). * Error handling and type checking improvements [#5616](https://github.com/nodejs/node/pull/5616), [#5590](https://github.com/nodejs/node/pull/5590), [#4518](https://github.com/nodejs/node/pull/4518), [#3917](https://github.com/nodejs/node/pull/3917). * fs.read's string interface is deprecated [#4525](https://github.com/nodejs/node/pull/4525) * HTTP * 'clientError' can now be used to return custom errors from an HTTP server [#4557](https://github.com/nodejs/node/pull/4557). * Modules * Current directory is now prioritized for local lookups [#5689](https://github.com/nodejs/node/pull/5689) * Symbolic links are preserved when requiring modules [#5950](https://github.com/nodejs/node/pull/5950) * Net * DNS hints no longer implicitly set [#6021](https://github.com/nodejs/node/pull/6021). * Improved error handling and type checking [#5981](https://github.com/nodejs/node/pull/5981), [#5733](https://github.com/nodejs/node/pull/5733), [#2904](https://github.com/nodejs/node/pull/2904) * OS X * MACOSX_DEPLOYMENT_TARGET has been bumped up to 10.7 [#6402](https://github.com/nodejs/node/pull/6402). * Path * Improved type checking [#5348](https://github.com/nodejs/node/pull/5348). * Process * Introduce process warnings API [#4782](https://github.com/nodejs/node/pull/4782). * Throw exception when non-function passed to nextTick [#3860](https://github.com/nodejs/node/pull/3860). * Readline * Emit key info unconditionally [#6024](https://github.com/nodejs/node/pull/6024) * REPL * Assignment to `_` will emit a warning. [#5535](https://github.com/nodejs/node/pull/5535) * Timers * Fail early when callback is not a function [#4362](https://github.com/nodejs/node/pull/4362) * TLS * Rename 'clientError' to 'tlsClientError' [#4557](https://github.com/nodejs/node/pull/4557) * SHA1 used for sessionIdContext [#3866](https://github.com/nodejs/node/pull/3866) * TTY * Previously deprecated setRawMode wrapper is removed [#2528](https://github.com/nodejs/node/pull/2528). * Util * Changes to Error object formatting [#4582](https://github.com/nodejs/node/pull/4582). * Windows * Windows XP and Vista are no longer supported [#5167](https://github.com/nodejs/node/pull/5167), [#5167](https://github.com/nodejs/node/pull/5167).
2016-04-26crypto: Read OpenSSL config before initStefan Budeanu
The OpenSSL configuration file allows custom crypto engines but those directives will not be respected if the config file is loaded after initializing all crypto subsystems. This patch reads the configuration file first. PR-URL: https://github.com/nodejs/node/pull/6374 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2016-04-25handle_wrap: IsRefed -> Unrefed, no isAlive checkJeremiah Senkpiel
This fixes my perceived usability issues with 7d8882b. Which, at the time of writing, has not landed in any release except v6 RCs. This should not be considered a breaking change due to that. It is useful if you have a handle, even if it has been closed, to be able to inspect whether that handle was unrefed or not. As such, this renames the method accordingly. If people need to check a handle's aliveness, that is a separate API we should consider exposing. Refs: https://github.com/nodejs/node/pull/5834 PR-URL: https://github.com/nodejs/node/pull/6204 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-04-25buffer: add Buffer.prototype.lastIndexOf()dcposch@dcpos.ch
* Remove unnecessary templating from SearchString SearchString used to have separate PatternChar and SubjectChar template type arguments, apparently to support things like searching for an 8-bit string inside a 16-bit string or vice versa. However, SearchString is only used from node_buffer.cc, where PatternChar and SubjectChar are always the same. Since this is extra complexity that's unused and untested (simplifying to a single Char template argument still compiles and didn't break any unit tests), I removed it. * Use Boyer-Hoore[-Horspool] for both indexOf and lastIndexOf Add test cases for lastIndexOf. Test the fallback from BMH to Boyer-Moore, which looks like it was totally untested before. * Extra bounds checks in node_buffer.cc * Extra asserts in string_search.h * Buffer.lastIndexOf: clean up, enforce consistency w/ String.lastIndexOf * Polyfill memrchr(3) for non-GNU systems PR-URL: https://github.com/nodejs/node/pull/4846 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>