platform/upstream/nodejs.git
10 years agoCluster: fix shared handles on Windows
Alexis Campailla [Thu, 24 Jul 2014 09:59:00 +0000 (11:59 +0200)]
Cluster: fix shared handles on Windows

This is the Node side of the fix for Node's cluster module on Windows.
https://github.com/joyent/node/issues/7691

The other required part is
https://github.com/joyent/libuv/pull/1384

Windows and Unix return certain socket errors (i.e. EADDRINUSE) at
different times: bind on Windows, and listen on Unix.
In an effort to hide this difference, libuv on Windows stores such
errors in the bind_error field of uv_tcp_t, to defer raising it at
listen time.
This worked fine except for the case in which a socket is shared in
a Node cluster and a bind error occurs.

A previous attempt to fix this (
https://github.com/joyent/libuv/commit/d1e6be1460f555a1f8a4063d7642696aa7238769
https://github.com/joyent/node/commit/3da36fe00e5d85414031ae812e473f16629d8645
) was flawed becaused in an attempt to relay the error at the JS level
it caused the master to start accepting connections.

With this new approach, libuv itself is relaying the bind errors,
providing for a uniform behavior of uv_tcp_listen.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
10 years agodeps: update libuv to v0.11.28
Fedor Indutny [Thu, 7 Aug 2014 11:03:17 +0000 (15:03 +0400)]
deps: update libuv to v0.11.28

10 years agodeps: update openssl to v1.0.1i
Fedor Indutny [Thu, 7 Aug 2014 09:36:56 +0000 (13:36 +0400)]
deps: update openssl to v1.0.1i

10 years agofs: fs.readFile should not throw uncaughtException
Jackson Tian [Tue, 5 Aug 2014 09:34:56 +0000 (17:34 +0800)]
fs: fs.readFile should not throw uncaughtException

Reviewed-By: Fedor Indutny <fedor@indutny.com>
10 years agodns: fix GetAddrInfo assert
Trevor Norris [Tue, 5 Aug 2014 01:12:54 +0000 (18:12 -0700)]
dns: fix GetAddrInfo assert

The method GetAddrInfo() is used by more than just dns.lookup(), and in
those cases a third argument isn't passed. This caused the following
check to abort:

  assert(args[3]->IsInt32());

Fixes: 4306786 "net: don't prefer IPv4 addresses during resolution"

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
10 years agonet: don't prefer IPv4 addresses during resolution
cjihrig [Thu, 22 May 2014 02:13:09 +0000 (22:13 -0400)]
net: don't prefer IPv4 addresses during resolution

Currently the address resolution family defaults to IPv4. Instead remove
the preference and instead resolve to a family suitable for the host.

Expose the getaddrinfo flags and allow them to be passed.

Add documentation about new flags.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
10 years agotest: fix test-net-remote-address-port
Julien Gilli [Fri, 1 Aug 2014 18:06:54 +0000 (11:06 -0700)]
test: fix test-net-remote-address-port

Do not use first socket in second socket's connect handler. Probably a
copy/paste mistake.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
10 years agopath: isAbsolute() should always return boolean
Herman Lee [Mon, 4 Aug 2014 14:18:54 +0000 (22:18 +0800)]
path: isAbsolute() should always return boolean

On Windows, path.isAbsolute() returns an empty string on failed cases.
This forces the return value to always be boolean.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
10 years agoprocess: improve process binding
Jackson Tian [Fri, 1 Aug 2014 11:26:09 +0000 (19:26 +0800)]
process: improve process binding

Reviewed-By: Fedor Indutny <fedor@indutny.com>
10 years agotest: disable 0-dgram tests on darwin
Fedor Indutny [Sat, 2 Aug 2014 11:06:25 +0000 (15:06 +0400)]
test: disable 0-dgram tests on darwin

fix #8023

