Commit Graph

10099 Commits (7da63a10ac5e3f4c63ed9b2fa6dfdbfa32df4063)

Author SHA1 Message Date
Julien Gilli 7da63a10ac 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>
2014-08-04 13:48:19 -07:00
Herman Lee 20229d6896 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>
2014-08-04 13:39:12 -07:00
Jackson Tian 962e651476 process: improve process binding
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-02 20:14:46 +04:00
Fedor Indutny 47a103a029 test: disable 0-dgram tests on darwin
fix #8023
2014-08-02 15:07:07 +04:00
Lucio M. Tato 37c2a52833 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>
2014-08-02 00:19:20 -07:00
Sam Roberts aab126bb06 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>
2014-08-02 00:07:18 -07:00
Jackson Tian bbb2dccd1b tls: throw an error, not string
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-01 18:10:15 +04:00
cjihrig d287b8e58a 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>
2014-08-01 00:34:40 +04:00
Gabriel Wicke 4b59db008c 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>
2014-07-31 22:56:46 +04:00
Fedor Indutny ff6117b8ed Revert "Cluster: fix shared handles on Windows"
This reverts commit 4e68a28e20.
2014-07-31 12:38:46 +04:00
Alexis Campailla 4e68a28e20 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 (
d1e6be1460
3da36fe00e
) 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>
2014-07-31 12:32:28 +04:00
Fedor Indutny 1a84ba2d66 repl: proper `setPrompt()` and `multiline` support
fix #8031
2014-07-31 12:30:46 +04:00
Fedor Indutny 1a52d6abcc Revert "repl: fix overwrite for this._prompt"
This reverts commit 7166b55015.
2014-07-31 12:12:18 +04:00
Sam Roberts bae019f182 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>
2014-07-31 12:02:39 +04:00
Julien Gilli 0381cf5698 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>
2014-07-30 15:10:05 -07:00
Yazhong Liu 7166b55015 repl: fix overwrite for this._prompt
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-29 12:53:05 +04:00
Fedor Indutny f310c0f16b 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
2014-07-29 12:51:27 +04:00
Fedor Indutny 38f6fcd822 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`.
2014-07-29 12:34:49 +04:00
Julien Gilli ef3c4ed3dd 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>
2014-07-28 18:13:04 -07:00
cjihrig e1fb1b58f9 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>
2014-07-28 18:44:36 +04:00
Sam Roberts 832ec1cd50 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>
2014-07-28 18:30:26 +04:00
Fedor Indutny 9a63a1d89b 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
2014-07-25 02:44:24 +04:00
cjihrig 61ddad1314 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>
2014-07-24 00:41:51 +04:00
Fedor Indutny 338ba2bc80 test: fix test-https-foafssl 2014-07-23 23:55:24 +04:00
Fedor Indutny 93390ffc20 test: fix test-tls-server-verify
fix #7963
2014-07-23 23:51:14 +04:00
Jackson Tian e1ce8ba639 net: add remoteFamily for socket
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-23 23:44:57 +04:00
Shigeki Ohtsu 2bb4867312 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>
2014-07-23 23:43:58 +04:00
Maciej Małecki 300dd3499c 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>
2014-07-23 23:42:22 +04:00
cjihrig ea89fdfec4 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>
2014-07-23 23:39:28 +04:00
Sam Roberts 96b166f291 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>
2014-07-23 23:09:41 +04:00
Fedor Indutny 2f0017aa53 deps: update http_parser to 2.3.0 2014-07-23 23:08:46 +04:00
Dean McNamee ba09409479 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>
2014-07-23 22:47:05 +04:00
Fedor Indutny eba7aae107 gyp: fix post-mortem in v0.11
Expose missing constants and keep symbols on OSX.
2014-07-23 18:56:49 +04:00
Fedor Indutny 4c48df5a35 gyp: fix post-mortem in v0.11
Expose missing constants and keep symbols on OSX.
2014-07-23 16:25:50 +04:00
Fedor Indutny 3530fa9cd0 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>
2014-07-18 14:57:18 +04:00
Fedor Indutny 1d3d8c0e55 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.
2014-07-17 15:16:29 +04:00
Brian White 857975d5e7 tls_wrap: remove unused variable
Closes #7957.
2014-07-16 21:46:26 -07:00
Fedor Indutny 9d9fc3fa30 lib: jslint string_decoder.js 2014-07-15 12:43:59 +04:00
Chris Dickinson a96d6603b3 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>
2014-07-15 12:38:23 +04:00
Ryan Graham 04d6fc2c3f 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>
2014-07-15 00:12:43 +04:00
Ryan Graham b96e38ac3a 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>
2014-07-15 00:12:43 +04:00
Fedor Indutny b692493766 test: fix regress-GH-1726 2014-07-13 23:15:52 +04:00
Dean McNamee da30c0084a 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>
2014-07-13 23:07:46 +04:00
cjihrig c4e5fde362 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>
2014-07-12 12:46:16 +03:00
Fedor Indutny 7f86baf5c7 child_process: handle writeUtf8String error
When handling `writeUtf8String` error, return after emitting it.
Otherwise a runtime failure can occur.

fix #7923
2014-07-12 12:35:26 +03:00
cjihrig b87ca794e3 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>
2014-07-10 15:21:50 +03:00
Ryan Graham 9452ea2ef5 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>
2014-07-10 15:20:33 +03:00
Ryan Graham a7b14f7a89 test: Remove references to customFds
Option has been deprecated since v0.5.11

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-10 15:07:08 +03:00
Ryan Graham feac62d8d6 doc: remove customFds mentions
The feature has been marked as deprecated since v0.5.11.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-07-10 15:07:07 +03:00
Ryan Graham 245469587c 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>
2014-07-10 15:07:07 +03:00