Commit Graph

10236 Commits (b26dd4e5ab9192bad72b9dc61fa4ad2d8f215da2)

Author SHA1 Message Date
Ezequiel Rabinovich 678ead2608 querystring: remove prepended ? from query field
Fixes an issue that caused the first querystring to be parsed prepending
a "?" in the first variable name on relative urls with no #fragment

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-12 20:38:30 -07:00
Jackson Tian 931cbc175f lib: don't use emitter.listeners(type).length
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-12 15:57:13 -07:00
Trevor Norris 0718426506 node: set names for prototype methods
Fix issue where output of a native prototype method would simply print
[Function]. It will now print [Function: name].

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-08-11 17:10:43 -07:00
seishun 42bda05af8 crypto: add RSA encryption
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-11 22:00:34 +04:00
Alexis Campailla 93f3b640d0 windows: fix memory leak in WinapiErrnoException
Fix https://github.com/joyent/node/issues/2341

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-11 18:19:55 +04:00
cjihrig 6ea5d16731 dns: always set variable family in lookup()
Regression occurred that prevented the variable "family" from being set
properly when the lookup() function's "options" parameter was passed a
number instead of an object.

Also included a sanity check by setting the default value of "family" to
a value that will not pass verification.

Fixes: e643fe4 "dns: fix GetAddrInfo assert"
Reviewed-by: Alexis Campailla <alexis@janeasystems.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-08 14:50:49 -07:00
Fedor Indutny 10fa8e3999 openssl: fix keypress requirement in apps on win32
Original source:

http://openssl.6102.n7.nabble.com/PATCH-s-client-Fix-keypress-requirement-with-redirected-input-on-Windows-td46787.html

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-08 20:40:24 +04:00
Thorsten Lorenz b1741ea1fa build: linking CoreFoundation framework for OSX
Linking CoreFoundation for OSX is needed for OSX debugging features to
function properly.

For instance Instruments cannot record Heap Allocations if the
CoreFoundation is not linked.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-08 18:03:04 +04:00
Alexis Campailla 2a415358ee test: fix test-process-kill-pid on Windows
Disabling the part of the test that relies on dispatching SIGHUP,
because sending SIGHUP is not supported on Windows.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-08-07 17:22:53 -07:00
Jackson Tian 4516e6dda4 doc: document max `new Buffer(size)`
Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-08-07 16:47:01 -07:00
Timothy J Fontaine a5778cdf01 Merge remote-tracking branch 'upstream/v0.10' into v0.12
Conflicts:
	ChangeLog
	Makefile
	deps/uv/ChangeLog
	deps/uv/build.mk
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/getaddrinfo.c
	deps/uv/src/version.c
	deps/v8/src/checks.h
	deps/v8/src/isolate.h
	lib/cluster.js
	lib/module.js
	lib/timers.js
	lib/tls.js
	src/node_version.h
2014-08-07 16:33:35 -07:00
Julien Gilli b0277f35bd tests: fix child-process-fork-dgram on SmartOS.
Send messages until both the parent and the child process have received
at least one message. If at least one of them doesn't receive any
message, the test runner will make the test timeout.

Fixes #8046.
2014-08-07 16:06:59 -07:00
Maciej Małecki d6b4766a78 doc: document arguments for 'error' event on a stream
Fixes #6361.
2014-08-07 12:19:33 -07:00
Jackson Tian cc08106d62 fs: fix fs.readFileSync fd leak when get RangeError 2014-08-07 11:27:12 -07:00
Saúl Ibarra Corretgé 28eee0adb7 src: handle UV_EAGAIN in TryWrite
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-07 15:05:04 +04:00
Alexis Campailla 7ca4fa56d0 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-08-07 15:03:54 +04:00
Fedor Indutny e49429ebd2 deps: update libuv to v0.11.28 2014-08-07 15:03:17 +04:00
Fedor Indutny aa3b4b4d10 deps: update openssl to v1.0.1i 2014-08-07 13:36:56 +04:00
Kevin Simper 70cc9968f6 doc: clarify factory methods for net.Socket 2014-08-06 14:46:18 -07:00
Jackson Tian 63a4268218 fs: fs.readFile should not throw uncaughtException
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-05 16:13:07 +04:00
Trevor Norris e643fe4c4b 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>
2014-08-04 18:19:45 -07:00
cjihrig 430678640c 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>
2014-08-04 16:57:18 -07:00
Timothy J Fontaine 53b4accb6e v8: Fix compliation with GCC 4.8
Supresses a very loud warning from GCC 4.8 about unused typedefs