10 years agopath: fix slice OOB in trim
Lucio M. Tato [Sat, 2 Aug 2014 05:33:35 +0000 (02:33 -0300)]
path: fix slice OOB in trim

Internal function trim(arr). 2nd parameter of slice() should be slice's
end index (not included). Because of function normalize() (called before
trim()), "start" is always zero so the bug -for now- has no effect, but
its a bug waiting to happen.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
10 years agotest: assert cluster.disconnect is async
Sam Roberts [Thu, 31 Jul 2014 23:49:28 +0000 (16:49 -0700)]
test: assert cluster.disconnect is async

See joyent/node#8043, test passed on v0.11 already, but this makes the
test stronger.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
10 years agotls: throw an error, not string
Jackson Tian [Fri, 1 Aug 2014 06:08:52 +0000 (14:08 +0800)]
tls: throw an error, not string

Reviewed-By: Fedor Indutny <fedor@indutny.com>
10 years agocluster: support options in Worker constructor
cjihrig [Thu, 31 Jul 2014 02:20:52 +0000 (22:20 -0400)]
cluster: support options in Worker constructor

This commit moves some common Worker code into the constructor
via support for an options argument.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
10 years agoAdd fast path for simple URL parsing
Gabriel Wicke [Tue, 1 Jul 2014 19:28:49 +0000 (12:28 -0700)]
Add fast path for simple URL parsing

This patch adds a fast path for parsing of simple path-only URLs, as commonly
found in HTTP requests received by a server.

Benchmark results [ms], before / after patch:
/foo/bar              0.008956   0.000418 (fast path used)
http://example.com/   0.011426   0.011437 (normal slow path, no change)

In a simple 'ab' benchmark of a single-threaded web server, this patch
increases the request rate from around 6400 to 7400 req/s.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
10 years agoRevert "Cluster: fix shared handles on Windows"
Fedor Indutny [Thu, 31 Jul 2014 08:38:46 +0000 (12:38 +0400)]
Revert "Cluster: fix shared handles on Windows"

This reverts commit 4e68a28e20b348f3519b359a17fcb941b235202b.

10 years agoCluster: fix shared handles on Windows
Alexis Campailla [Thu, 24 Jul 2014 09:59:00 +0000 (11:59 +0200)]
Cluster: fix shared handles on Windows

This is the Node side of the fix for Node's cluster module on Windows.
https://github.com/joyent/node/issues/7691

The other required part is
https://github.com/joyent/libuv/pull/1384

Windows and Unix return certain socket errors (i.e. EADDRINUSE) at
different times: bind on Windows, and listen on Unix.
In an effort to hide this difference, libuv on Windows stores such
errors in the bind_error field of uv_tcp_t, to defer raising it at
listen time.
This worked fine except for the case in which a socket is shared in
a Node cluster and a bind error occurs.

A previous attempt to fix this (
https://github.com/joyent/libuv/commit/d1e6be1460f555a1f8a4063d7642696aa7238769
https://github.com/joyent/node/commit/3da36fe00e5d85414031ae812e473f16629d8645
) was flawed becaused in an attempt to relay the error at the JS level
it caused the master to start accepting connections.

With this new approach, libuv itself is relaying the bind errors,
providing for a uniform behavior of uv_tcp_listen.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
10 years agorepl: proper `setPrompt()` and `multiline` support
Fedor Indutny [Thu, 31 Jul 2014 08:30:46 +0000 (12:30 +0400)]
repl: proper `setPrompt()` and `multiline` support

fix #8031

10 years agoRevert "repl: fix overwrite for this._prompt"
Fedor Indutny [Thu, 31 Jul 2014 08:12:18 +0000 (12:12 +0400)]
Revert "repl: fix overwrite for this._prompt"

This reverts commit 7166b55015261de8ab69758320f3d9159b3eaadd.

10 years agocluster: test events emit on cluster.worker
Sam Roberts [Mon, 28 Jul 2014 23:53:10 +0000 (16:53 -0700)]
cluster: test events emit on cluster.worker

