Commit Graph

10173 Commits (86bb7fa5cdc2f0492ecc2972c00b6805b6be8e9c)

Author SHA1 Message Date
cjihrig 86bb7fa5cd 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>
2014-09-04 15:18:48 -07:00
cjihrig 029cfc12a0 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>
2014-09-03 15:16:16 -07:00
Trevor Norris 9b8837b355 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>
2014-09-03 14:24:50 -07:00
Fedor Indutny 73631bbcc8 tls: support multiple keys/certs
Required to serve website with both ECDSA/RSA certificates.
2014-09-03 17:36:54 +04:00
Fedor Indutny 7343c77cdb 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.
2014-09-03 17:36:54 +04:00
Fedor Indutny 68c14d6923 crypto: use less memory for storing keys
Use `BIO_new_mem_buf` where possible to reduce memory usage and
initialization costs.
2014-09-03 17:36:32 +04:00
Jackson Tian 4bd396a9bf net: Improve Socket.prototype.write()
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-03 04:43:01 -07:00
Trevor Norris a054f8eb29 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>
2014-09-03 03:36:17 -07:00
Trevor Norris 81a9739108 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>
2014-09-02 11:30:45 -07:00
Jesús Leganés Combarro "piranna cdc01faed2 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>
2014-09-02 22:20:52 +04:00
Julien Gilli 90d1147b8b 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>
2014-09-02 22:14:04 +04:00
Brian White fcfe820481 crypto: unsigned value can't be negative
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-02 17:41:30 +04:00
Brian White 16b0a3393e crypto: avoid memory leak
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-02 17:41:21 +04:00
Jackson Tian 92419f8762 src: reading/owner/onread/onconnection for tcp
Initialize fields to avoid Hidden Class creation in runtime.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-02 16:20:56 +04:00
Isaac Burns 53fc14c569 crypto: wrap ECDH constants in HAVE_OPENSSL
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-01 19:30:13 +04:00
Shigeki Ohtsu f6877f37b2 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>
2014-08-29 00:36:51 +04:00
Shigeki Ohtsu 0dfedb7127 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>
2014-08-29 00:36:48 +04:00
Fedor Indutny 6e453fad87 crypto: introduce ECDH 2014-08-29 00:27:09 +04:00
Jackson Tian f7d6147e43 src: Add function name for .byteLength/.compare
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-27 14:13:31 +04:00
Fedor Indutny 6adf3ecebb crypto: allow padding in RSA methods
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
2014-08-27 00:24:57 +04:00
Fedor Indutny 8a7d7f8b2b 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>
2014-08-23 23:22:23 +04:00
Jackson Tian c0f30f6058 http: avoid create difference hidden class
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-21 16:29:52 -07:00
Chris Dickinson 4ef2a5a672 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>
2014-08-20 13:58:12 -07:00
cjihrig 5086d6ef94 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>
2014-08-20 13:51:09 -07:00
Ben Noordhuis 437c2f4383 node: add missing Isolate::Scope at startup
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-19 10:28:06 -07:00
Yazhong Liu 7be96f5285 src: add missing Isolate arguments
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-19 10:23:20 -07:00
Alex Kocharin b9960eefc2 http: fix bailout for writeHead
Reported-by: Jackson Tian <shyvo1987@gmail.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-18 16:21:03 -07:00
Fedor Indutny 9134a3bf41 gyp: preserve v8dbg syms on freebsd too 2014-08-17 14:17:30 +04:00
Alexis Campailla 0d357fa135 test: fix dns test
Fix a few issues in test/internet/test-dns.js:
- 'hint' should be 'hints'
- reverse name lookup is not guaranteed to return 'localhost'
- V4MAPPED hint requires IPV6 address family

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-08-13 11:44:20 -07:00
Julien Gilli 0565d52a71 tests: don't assume IPv4 only in remote addr tests
Tests in test-net-remote-address-port.js assume that client and server
sockets always use IPv4. However, depending on the OS and the network
interfaces setup, this is not true. This change makes the test consider
that both IPv4 or IPv6 sockets are valid

Fixes #8096.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-08-13 11:44:15 -07:00
Fedor Indutny c7b42fe2e5 test: check ipv6 support before testing it
fix #7983
fix #8049

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-08-13 11:43:58 -07:00
Julien Gilli f5f5bd76e6 tests: do not hardcode service name in test-dns.
Instead of hard-coding http service name in test-dns, retrieve it from
/etc/services. This is not ideal, but it's still better than hard-coding
it.

Fixes #8047.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-08-13 11:43:41 -07:00
Julien Gilli 7d1860a678 tests: fix invalid hints flags dns test.
1 is actually a valid flag on SmartOS. More generally, hints flags'
values are defined by the underlying native flags, and these can have
different values on different systems.

Using (ADDRCONFIG | V4MAPPED) + 1 ensure that the flag will be invalid,
since it will always be different from ADDRCONFIG, V4MAPPED, ADDRCONFIG
| V4MAPPED,  0 and any other combination of even flags.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-08-13 11:43:09 -07:00
Cheng Zhao 44743eaf24 src: change kIsolateSlot to 3
The slot 0 and 1 had already been taken by "gin" and "blink" in Chrome,
and the size of isolate's slots is 4 by default, so using 3 should hopefully
make node work independently when embedded into other application.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-08-13 13:58:51 +04:00
Trevor Norris 807acf7f98 src: require EventEmitter via NativeModule
Fixes a recent change causing test-process-kill-pid.js to fail.

Fixes: 931cbc1 "lib: don't use emitter.listeners(type).length"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-08-12 21:50:21 -07:00
Jackson Tian a8845ebd45 dgram: remove new keyword from errnoException
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-12 21:43:20 -07:00
Kyle Robinson Young 00004160a1 doc: typo fixes on stream, tls and http
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-08-12 21:04:41 -07:00
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