Fedor Indutny [Mon, 6 Oct 2014 12:23:01 +0000 (16:23 +0400)]
tls_wrap: ignore ZERO_RETURN after close_notify
Do not call SSL_read() and ignore ZERO_RETURN if the connection was
shutdown and there could not be any reads.
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/joyent/node/pull/8519
gyson [Wed, 1 Oct 2014 02:44:39 +0000 (10:44 +0800)]
util: add es6 Symbol support for `util.inspect`
* `util.inspect` cannot accept es6 symbol primitive
* It will throw exception if do `util.inspect(Symbol())`
* This also affects repl, console.log, etc.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Yazhong Liu [Thu, 2 Oct 2014 23:24:58 +0000 (16:24 -0700)]
buffer: add generic functions for (u)int ops
Add generic functions for (U)Int read/write operations on Buffers. These
support up to and including 48 bit reads and writes.
Include documentation and tests.
Additional work done by Trevor Norris to include 40 and 48 bit write
support. Because bitwise operations cannot be used on values greater
than 32 bits, the operations have been replaced with mathematical
calculations. Regardless, they are still faster than floating point
operations.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 1 Oct 2014 22:42:02 +0000 (15:42 -0700)]
buffer: mv floating point read/write checks to JS
Performance improvement by moving checks for floating point operations
to JS and doing the operation on a protected internal function that
assumes all arguments are correct. Still abort if the operation
overflows memory. This can only be caused if the Buffer's length
property isn't the same as the actual internal length.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Julien Gilli [Mon, 22 Sep 2014 20:21:11 +0000 (13:21 -0700)]
readline: should not require an output stream.
Passing null as the output stream to readline.Interface()'s constructor
is now supported. Any output written by readline is just discarded. It
makes it easier to use readline just as a line parser.
Fixes: https://github.com/joyent/node/issues/4408
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Vladimir Kurchatkin [Mon, 22 Sep 2014 16:19:50 +0000 (20:19 +0400)]
node: avoid automatic microtask runs
Since we are taking control of the microtask queue it makes sense to
disable autorun and only run microtasks when necessary. Just setting
isolate->SetAutorunMicrotasks(false) would cause _tickCallback() not to
be called.
Automatically running the microtask queue will cause it to run:
* After callback invocation
* Inside _tickCallback()
* After _tickCallback() invocation
The third one is unnecessary as the microtask queue is guaranteed to be
empty at this point. The first only needs to be run manually when
_tickCallback() isn't going to be called by MakeCallback().
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Gabriel Wicke [Thu, 25 Sep 2014 16:59:18 +0000 (09:59 -0700)]
url: make query() consistent
Match the behavior of the slow path by setting url.query to an empty
object when the url contains no query, but query parsing is requested.
Also add a test for this case, and update the documents to clearly
reflect this behavior.
Fixes: https://github.com/joyent/node/issues/8332
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Fri, 5 Sep 2014 05:03:24 +0000 (22:03 -0700)]
build, i18n: improve Intl build, add "--with-intl"
The two main goals of this change are:
- To make it easier to build the Intl option using ICU (particularly,
using a newer ICU than v8/Chromium's version)
- To enable a much smaller ICU build with only English support The goal
here is to get node.js binaries built this way by default so that the
Intl API can be used. Additional data can be added at execution time
(see Readme and wiki)
More details are at https://github.com/joyent/node/pull/7719
In particular, this change adds the "--with-intl=" configure option to
provide more ways of building "Intl":
- "full-icu" picks up an ICU from deps/icu
- "small-icu" is similar, but builds only English
- "system-icu" uses pkg-config to find an installed ICU
- "none" does nothing (no Intl)
For Windows builds, the "full-icu" or "small-icu" options are added to
vcbuild.bat.
Note that the existing "--with-icu-path" option is not removed from
configure, but may not be used alongside the new option.
Wiki changes have already been made on
https://github.com/joyent/node/wiki/Installation
and a new page created at
https://github.com/joyent/node/wiki/Intl
(marked as provisional until this change lands.)
Summary of changes:
* README.md : doc updates
* .gitignore : added "deps/icu" as this is the location where ICU is
unpacked to.
* Makefile : added the tools/icu/* files to cpplint, but excluded a
problematic file.
* configure : added the "--with-intl" option mentioned above.
Calculate at config time the list of ICU source files to use and data
packaging options.
* node.gyp : add the new files src/node_i18n.cc/.h as well as ICU
linkage.
* src/node.cc : add call into
node::i18n::InitializeICUDirectory(icu_data_dir) as well as new
--icu-data-dir option and NODE_ICU_DATA env variable to configure ICU
data loading. This loading is only relevant in the "small"
configuration.
* src/node_i18n.cc : new source file for the above Initialize..
function, to setup ICU as needed.
* tools/icu : new directory with some tools needed for this build.
* tools/icu/icu-generic.gyp : new .gyp file that builds ICU in some new
ways, both on unix/mac and windows.
* tools/icu/icu-system.gyp : new .gyp file to build node against a
pkg-config detected ICU.
* tools/icu/icu_small.json : new config file for the "English-only" small
build.
* tools/icu/icutrim.py : new tool for trimming down ICU data. Reads the
above .json file.
* tools/icu/iculslocs.cc : new tool for repairing ICU data manifests
after trim operation.
* tools/icu/no-op.cc : dummy file to force .gyp into using a C++ linker.
* vcbuild.bat : added small-icu and full-icu options, to call into
configure.
* Fixed toolset dependencies, see
https://github.com/joyent/node/pull/7719#issuecomment-
54641687
Note that because of a bug in gyp {CC,CXX}_host must also be set.
Otherwise gcc/g++ will be used by default for part of the build.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Julien Fontanet [Tue, 23 Sep 2014 14:51:33 +0000 (16:51 +0200)]
doc: note stdout and stderr special behaviors.
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Jackson Tian [Wed, 24 Sep 2014 05:14:48 +0000 (13:14 +0800)]
http: Improve _addHeaderLines method
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Tue, 30 Sep 2014 00:29:59 +0000 (17:29 -0700)]
buffer: fix and cleanup fill()
Running fill() with an empty string would cause Node to hang
indefinitely. Now it will return without having operated on the buffer.
User facing function has been pulled into JS to perform all initial
value checks and coercions. The C++ method has been placed on the
"internal" object.
Coerced non-string values to numbers to match v0.10 support.
Simplified logic and changed a couple variable names.
Added tests for fill() and moved them all to the beginning of
buffer-test.js since many other tests depend on fill() working properly.
Fixes: https://github.com/joyent/node/issues/8469
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Mon, 29 Sep 2014 23:32:34 +0000 (16:32 -0700)]
doc: fix optional parameter parsing
The parameter parser specifically looked for the old bracket syntax.
This generated a lot of warnings when building the docs. Those warnings
have been fixed by changing the parsing logic.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Rasmus Christian Pedersen [Thu, 18 Sep 2014 12:10:53 +0000 (14:10 +0200)]
src: fix VC++ warning C4244
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
James Ferguson [Thu, 25 Sep 2014 03:19:22 +0000 (20:19 -0700)]
readme: grammer fix
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Mon, 29 Sep 2014 19:32:42 +0000 (12:32 -0700)]
http: cleanup setHeader()
Several fields on OutgoingMessage were set after instantiation. These
have been included in the constructor to prevent mutation of the object
map after instantiation.
"name" is now explicitly checked to be a string. Where before if a
non-string was passed the following cryptic error was thrown:
_http_outgoing.js:334
var key = name.toLowerCase();
^
TypeError: undefined is not a function
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Mon, 29 Sep 2014 17:13:35 +0000 (10:13 -0700)]
timer_wrap: remove HandleScopes, check return size
Calls from JS to C++ have an implicit HandleScope. So there is no need
to instantiate a new HandleScope in these basic cases.
Check if the returned int64_t is an SMI and cast the return value to
uint32_t instead of a double. Prevents needing to box the return value,
and saves a small amount of execution time.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Fedor Indutny [Wed, 24 Sep 2014 09:42:33 +0000 (13:42 +0400)]
crypto: lower RSS usage for TLSCallbacks
Don't allocate any BIO buffers initially, do this on a first read from
the TCP connection. Allocate different amount of data for initial read
and for consequent reads: small buffer for hello+certificate, big buffer
for better throughput.
see #8416
cjihrig [Sat, 20 Sep 2014 04:07:33 +0000 (00:07 -0400)]
child_process: improve spawn() argument handling
Add stricter argument type checking to normalizeSpawnArguments().
Removes a number of extraneous checks in spawn().
Fix regression in handling of the optional args argument.
Add more thorough testing of spawn() arguments.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Jicheng Li [Sun, 14 Sep 2014 15:40:49 +0000 (23:40 +0800)]
readline: fix performance issue when large line
Only run lineEnding.test() on the newly acquired chunk of string instead
of on the entire line buffer.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 24 Sep 2014 22:41:31 +0000 (15:41 -0700)]
doc: fix brackets for optional parameters
Documentation incorrectly used bracket notation for optional parameters.
This caused inconsistencies in usage because of examples like the
following:
fs.write(fd, data[, position[, encoding]], callback)
This simply fixes all uses of bracket notation in documentation.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Timothy J Fontaine [Thu, 25 Sep 2014 00:14:23 +0000 (17:14 -0700)]
Now working on 0.11.15
Timothy J Fontaine [Wed, 24 Sep 2014 21:46:41 +0000 (14:46 -0700)]
2014.09.24, Version 0.11.14 (Unstable)
* uv: Upgrade to v1.0.0-rc1
* http_parser: Upgrade to v2.3.0
* npm: Upgrade to v2.0.0
* openssl: Upgrade to v1.0.1i
* v8: Upgrade to 3.26.33
* Add fast path for simple URL parsing (Gabriel Wicke)
* Added support for options parameter in console.dir() (Xavi Magrinyà)
* Cluster: fix shared handles on Windows (Alexis Campailla)
* buffer: Fix incorrect Buffer.compare behavior (Feross Aboukhadijeh)
* buffer: construct new buffer from buffer toJSON() output (cjihrig)
* buffer: improve Buffer constructor (Kang-Hao Kenny)
* build: linking CoreFoundation framework for OSX (Thorsten Lorenz)
* child_process: accept uid/gid everywhere (Fedor Indutny)
* child_process: add path to spawn ENOENT Error (Ryan Cole)
* child_process: copy spawnSync() cwd option to proper buffer (cjihrig)
* child_process: do not access stderr when stdio set to 'ignore' (cjihrig)
* child_process: don't throw on EAGAIN (Charles)
* child_process: don't throw on EMFILE/ENFILE (Ben Noordhuis)
* child_process: use full path for cmd.exe on Win32 (Ed Morley)
* cluster: allow multiple calls to setupMaster() (Ryan Graham)
* cluster: centralize removal from workers list. (Julien Gilli)
* cluster: enable error/message events using .worker (cjihrig)
* cluster: include settings object in 'setup' event (Ryan Graham)
* cluster: restore v0.10.x setupMaster() behaviour (Ryan Graham)
* cluster: support options in Worker constructor (cjihrig)
* cluster: test events emit on cluster.worker (Sam Roberts)
* console: console.dir() accepts options object (Xavi Magrinyà)
* crypto: add `honorCipherOrder` argument (Fedor Indutny)
* crypto: allow padding in RSA methods (Fedor Indutny)
* crypto: clarify RandomBytes() error msg (Mickael van der Beek)
* crypto: never store pointer to conn in SSL_CTX (Fedor Indutny)
* crypto: unsigned value can't be negative (Brian White)
* dgram: remove new keyword from errnoException (Jackson Tian)
* dns: always set variable family in lookup() (cjihrig)
* dns: include host name in error message if available (Maciej Małecki)
* dns: introduce lookupService function (Saúl Ibarra Corretgé)
* dns: send lookup c-ares errors to callback (Chris Dickinson)
* dns: throw if hostname is not string or falsey (cjihrig)
* events: Output the event that is leaking (Arnout Kazemier)
* fs: close file if fstat() fails in readFile() (cjihrig)
* fs: fs.readFile should not throw uncaughtException (Jackson Tian)
* http: add 308 status_code, see RFC7238 (Yazhong Liu)
* http: don't default OPTIONS to chunked encoding (Nick Muerdter)
* http: fix bailout for writeHead (Alex Kocharin)
* http: remove unused code block (Fedor Indutny)
* http: write() after end() emits an error. (Julien Gilli)
* lib, src: add vm.runInDebugContext() (Ben Noordhuis)
* lib: noisy deprecation of child_process customFds (Ryan Graham)
* module: don't require fs several times (Robert Kowalski)
* net,dgram: workers can listen on exclusive ports (cjihrig)
* net,stream: add isPaused, don't read() when paused (Chris Dickinson)
* net: Ensure consistent binding to IPV6 if address is absent (Raymond Feng)
* net: add remoteFamily for socket (Jackson Tian)
* net: don't emit listening if handle is closed (Eli Skeggs)
* net: don't prefer IPv4 addresses during resolution (cjihrig)
* net: don't throw on net.Server.close() (cjihrig)
* net: reset `errorEmitted` on reconnect (Ed Umansky)
* node: set names for prototype methods (Trevor Norris)
* node: support v8 microtask queue (Vladimir Kurchatkin)
* path: fix slice OOB in trim (Lucio M. Tato)
* path: isAbsolute() should always return boolean (Herman Lee)
* process: throw TypeError if kill pid not a number (Sam Roberts)
* querystring: custom encode and decode (fengmk2)
* querystring: do not add sep for empty array (cjihrig)
* querystring: remove prepended ? from query field (Ezequiel Rabinovich)
* readline: fix close event of readline.Interface() (Yazhong Liu)
* readline: fixes scoping bug (Dan Kaplun)
* readline: implements keypress buffering (Dan Kaplun)
* repl: fix multi-line input (Fedor Indutny)
* repl: fix overwrite for this._prompt (Yazhong Liu)
* repl: proper `setPrompt()` and `multiline` support (Fedor Indutny)
* stream: don't try to finish if buffer is not empty (Vladimir Kurchatkin)
* stream: only end reading on null, not undefined (Jonathan Reem)
* streams: set default hwm properly for Duplex (Andrew Oppenlander)
* string_bytes: ucs2 support big endian (Andrew Low)
* tls, crypto: add DHE support (Shigeki Ohtsu)
* tls: `checkServerIdentity` option (Trevor Livingston)
* tls: add DHE-RSA-AES128-SHA256 to the def ciphers (Shigeki Ohtsu)
* tls: better error reporting at cert validation (Fedor Indutny)
* tls: support multiple keys/certs (Fedor Indutny)
* tls: throw an error, not string (Jackson Tian)
* udp: make it possible to receive empty udp packets (Andrius Bentkus)
* url: treat the same as / (isaacs)
Timothy J Fontaine [Wed, 24 Sep 2014 21:41:07 +0000 (14:41 -0700)]
deps: upgrade npm to 2.0.0
Patrick Mooney [Wed, 17 Sep 2014 18:54:24 +0000 (13:54 -0500)]
net: Make server.connections un-enumerable
The property server.connections should no longer be enumerable because
it has been deprecated. This will prevent deprecation warnings when
server objects are accessed by functions such as JSON.stringify.
Fixes: https://github.com/joyent/node/issues/8373
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Robert Kowalski [Sat, 13 Sep 2014 09:06:28 +0000 (11:06 +0200)]
benchmark: add test for module loader
Adds a test for benchmarking the module loader, needed for benchmarking
changes / refacortings in the module loader.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
Timothy J Fontaine [Wed, 24 Sep 2014 21:13:58 +0000 (14:13 -0700)]
test: disable dgram-bind-shared-ports on win32
Windows currently doesn't support clustered dgram sockets, when it does
re-enable this test
Julien Gilli [Wed, 24 Sep 2014 16:36:25 +0000 (09:36 -0700)]
tests: add test for buffer.slice.
4c9b30d introduced a regression in buffer.slice that 7c3c51b fixed, but
no test had been added to make sure that a similar regression is caught
by the tests suite in the future.
Fedor Indutny [Tue, 23 Sep 2014 09:49:42 +0000 (13:49 +0400)]
tls_wrap: ensure that TLSCallbacks are gc-able
Call `MakeWeak()` to destruct TLSCallbacks when the js-object dies.
fix #8416
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Trevor Norris [Tue, 23 Sep 2014 20:19:31 +0000 (13:19 -0700)]
buffer: fix map and set parent to undefined
In 4c9b30d removal of the prototype attributes meant NativeBuffer() no
longer had the same object map as Buffer(). By now setting the same
properties in the same order both constructors will produce the same
map.
The same commit changed "parent" from undefined to null. This caused a
failure in Buffer#slice() where it was checked if parent === undefined.
Causing the incorrect parent to be set.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Fedor Indutny [Tue, 23 Sep 2014 20:19:39 +0000 (00:19 +0400)]
uv: apply floating patch
2f54947b
Fedor Indutny [Fri, 19 Sep 2014 17:37:55 +0000 (21:37 +0400)]
deps: update uv to v1.0.0-rc1
Fedor Indutny [Fri, 12 Sep 2014 12:27:22 +0000 (13:27 +0100)]
crypto: export externals to internal structs
Export External getters for a internal structs: SSL, SSL_CTX.
Julien Gilli [Tue, 23 Sep 2014 00:21:40 +0000 (17:21 -0700)]
http: write() after end() emits an error.
When calling write() after end() has been called on an OutgoingMessage,
an error is emitted and the write's callback is called with an instance
of Error.
Fix #7477.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Kang-Hao Kenny [Fri, 19 Sep 2014 15:14:37 +0000 (23:14 +0800)]
buffer: improve Buffer constructor
Increase the performance of new Buffer construction by initializing all
properties before SetIndexedPropertiesToExternalArrayData call.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Andrew Teich [Fri, 19 Sep 2014 05:09:24 +0000 (22:09 -0700)]
doc: corrected typo in vm docs
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Vladimir Kurchatkin [Thu, 4 Sep 2014 16:02:04 +0000 (20:02 +0400)]
node: support v8 microtask queue
When V8 started supporting Promises natively it also introduced a
microtack queue. This feature operates similar to process.nextTick(),
and created an issue where neither knew when the other had run. This
patch has nextTick() call the microtask queue runner at the end of
processing callbacks in the nextTickQueue.
Fixes: https://github.com/joyent/node/issues/7714
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Julien Gilli [Tue, 2 Sep 2014 17:52:45 +0000 (10:52 -0700)]
test: add test for cluster.worker.destroy()
Add a simple test to cover workers' implementation of
Worker.prototype.destroy(). Before adding this test, this code wouldn't
be covered by the tests suite, and any regression introduced in workers'
implementation of Worker.prototype.destroy wouldn't be caught.
Fixes: https://github.com/joyent/node/issues/8223
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Fedor Indutny [Wed, 17 Sep 2014 22:21:32 +0000 (02:21 +0400)]
crypto: never store pointer to conn in SSL_CTX
SSL_CTX is shared between multiple connections and is not a right place
to store per-connection data.
fix #8348
Reviewed-By: Trevor Norris
Mickael van der Beek [Wed, 17 Sep 2014 21:40:01 +0000 (14:40 -0700)]
crypto: clarify RandomBytes() error msg
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Alexis Campailla [Fri, 15 Aug 2014 16:25:38 +0000 (18:25 +0200)]
win: manifest node.exe for Windows 8.1
Adding a compatibility section to node.exe embedded manifest so that
Node is declared explicitly compatible with Windows 8.1. Required so
that os.release() can return the correct version on Windows 8.1.
See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Guilherme de Souza [Fri, 12 Sep 2014 10:07:05 +0000 (07:07 -0300)]
doc: console example improvement
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Guilherme de Souza [Fri, 12 Sep 2014 09:25:15 +0000 (06:25 -0300)]
doc: http.request() improved code example
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Timothy J Fontaine [Wed, 17 Sep 2014 00:48:09 +0000 (17:48 -0700)]
Merge remote-tracking branch 'upstream/v0.10' into v0.12
Conflicts:
ChangeLog
deps/v8/src/hydrogen.cc
lib/http.js
lib/querystring.js
src/node_crypto.cc
src/node_version.h
test/simple/test-querystring.js
Timothy J Fontaine [Tue, 16 Sep 2014 23:53:10 +0000 (16:53 -0700)]
Now working on 0.10.33
Timothy J Fontaine [Tue, 16 Sep 2014 23:52:57 +0000 (16:52 -0700)]
Merge branch 'v0.10.32-release' into v0.10
Timothy J Fontaine [Tue, 16 Sep 2014 22:47:52 +0000 (15:47 -0700)]
2014.09.16, Version 0.10.32 (Stable)
* npm: Update to 1.4.28
* v8: fix a crash introduced by previous release (Fedor Indutny)
* configure: add --openssl-no-asm flag (Fedor Indutny)
* crypto: use domains for any callback-taking method (Chris Dickinson)
* http: do not send `0rnrn` in TE HEAD responses (Fedor Indutny)
* querystring: fix unescape override (Tristan Berger)
* url: Add support for RFC 3490 separators (Mathias Bynens)
Timothy J Fontaine [Tue, 16 Sep 2014 22:38:50 +0000 (15:38 -0700)]
npm: Update to 1.4.28
Fedor Indutny [Sat, 13 Sep 2014 12:08:25 +0000 (13:08 +0100)]
http: do not send `0\r\n\r\n` in TE HEAD responses
When replying to a HEAD request, do not attempt to send the trailers and
EOF sequence (`0\r\n\r\n`). The HEAD request MUST not have body.
Quote from RFC:
The presence of a message body in a response depends on both the
request method to which it is responding and the response status code
(Section 3.1.2). Responses to the HEAD request method (Section 4.3.2
of [RFC7231]) never include a message body because the associated
response header fields (e.g., Transfer-Encoding, Content-Length,
etc.), if present, indicate only what their values would have been if
the request method had been GET (Section 4.3.1 of [RFC7231]).
fix #8361
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Chris Dickinson [Tue, 16 Sep 2014 17:14:24 +0000 (10:14 -0700)]
crypto: use domains for any callback-taking method
This adds domains coverage for pdbkdf2, pseudoRandomBytes, and randomBytes.
All others should be covered by event emitters.
Fixes #5801.
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Ben Noordhuis [Fri, 22 Aug 2014 13:09:24 +0000 (15:09 +0200)]
lib, src: add vm.runInDebugContext()
Compiles and executes source code in V8's debugger context. Provides
a programmatic way to get access to the debug object by executing:
var Debug = vm.runInDebugContext('Debug');
Fixes #7886.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Maciej Małecki [Wed, 6 Aug 2014 14:53:59 +0000 (16:53 +0200)]
dns: include host name in error message if available
This makes errors more readable and similar to FS errors, which also
include file name.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Maciej Małecki [Mon, 11 Nov 2013 19:51:34 +0000 (20:51 +0100)]
doc: document `process.env` better
Fixes #6424.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Adam Lippai [Sat, 13 Sep 2014 22:37:34 +0000 (00:37 +0200)]
tls: fix encoding in certificate-related functions
Strings are treated as UTF8 instead of one-byte strings when
names are processed and when OpenSSL's ..._print functions are used.
This commit fixes simple/test-tls-peer-certificate-encoding test.
fix #8366
Mathias Schreck [Wed, 3 Sep 2014 11:45:36 +0000 (13:45 +0200)]
doc: fix modules require.resolve documentation
The behavior of the `node_modules` lookup algorithm was
changed in #1177, but the documentation was not updated completely
to describe the new behavior.
The pseudocode of the lookup algorithm did not metion that
`index.json` is tried to be loaded if you require a folder.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fedor Indutny [Thu, 24 Jul 2014 09:31:45 +0000 (09:31 +0000)]
deps: backport 60c316 from v8 trunk
Original commit message:
Extend the interceptor setter ASSERT to support the JSGlobalProxy case.
BUG=v8:3463
LOG=n
R=dcarney@chromium.org
Review URL: https://codereview.chromium.org/
415973004
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22589
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
Signed-off-by: Fedor Indutny <fedor@indutny.com>
fix #7969
Fedor Indutny [Mon, 21 Jul 2014 18:12:11 +0000 (22:12 +0400)]
gyp: fix post-mortem in v0.11
Expose missing constants and keep symbols on OSX.
Ben Noordhuis [Fri, 23 May 2014 14:01:17 +0000 (14:01 +0000)]
deps: cherry-pick r21466 from v8 trunk
Check for cached transition to ExternalArray elements kind.
See [1] and [2] for details.
[1] https://code.google.com/p/v8/issues/detail?id=3337
[2] https://codereview.chromium.org/
291193011
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Wed, 14 May 2014 09:25:57 +0000 (11:25 +0200)]
deps: cherry-pick r21297 from v8 trunk
Changes the return value of PropertyCallbackInfo<T>::This() from
Local<Value> back to Local<Object>. See [1] and [2] for background.
[1] https://groups.google.com/forum/#!topic/v8-users/wP2UcQ4cBW4
[2] https://codereview.chromium.org/
285643008/
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Mon, 12 May 2014 03:38:47 +0000 (05:38 +0200)]
deps: fix up v8 postmortem codegen
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Trevor Norris [Tue, 9 Sep 2014 21:03:08 +0000 (14:03 -0700)]
v8: Upgrade 3.26.33 with 14 patches
V8 3.26.31 has received 14 patches since the upgrade to 3.26.33. Since
3.26.33 is technically a tag on the 3.27 branch, reverting back to
3.26.31 would remove now default functionality like WeakMaps. Because of
that the patches have simply been cherry-picked and squashed.
Here is a summary of all patches:
* Fix index register assignment in LoadFieldByIndex for arm, arm64, and
mips.
* Fix invalid attributes when generalizing because of incompatible map
change.
* Skip write barriers when updating the weak hash table.
* MIPS: Avoid HeapObject check in HStoreNamedField.
* Do GC if CodeRange fails to allocate a block.
* Array.concat: properly go to dictionary mode when required.
* Keep CodeRange::current_allocation_block_index_ in range.
* Grow heap slower if GC freed many global handles.
* Do not eliminate bounds checks for "<const> - x".
* Add missing map check to optimized f.apply(...).
* In GrowMode, force the value to the right representation to avoid
deopts between storing the length and storing the value.
* Reduce max executable size limit.
* Fix invalid condition in check elimination effects.
* Fix off-by-one error in Array.concat slow mode check.
For more information see: https://github.com/v8/v8/commits/3.26
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Trevor Livingston [Fri, 5 Sep 2014 14:56:55 +0000 (09:56 -0500)]
tls: `checkServerIdentity` option
Allow overriding `checkServerIdentity` function, when connecting to a
TLS server.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ben Noordhuis [Fri, 5 Sep 2014 15:33:28 +0000 (17:33 +0200)]
src: remove Environment::GetCurrentChecked()
There is only one call site that uses it and that can do the checks
itself. Removes ~15 lines of code.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 22 Aug 2014 23:25:40 +0000 (01:25 +0200)]
lib: unexport http.parsers
Unexport the http.parsers freelist. It was originally exported by Ryan
in commit
0003c701 but the commit log doesn't mention why and it's never
been documented. It's unclear if there are any users.
The lifecycle of parser objects changed recently and it seems better to
not let people shoot themselves in the foot so easily.
If it turns out there are actually users, we can always re-export it
again - probably under a slightly different name, to force people to
update their code to the new way of things.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 22 Aug 2014 22:57:45 +0000 (00:57 +0200)]
lib: http: poison parser references after freeing
Make it a little harder to slip in use-after-free bugs by nulling out
references to the parser object after handing it off to freeParser().
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 22 Aug 2014 22:33:04 +0000 (00:33 +0200)]
src: update and expand comments in base-object.h
It's safe to call BaseObject::object() from your destructor _unless_
the handle is weak; then it's the weak callback that is calling your
destructor and the object will have been released by the time the
destructor runs.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 22 Aug 2014 22:31:44 +0000 (00:31 +0200)]
lib, src: don't make http parser handles weak
Weak handles put strain on the garbage collector and the parser handle
doesn't need to be weak in the first place. This change should improve
GC times on busy servers a little.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Thu, 4 Sep 2014 02:23:03 +0000 (04:23 +0200)]
src: add ClearWrap() to util.h
Counterpart to Wrap(), clears the previously assigned internal field.
Will be used in an upcoming commit.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 22 Aug 2014 21:57:46 +0000 (23:57 +0200)]
src: fix handle leak in Parser::Execute()
Fix a resource leak where an intermediate Local<Context> handle in
Environment::GetCurrent() got leaked into whatever HandleScope was
further up the stack.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Majid Arif Siddiqui [Thu, 14 Aug 2014 03:15:24 +0000 (11:15 +0800)]
lib: improved forEach object performance
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
cjihrig [Thu, 4 Sep 2014 15:10:44 +0000 (11:10 -0400)]
test: listen on exclusive port in cluster workers
Test that listening on exclusive ports with the cluster module works
correctly.
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
cjihrig [Fri, 22 Aug 2014 20:51:53 +0000 (16:51 -0400)]
net,dgram: workers can listen on exclusive ports
Allow cluster workers to listen on exclusive ports for TCP and UDP,
instead of forcing all calls to go through the cluster master.
Fixes: #3856
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Trevor Norris [Wed, 3 Sep 2014 21:24:50 +0000 (14:24 -0700)]
src: be more intelligent about use of "arguments"
Use 'use strict' when there are named arguments and the arguments object
is passed to apply(). Also pass named arguments to call() when the named
argument is modified by the function.
Suggested in
https://github.com/joyent/node/pull/8302#issuecomment-
54331801
Confirmed in
https://github.com/joyent/node/pull/8302#issuecomment-
54364818
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Fedor Indutny [Mon, 1 Sep 2014 14:44:57 +0000 (18:44 +0400)]
tls: support multiple keys/certs
Required to serve website with both ECDSA/RSA certificates.
Fedor Indutny [Mon, 1 Sep 2014 14:44:07 +0000 (18:44 +0400)]
tls_wrap: fix use after free
Do not free TLSCallbacks from StreamWrap. TLSCallbacks is bound to a V8
object and should be collected by V8's GC.
Fedor Indutny [Mon, 1 Sep 2014 12:07:45 +0000 (16:07 +0400)]
crypto: use less memory for storing keys
Use `BIO_new_mem_buf` where possible to reduce memory usage and
initialization costs.
Fedor Indutny [Tue, 2 Sep 2014 11:53:36 +0000 (15:53 +0400)]
configure: add --openssl-no-asm flag
see #8062
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Jackson Tian [Mon, 1 Sep 2014 14:44:19 +0000 (22:44 +0800)]
net: Improve Socket.prototype.write()
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 3 Sep 2014 10:36:17 +0000 (03:36 -0700)]
stream_wrap: Add support to write binary strings
node::StringBytes::Write() has appropriate support to write strings with
'binary' encoding. So expose that API through StreamWrap and allow
inheriting classes to use it.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Tue, 2 Sep 2014 18:30:45 +0000 (11:30 -0700)]
node,async-wrap: verify domain enter/exit are set
The REPL global object lazy loads modules by placing getters for each.
This causes MakeDomainCallback() to be run if a native module is loaded
from the REPL, but if the domain module hasn't been loaded then there
are no enter/exit callbacks to be called. Causing an assert() to fail.
Fix the issue by conditionally running the callback instead of asserting
it is available. Also add "addon" test to verify the fix.
Fixes: #8231
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Julien Gilli [Tue, 26 Aug 2014 18:45:12 +0000 (11:45 -0700)]
tests: add test for non-integer delay timers.
PR #8034 came with a test to make sure that timers expiry is based on
monotonic time and not on wall-clock time. However, a bug in the
implementation broke timers with non-integer delays. A fix for this
issue was provided with PR #8073, but it didn't come with a test.
Because #8073 fixed a subtle issue that could reappear in the future,
and because the impact of such an issue would be significant, I suggest
adding this test.
The test would timeout after 1 minute if the issue was reproduced.
Otherwise it will run very quickly.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Jesús Leganés Combarro "piranna [Sat, 23 Aug 2014 21:01:06 +0000 (23:01 +0200)]
configure: generate a fully statically linked exec
Allow to create an executable with no external dynamic libraries, also the
ones from the system. This is somewhat dependent of the used C lib, for
example glibc has some internal dynamic libraries loaded by itself, but for
other ones like eglibc or dietlib, this would produce a true static linked
executable. This can be of interest for embebers or resource constraints
platforms, but the main reason for this is to allow to use a Javascript
file as Linux kernel 'init' on NodeOS.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Julien Gilli [Sat, 16 Aug 2014 00:20:32 +0000 (17:20 -0700)]
cluster: centralize removal from workers list.
Currently, cluster workers can be removed from the workers list in three
different places:
- In the exit event handler for the worker process.
- In the disconnect event handler of the worker process.
- In the disconnect event handler of the cluster master.
However, handles for a given worker are cleaned up only in one of these
places: in the cluster master's disconnect event handler.
Because these events happen asynchronously, it is possible that the
workers list is empty before we even clean up one handle. This makes
the assert that makes sure that no handle is left when the workers
list is empty fail.
This commit removes the worker from the cluster.workers list only when
the worker is dead _and_ disconnected, at which point we're sure that
its associated handles are cleaned up.
Fixes #8191 and #8192.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Brian White [Tue, 2 Sep 2014 13:27:33 +0000 (09:27 -0400)]
crypto: unsigned value can't be negative
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Brian White [Tue, 2 Sep 2014 13:26:14 +0000 (09:26 -0400)]
crypto: avoid memory leak
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Jackson Tian [Sat, 23 Aug 2014 14:48:13 +0000 (22:48 +0800)]
src: reading/owner/onread/onconnection for tcp
Initialize fields to avoid Hidden Class creation in runtime.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Isaac Burns [Fri, 29 Aug 2014 19:47:42 +0000 (14:47 -0500)]
crypto: wrap ECDH constants in HAVE_OPENSSL
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Shigeki Ohtsu [Thu, 28 Aug 2014 07:51:42 +0000 (16:51 +0900)]
tls: add DHE-RSA-AES128-SHA256 to the def ciphers
`!EDH` is also removed from the list in the discussion of #8272
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Shigeki Ohtsu [Wed, 27 Aug 2014 09:00:13 +0000 (18:00 +0900)]
tls, crypto: add DHE support
In case of an invalid DH parameter file, it is sliently discarded. To
use auto DH parameter in a server and DHE key length check in a
client, we need to wait for the next release of OpenSSL-1.0.2.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fedor Indutny [Wed, 27 Aug 2014 14:01:01 +0000 (18:01 +0400)]
crypto: introduce ECDH
Mathias Bynens [Mon, 4 Aug 2014 10:44:06 +0000 (12:44 +0200)]
url: Add support for RFC 3490 separators
There is no need to split the host by hand in `url.js` – Punycode.js
takes care of it anyway. This not only simplifies the code, but also
adds support for RFC 3490 separators (i.e. not just U+002E, but U+3002,
U+FF0E, and U+FF61 as well).
Closes #6055.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Jackson Tian [Mon, 25 Aug 2014 12:55:11 +0000 (20:55 +0800)]
src: Add function name for .byteLength/.compare
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Tristan Berger [Tue, 26 Aug 2014 08:39:25 +0000 (04:39 -0400)]
querystring: fix unescape override
Documentation states that `querystring.unescape` may be overridden to
replace unescaper during parsing. However, the function was only
being used as a fallback for when the native decoder throws (on a
malformed URL). This patch moves the call to the native function and
the try/catch around it into querystring.unescape then has the parser
always invoke it, so that an override will always be used.
Fixes #4055
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fedor Indutny [Sat, 23 Aug 2014 13:38:32 +0000 (17:38 +0400)]
crypto: allow padding in RSA methods
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
Fedor Indutny [Sun, 24 Aug 2014 22:19:15 +0000 (02:19 +0400)]
gyp: use --export-dynamic on FreeBSD
Should help addons use OpenSSL functions.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fedor Indutny [Fri, 22 Aug 2014 10:21:50 +0000 (14:21 +0400)]
deps: enable ARM assembly for OpenSSL
fix #8062
Fedor Indutny [Sat, 23 Aug 2014 19:22:23 +0000 (23:22 +0400)]
crypto: fix memory leak in Connection::New
Do not create `SSL` instance twice, `SSL_new` is called from `SSLBase`
constructor anyway.
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fedor Indutny [Thu, 21 Aug 2014 23:59:35 +0000 (03:59 +0400)]
deps: fix up v8 after fd80a3
fd80a31e0697d6317ce8c2d289575399f4e06d21 has introduced a segfault
during redundant boundary check elimination (#8208).
The problem consists of two parts:
1. Abscense of instruction iterator in
`EliminateRedundantBoundsChecks`. It was present in recent v8, but
wasn't considered important at the time of backport. However, since
the function is changing instructions order in block, it is
important to not rely at `i->next()` at the end of the loop.
2. Too strict ASSERT in `MoveIndexIfNecessary`. It is essentially a
backport of
a45c96ab from v8's upstream. See
https://github.com/v8/v8/commit/
a45c96ab for details.
fix #8208
Jackson Tian [Thu, 21 Aug 2014 16:05:42 +0000 (00:05 +0800)]
http: avoid create difference hidden class
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Chris Dickinson [Tue, 19 Aug 2014 21:38:55 +0000 (14:38 -0700)]
net,stream: add isPaused, don't read() when paused
net Sockets were calling read(0) to start reading, without
checking to see if they were paused first. This would result
in paused Socket objects keeping the event loop alive.
Fixes #8200
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
cjihrig [Fri, 15 Aug 2014 14:40:09 +0000 (10:40 -0400)]
dns: throw if hostname is not string or falsey
Fix assertion failure from poor argument parsing logic introduced in
6ea5d16. Add tests to make sure arguments are properly parsed.
Fixes: 6ea5d16 "dns: always set variable family in lookup()"
Reviewed-by: Trevor Norris <trev.norris@gmail.com>