v0.10 and node docs specific that in a worker, the 'message' and 'error'
event emits on process, and on cluster.worker.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
10 years agotests: fix internet/test-dns.js
Julien Gilli [Wed, 30 Jul 2014 01:06:47 +0000 (18:06 -0700)]
tests: fix internet/test-dns.js

internet/test-dns.js assumes that ::1 always resolves to "localhost" on
all platforms. This is not what happens in reality. Some platforms
resolve it to "ip6-localhost" too. There doesn't seem to be any consensus
on what's the right thing to do. However, most sane platforms will use
either one of these two values.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
10 years agorepl: fix overwrite for this._prompt
Yazhong Liu [Wed, 9 Jul 2014 10:01:05 +0000 (18:01 +0800)]
repl: fix overwrite for this._prompt

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agoMerge remote-tracking branch 'origin/v0.10' into master
Fedor Indutny [Tue, 29 Jul 2014 08:50:49 +0000 (12:50 +0400)]
Merge remote-tracking branch 'origin/v0.10' into master

Conflicts:
doc/api/buffer.markdown
lib/_stream_readable.js
lib/assert.js
lib/buffer.js
lib/child_process.js
lib/http.js
lib/string_decoder.js
lib/zlib.js
node.gyp
test/simple/test-buffer.js
test/simple/test-https-foafssl.js
test/simple/test-stream2-compatibility.js
test/simple/test-tls-server-verify.js

10 years agobuffer: fix sign overflow in `readUIn32BE`
Fedor Indutny [Tue, 29 Jul 2014 08:34:49 +0000 (12:34 +0400)]
buffer: fix sign overflow in `readUIn32BE`

`|` operation takes precendence on `+`, which will result in
`new Buffer('ffffffff', 16).readUInt32BE(0)` returning `-1` instead of
`ffffffff`.

10 years agotests: fix process.kill pid test.
Julien Gilli [Tue, 29 Jul 2014 00:19:03 +0000 (17:19 -0700)]
tests: fix process.kill pid test.

Prevent test-process-kill-pid.js tests suite from sending SIGHUP
to its process group, which was causing the test runner to terminate.

Fix jenkins' jobs for nodejs-master.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
10 years agocluster: enable error/message events using .worker
cjihrig [Fri, 25 Jul 2014 17:11:10 +0000 (13:11 -0400)]
cluster: enable error/message events using .worker

Between 0.11.1 and 0.11.2, the message and error events stopped
being usable via the cluster.worker object. This commit makes
them usable again. Closes #7998.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agoprocess: throw TypeError if kill pid not a number
Sam Roberts [Wed, 23 Jul 2014 21:22:22 +0000 (14:22 -0700)]
process: throw TypeError if kill pid not a number

Currently, invalid usage such as:

    process.kill('SIGTERM')
    process.kill(null)
    process.kill(undefined);

all coerce the pid to 0, and signal the current process.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodeps: backport 60c316 from v8 trunk
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

10 years agoquerystring: do not add sep for empty array
cjihrig [Sat, 19 Jul 2014 05:27:34 +0000 (01:27 -0400)]
querystring: do not add sep for empty array

Currently, stringification of an empty array outputs a single
separator character. This commit causes an empty array to output
the empty string.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agotest: fix test-https-foafssl
Fedor Indutny [Wed, 23 Jul 2014 19:55:24 +0000 (23:55 +0400)]
test: fix test-https-foafssl

10 years agotest: fix test-tls-server-verify
Fedor Indutny [Wed, 23 Jul 2014 19:51:14 +0000 (23:51 +0400)]
test: fix  test-tls-server-verify

fix #7963

10 years agonet: add remoteFamily for socket
Jackson Tian [Wed, 16 Jul 2014 14:04:34 +0000 (22:04 +0800)]
net: add remoteFamily for socket

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agotls: fix to send TLS Alert before socket destroyed
Shigeki Ohtsu [Thu, 17 Jul 2014 14:01:40 +0000 (23:01 +0900)]
tls: fix to send TLS Alert before socket destroyed