Original url https://codereview.chromium.org/69413002
2014-08-04 15:11:36 -07:00
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
Julien Gilli 6f043940bd timers: fix timers with non-integer delay hanging.
When backporting f8193ab into v0.10, a regression was introduced. Timers
with non-integer timeout could trigger a infinite recursion with 100%
cpu usage. This commit backports 93b0624 which fixes the regression.

After backporting f8193ab, instead of using Date.now(), timers would use
Timer.now() to determine if they had expired. However, Timer.now() is
based on loop->time, which is not updated when a timer's remaining time
is > 0 and < 1. Timers would thus never timeout if their remaining time
was at some point > 0 and < 1.

With this commit, Timer.now() updates loop->time itself, and timers
always timeout eventually.

Fixes #8065 and #8068.
2014-08-04 12:00:40 -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
Sam Roberts 2fd7ee12d9 cluster: disconnect should not be synchronous
Callbacks in node are usually asynchronous, and should never be
sometimes synchronous, and sometimes asynchronous.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-02 00:41:13 -07: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
James Halliday 8e2cc69e78 stream: fix Readable.wrap objectMode falsy values
A streams1 stream will have its falsy values such as 0, false, or ""
eaten by the upgrade to streams2, even when objectMode is enabled.

Include test for said cases.

Reviewed-by: isaacs <i@izs.me>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-01 13:01:23 -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
Jakob Gillich 92518892ec docs: fix non-string ignore note in path.resolve
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-07-31 22:59:30 +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
Timothy J Fontaine 4f2b08c523 Now working on 0.10.31 2014-07-31 11:12:08 -07:00
Timothy J Fontaine 98c69e892c Merge branch 'v0.10.30-release' into v0.10 2014-07-31 11:11:53 -07:00
Timothy J Fontaine bc0ff830af 2014.07.31, Version 0.10.30 (Stable)
* uv: Upgrade to v0.10.28

* npm: Upgrade to v1.4.21

* v8: Interrupts must not mask stack overflow.

* Revert "stream: start old-mode read in a next tick" (Fedor Indutny)

* buffer: fix sign overflow in `readUIn32BE` (Fedor Indutny)

* buffer: improve {read,write}{U}Int* methods (Nick Apperson)

* child_process: handle writeUtf8String error (Fedor Indutny)

* deps: backport 4ed5fde4f from v8 upstream (Fedor Indutny)

* deps: cherry-pick eca441b2 from OpenSSL (Fedor Indutny)

* lib: remove and restructure calls to isNaN() (cjihrig)

* module: eliminate double `getenv()` (Maciej Małecki)

* stream2: flush extant data on read of ended stream (Chris Dickinson)

* streams: remove unused require('assert') (Rod Vagg)

* timers: backport f8193ab (Julien Gilli)

* util.h: interface compatibility (Oguz Bastemur)

* zlib: do not crash on write after close (Fedor Indutny)
2014-07-31 10:24:06 -07:00
Timothy J Fontaine 7169879879 uv: Upgrade to v0.10.28 2014-07-31 09:31:01 -07:00
Fedor Indutny 530af9cb8e v8: Interrupts must not mask stack overflow.
Backport of https://codereview.chromium.org/339883002
2014-07-31 09:26:09 -07:00
Timothy J Fontaine 1223cafea6 npm: Upgrade to v1.4.21 2014-07-31 09:05:30 -07:00
Maciej Małecki 4f1ae11a62 module: eliminate double `getenv()`
`process.env` access results in a synchronous `getenv` call. Cache the
first result instead and save one syscall.
2014-07-31 08:59:46 -07:00
Rod Vagg 9d281934df streams: remove unused require('assert') 2014-07-31 08:58:33 -07:00
Julien Gilli befbbad051 timers: backport f8193ab
Original commit message:

 timers: use uv_now instead of Date.now

 This saves a few calls to gettimeofday which can be expensive, and
 potentially subject to clock drift. Instead use the loop time which
 uses hrtime internally.

In addition to the backport, this commit:
 - keeps _idleStart timers' property which is still set to
   Date.now() to avoid breaking existing code that uses it, even if
   its use is discouraged.
 - adds automated tests. These tests use a specific branch of
   libfaketime that hasn't been submitted upstream yet. libfaketime
   is git cloned if needed when running automated tests.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-07-31 08:53:24 -07: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