When TLS Alert is occured in handshake, ClearOut only write it into
wbio and does not flush to socket. TLS Alert should be written to
socket with EncOut before socket is destroyed within its error
callback.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agogyp: fix ARM build
Maciej Małecki [Wed, 23 Jul 2014 13:24:07 +0000 (15:24 +0200)]
gyp: fix ARM build

According to V8 changelog, `armv7` config variable was replaced by
`arm_version`, with value either '7', '6' or 'default'.

Detect ARMv7 and ARMv6 CPUs and default to 'default'.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agochild_process: do not access stderr when stdio set to 'ignore'
cjihrig [Sun, 20 Jul 2014 02:35:07 +0000 (22:35 -0400)]
child_process: do not access stderr when stdio set to 'ignore'

Currently, checkExecSyncError() attempts to access the contents
of stderr. When stdio is set to 'ignore', this causes a crash.
This commit adds a check on the access of stderr. Closes #7966.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodoc: console.trace takes a message format
Sam Roberts [Sat, 19 Jul 2014 21:34:41 +0000 (14:34 -0700)]
doc: console.trace takes a message format

Documentation claimed it accepted a single label argument, as time and
timeEnd do, which was incorrect.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodeps: update http_parser to 2.3.0
Fedor Indutny [Wed, 23 Jul 2014 19:08:46 +0000 (23:08 +0400)]
deps: update http_parser to 2.3.0

10 years agosrc: export additional startup functions
Dean McNamee [Fri, 18 Jul 2014 07:16:28 +0000 (09:16 +0200)]
src: export additional startup functions

This allows embedders enough control to initialize node, run the
event loop, and cleanly exit (including calling handlers).

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agogyp: fix post-mortem in v0.11
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.

10 years agogyp: fix post-mortem in v0.11
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.

10 years agodeps: backport 4ed5fde4f from v8 upstream
Fedor Indutny [Fri, 21 Dec 2012 17:52:00 +0000 (17:52 +0000)]
deps: backport 4ed5fde4f from v8 upstream

Original commit message:

    Fix x64 MathMinMax for negative untagged int32 arguments.

    An untagged int32 has zeros in the upper half even if it is negative.
    Using cmpq to compare such numbers will incorrectly ignore the sign.

    BUG=164442
    R=mvstanton@chromium.org

    Review URL: https://chromiumcodereview.appspot.com/11665007

    git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@13273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agogyp: do not let `v8dbg_` slip away on osx
Fedor Indutny [Thu, 17 Jul 2014 05:55:07 +0000 (09:55 +0400)]
gyp: do not let `v8dbg_` slip away on osx

Pass `-force_load` to linker when linking to `libv8_base` to preserve
`v8dbg_` symbols, which are useful for debugging.

10 years agotls_wrap: remove unused variable
Brian White [Thu, 17 Jul 2014 04:23:15 +0000 (00:23 -0400)]
tls_wrap: remove unused variable

Closes #7957.

10 years agolib: jslint string_decoder.js
Fedor Indutny [Tue, 15 Jul 2014 08:43:59 +0000 (12:43 +0400)]
lib: jslint string_decoder.js

10 years agostream2: flush extant data on read of ended stream
Chris Dickinson [Wed, 9 Jul 2014 09:16:45 +0000 (02:16 -0700)]
stream2: flush extant data on read of ended stream

A ReadableStream with a base64 StringDecoder backed by only
one or two bytes would fail to output its partial data before
ending. This fix adds a check to see if the `read` was triggered
by an internal `flow`, and if so, empties any remaining data.

fixes #7914.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agocluster: include settings object in 'setup' event
Ryan Graham [Thu, 10 Jul 2014 16:13:27 +0000 (09:13 -0700)]
cluster: include settings object in 'setup' event

Emits on every call to cluster.setupMaster(), even if no new settings
are given. This is because calling cluster.setupMaster() without
arguments (or with an empty options object) results in the settings
being restored to their defaults.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agocluster: allow multiple calls to setupMaster()
Ryan Graham [Fri, 23 May 2014 01:56:18 +0000 (18:56 -0700)]
cluster: allow multiple calls to setupMaster()

Only attributes of 'cluster.settings' will be modified after the first
call, leaving all other cluster initialization alone. Each call that
includes a 'settings' argument triggers a 'setup' event to be emitted.

Instead of each call resetting all values to their defaults, use the
current settings (if any) as the default. This retains setupMaster's
support how cluster.fork() uses setupMaster() to ensure
cluster.settings has been populated.

Update example in docs to use current node coding style and include
an example of progressive configuration.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agotest: fix regress-GH-1726
Fedor Indutny [Sun, 13 Jul 2014 19:15:52 +0000 (23:15 +0400)]
test: fix regress-GH-1726

10 years agosrc: pass the v8::Context to CreateEnvironment
Dean McNamee [Wed, 9 Jul 2014 11:36:50 +0000 (13:36 +0200)]
src: pass the v8::Context to CreateEnvironment

Pass in the v8::Context, instead of creating it
within CreateEnvironment.  This allows callers
to use a pre-existing context.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agochild_process: copy spawnSync() cwd option to proper buffer
cjihrig [Wed, 25 Jun 2014 03:18:00 +0000 (23:18 -0400)]
child_process: copy spawnSync() cwd option to proper buffer

The spawnSync() cwd option was being copied to the incorrect
location. This commit copies to the correct location.

Closes #7824

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agochild_process: handle writeUtf8String error
Fedor Indutny [Sat, 12 Jul 2014 09:35:26 +0000 (12:35 +0300)]
child_process: handle writeUtf8String error

When handling `writeUtf8String` error, return after emitting it.
Otherwise a runtime failure can occur.

fix #7923

10 years agolib: remove and restructure calls to isNaN()
cjihrig [Wed, 9 Jul 2014 01:06:05 +0000 (21:06 -0400)]
lib: remove and restructure calls to isNaN()

Switch condition order to check for null before calling isNaN().
Also remove two unnecessary calls to isNaN() that are already
covered by calls to isFinite(). This commit targets v0.10, as
opposed to #7891, which targets master (suggested by
@bnoordhuis). Closes #7840.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodoc: re-org child_process into async/sync
Ryan Graham [Mon, 7 Jul 2014 23:38:05 +0000 (16:38 -0700)]
doc: re-org child_process into async/sync

Cleaner separation between the traditional non-blocking functions and
the new blocking variants.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agotest: Remove references to customFds
Ryan Graham [Tue, 8 Jul 2014 19:14:58 +0000 (12:14 -0700)]
test: Remove references to customFds

Option has been deprecated since v0.5.11

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodoc: remove customFds mentions
Ryan Graham [Tue, 8 Jul 2014 18:33:50 +0000 (11:33 -0700)]
doc: remove customFds mentions

The feature has been marked as deprecated since v0.5.11.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agolib: noisy deprecation of child_process customFds
Ryan Graham [Tue, 8 Jul 2014 00:04:42 +0000 (17:04 -0700)]
lib: noisy deprecation of child_process customFds

Use a util.deprecate wrapper to issue warnings like any other
deprecated API. The option has been marked as deprecated in the docs
since v0.5.11.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agostreams: set default hwm properly for Duplex
Andrew Oppenlander [Tue, 8 Jul 2014 22:06:40 +0000 (18:06 -0400)]
streams: set default hwm properly for Duplex

Default highWaterMark is now set properly when using stream Duplex's
writableObjectMode and readableObjectMode options.

Added condition to the already existing split objectMode test to ensure
the highWaterMark is being set to the correct default value on both the
ReadableState and WritableState for readableObjectMode and
writableObjectMode.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agocontextify: remove useless header file
Fedor Indutny [Tue, 8 Jul 2014 18:43:48 +0000 (21:43 +0300)]
contextify: remove useless header file

fix #7910

10 years agoreadme: added g++ requirement
John Albietz [Thu, 3 Jul 2014 23:15:46 +0000 (16:15 -0700)]
readme: added g++ requirement

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agomodule: don't require fs several times
Robert Kowalski [Thu, 3 Jul 2014 20:39:29 +0000 (22:39 +0200)]
module: don't require fs several times

As we are going to need fs in any case, just require it at the
beginning of the file.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodoc: added X.json to the LOAD_AS_FILE sudo code
Maurice Butler [Mon, 7 Jul 2014 06:29:59 +0000 (16:29 +1000)]
doc: added X.json to the LOAD_AS_FILE sudo code

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodoc: fix console.assert docs, message is a format
Sam Roberts [Sat, 5 Jul 2014 21:22:45 +0000 (14:22 -0700)]
doc: fix console.assert docs, message is a format

Documentation for console.assert incorrectly described message as a
single message, but it is a format.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agonet: reset `errorEmitted` on reconnect
Ed Umansky [Thu, 3 Jul 2014 00:59:28 +0000 (18:59 -0600)]
net: reset `errorEmitted` on reconnect

Fix for `error` events emitting only once when reconnecting
a single instance of net.Socket.

Fixes joyent/node#7888

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agolint: fix indentation
Trevor Norris [Thu, 3 Jul 2014 04:02:36 +0000 (21:02 -0700)]
lint: fix indentation

10 years agoudp: make it possible to receive empty udp packets
Andrius Bentkus [Wed, 2 Jul 2014 13:24:17 +0000 (15:24 +0200)]
udp: make it possible to receive empty udp packets

A udp packet can have 0 content. In that case nread will be equal to 0,
but addr != NULL.

Add test case for empty data gram packets and fixed test that checked
for OOB when length == 0.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
10 years agodeps: cherry-pick eca441b2 from OpenSSL
Fedor Indutny [Wed, 2 Jul 2014 17:35:50 +0000 (19:35 +0200)]
deps: cherry-pick eca441b2 from OpenSSL

Original commit message:

    bn_exp.c: fix x86_64-specific crash with one-word modulus.

    PR: #3397

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodeps: cherry-pick eca441b2 from OpenSSL
Fedor Indutny [Wed, 2 Jul 2014 17:35:50 +0000 (19:35 +0200)]
deps: cherry-pick eca441b2 from OpenSSL

Original commit message:

    bn_exp.c: fix x86_64-specific crash with one-word modulus.

    PR: #3397

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agotls: better error reporting at cert validation
Fedor Indutny [Mon, 14 Apr 2014 16:08:38 +0000 (20:08 +0400)]
tls: better error reporting at cert validation

fix #7417

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agoconfigure: fix v8 overriding commands on build
Trevor Norris [Wed, 2 Jul 2014 20:32:11 +0000 (13:32 -0700)]
configure: fix v8 overriding commands on build

V8 seems to ignore the default value for want_separate_host_toolset and
would override it at build time. Instead always explicitly set the value.

Fixes #7833

10 years agodoc: fix createCipher description
Brian White [Mon, 30 Jun 2014 15:06:47 +0000 (11:06 -0400)]
doc: fix createCipher description

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
10 years agochild_process: accept uid/gid everywhere
Fedor Indutny [Wed, 2 Jul 2014 11:26:46 +0000 (15:26 +0400)]
child_process: accept uid/gid everywhere

Accept uid/gid option in every execute/spawn call (including
cluster.fork). Add documentation where needed.

fix #7881

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
10 years agoconstants: add O_NONBLOCK constant
Fedor Indutny [Mon, 30 Jun 2014 08:43:47 +0000 (12:43 +0400)]
constants: add O_NONBLOCK constant

It appears that it is defined unconditionally on all supported unixes.

fix #7867 #7855

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
10 years agoRevert "constants: export O_NONBLOCK"
Fedor Indutny [Mon, 30 Jun 2014 08:43:30 +0000 (12:43 +0400)]
Revert "constants: export O_NONBLOCK"

This reverts commit 00890e43fb935c8bc5dc150f0f2c96bc465d8a4d.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
10 years agoRevert "src: fix _XOPEN_SOURCE redefinition warning"
Fedor Indutny [Mon, 30 Jun 2014 08:43:28 +0000 (12:43 +0400)]
Revert "src: fix _XOPEN_SOURCE redefinition warning"

This reverts commit 885142a5edc2c803fa8b9d92b5d0771379237764.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
10 years agonet: don't emit listening if handle is closed
Eli Skeggs [Sat, 28 Jun 2014 05:32:50 +0000 (22:32 -0700)]
net: don't emit listening if handle is closed

Fixes #7834

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
10 years agotest: fix multiple_line problem in match
Yazhong Liu [Tue, 1 Jul 2014 13:35:35 +0000 (21:35 +0800)]
test: fix multiple_line problem in match

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodocs: highlight shell-codes in CONTRIBUTING.md
Ionică Bizău [Mon, 31 Mar 2014 19:06:03 +0000 (22:06 +0300)]
docs: highlight shell-codes in CONTRIBUTING.md

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agoconfigure: better detect windows 'bitness' (WOW64)
Refael Ackermann [Tue, 1 Jul 2014 07:48:28 +0000 (10:48 +0300)]
configure: better detect windows 'bitness' (WOW64)

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agoevents: Output the event that is leaking
Arnout Kazemier [Tue, 1 Jul 2014 06:44:09 +0000 (08:44 +0200)]
events: Output the event that is leaking

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agoRevert "stream: start old-mode read in a next tick"
Fedor Indutny [Mon, 30 Jun 2014 09:06:35 +0000 (13:06 +0400)]
Revert "stream: start old-mode read in a next tick"

This reverts commit 2efe4ab7616669448f873b0417e9aa81221324e2.

10 years agorepl: fix multi-line input
Fedor Indutny [Sat, 7 Jun 2014 06:00:55 +0000 (23:00 -0700)]
repl: fix multi-line input

The refactor in 3ae0b17c broke the multiline input's visual appearence.
While actually switching to this mode, the `...` prefix is not
displayed.

Additionally, account only SyntaxErrors that are happening at the parse
time, everything else should not be switching repl to the multiline
mode.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agostream: only end reading on null, not undefined
Jonathan Reem [Sat, 28 Jun 2014 18:46:42 +0000 (11:46 -0700)]
stream: only end reading on null, not undefined

The [Stream documentation for .push](http://nodejs.org/api/stream.html#stream_readable_push_chunk_encoding)
explicitly states multiple times that null is a special cased value
that indicates the end of a stream. It is confusing and undocumented
that undefined *also* ends the stream, even though in object mode
there is a distinct and important difference.

The docs for Object-Mode also explicitly mention null as the *only*
special cased value, making no mention of undefined.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agozlib: do not crash on write after close
Fedor Indutny [Thu, 12 Jun 2014 04:11:28 +0000 (21:11 -0700)]
zlib: do not crash on write after close

fix #7767

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agohttp: remove unused code block
Fedor Indutny [Thu, 12 Jun 2014 04:38:58 +0000 (21:38 -0700)]
http: remove unused code block

fix #7769

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agonode: fix #7841 by overlooking the spare sourceline
Yazhong Liu [Wed, 25 Jun 2014 13:18:50 +0000 (21:18 +0800)]
node: fix #7841 by overlooking the spare sourceline

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agoutil.h: interface compatibility
Oguz Bastemur [Fri, 13 Jun 2014 09:36:52 +0000 (11:36 +0200)]
util.h: interface compatibility

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agobuffer: construct new buffer from buffer toJSON() output
cjihrig [Fri, 27 Jun 2014 04:07:16 +0000 (00:07 -0400)]
buffer: construct new buffer from buffer toJSON() output

Creating a new buffer from the toJSON() output of another
buffer does not currently work. This commit adds that
support. Closes #7849.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodeps: update libuv to v0.11.26
Fedor Indutny [Fri, 27 Jun 2014 00:44:36 +0000 (04:44 +0400)]
deps: update libuv to v0.11.26

10 years agodns: introduce lookupService function
Saúl Ibarra Corretgé [Fri, 20 Jun 2014 22:43:00 +0000 (00:43 +0200)]
dns: introduce lookupService function

Uses getnameinfo to resolve an address an port into a hostname and
service.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodeps: build v8 with disassembler support
Fedor Indutny [Sat, 17 May 2014 08:42:50 +0000 (12:42 +0400)]
deps: build v8 with disassembler support

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agocrypto: add `honorCipherOrder` argument
Fedor Indutny [Wed, 25 Jun 2014 10:47:59 +0000 (14:47 +0400)]
crypto: add `honorCipherOrder` argument

Add `honorCipherOrder` argument to `crypto.createCredentials`.

fix #7249

10 years agodoc: document `tls.createSecureContext`
Fedor Indutny [Wed, 25 Jun 2014 10:11:09 +0000 (14:11 +0400)]
doc: document `tls.createSecureContext`

10 years agotest: fix tls-client-default-ciphers
Fedor Indutny [Wed, 25 Jun 2014 07:16:08 +0000 (11:16 +0400)]
test: fix tls-client-default-ciphers

The test execution should not depend on the servers running locally.

fix #7832

10 years agodns: send lookup c-ares errors to callback
Chris Dickinson [Thu, 5 Jun 2014 00:26:34 +0000 (17:26 -0700)]
dns: send lookup c-ares errors to callback

Calling dns.lookup with arguments that generate an error from c-ares
previously sent those errors back to the callback. This commit restores
the ca9eb71 behavior.

Fixes #7731.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agomodule: document important methods
Fred K. Schott [Thu, 12 Jun 2014 18:12:54 +0000 (11:12 -0700)]
module: document important methods

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodoc: typos in child_process
Kyle Robinson Young [Sun, 15 Jun 2014 16:04:12 +0000 (09:04 -0700)]
doc: typos in child_process

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agodoc: process: Document process.mainModule
Jan Krems [Sun, 22 Jun 2014 00:09:04 +0000 (17:09 -0700)]
doc: process: Document process.mainModule

Instrumentation code might need to find out the entry point of the
process in a global context.
Documenting the existing process.mainModule to officially support this.

Fixes #7808

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agotls: using %StringSplit to split `cert.subjectaltname`
Yazhong Liu [Sun, 22 Jun 2014 15:34:47 +0000 (23:34 +0800)]
tls: using %StringSplit to split `cert.subjectaltname`

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agochild_process: don't throw on EAGAIN
Charles [Tue, 17 Jun 2014 22:44:11 +0000 (00:44 +0200)]
child_process: don't throw on EAGAIN

Signed-off-by: Fedor Indutny <fedor@indutny.com>
10 years agochild_process: use full path for cmd.exe on Win32
Ed Morley [Tue, 13 May 2014 12:20:36 +0000 (13:20 +0100)]
child_process: use full path for cmd.exe on Win32

Currently child_process.exec() assumes that cmd.exe is on the PATH,
and fails with a spawn ENOENT error if it is not.

The Windows 'comspec' environment variable contains the full filepath
to the default command interpreter, eg "C:\Windows\System32\cmd.exe".
Should it not be set, we fall-back to using 'cmd.exe' from PATH, as
before.

Signed-off-by: Fedor Indutny <fedor@indutny.com>