Commit Graph

2791 Commits (bbb2dccd1b650db656918f12311f04efa2495ee6)

Author SHA1 Message Date
Fedor Indutny 9920ae67b5 Merge branch 'v0.10'
Conflicts:
	ChangeLog
	lib/events.js
	lib/tls.js
	src/node_constants.cc
	src/node_crypto.cc
	src/node_crypto.h
	src/node_version.h
2014-06-05 07:28:39 -07:00
Michael Kebe 2f8627528b test: remove duplicate tests
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-06-04 17:06:51 -07:00
Raymond Feng 57c5655885 net: Ensure consistent binding to IPV6 if address is absent
See https://github.com/joyent/node/issues/7675
net.server.listen() behaves inconsistently depending on whether the port
number is provided.

1. port === 0 && host == '' (i.e. false-y), node creates an AF_INET
socket but does not call bind().

2. port > 0 && host == '', node creates an AF_INET6 socket and calls
bind().

The fix makes 1 consistent with 2.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-29 02:05:19 +04:00
Ben Noordhuis 13553c1332 test: fix up pummel/test-net-pingpong
Fix up a bad assumption in pummel/test-net-pingpong, namely that binding
to 'localhost' or '' means that incoming connections will have an IPv4
address.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-22 12:51:10 -07:00
Ben Noordhuis a367f62adf child_process: don't throw on EMFILE/ENFILE
EMFILE and ENFILE mean 'out of file descriptors'.  It's a run-time error
and as such should emit an error on the child process object, not throw
an exception.

Fixes #7453.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-22 12:49:59 -07:00
Kevin Decker d0c7d93536 http: Optimize queued client aborts
Avoid sending unsent data and destroying otherwise legitimate sockets
for requests that are aborted while still in the agent queue. This
reduces stress on upstream systems who will likely respond to the
request but client app already knows that it will be dropped on the
floor and also helps avoid killing keep-alive connections.
2014-05-22 10:46:44 -07:00
fengmk2 4729202d1e querystring: custom encode and decode
Not all querystring are utf-8 encoding, make querystring can be used
to encode / decode `non-utf8` encoding string if necessary.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-22 08:21:55 -07:00
Ryan Cole f09b02786f child_process: add path to spawn ENOENT Error
Add a file property to the ENOENT Error returned from ChildProcess's
spawn function.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-22 07:26:15 -07:00
Fedor Indutny 01c2a670a1 contexify: fix infinite recursion in delete cb
Do not ever call `Delete()` on `proxy_global_`, it will invoke
`GlobalPropertyDeleteCallback` and cause crash because of the infinite
recursion.

fix #7529
2014-05-21 17:02:12 -07:00
Timothy J Fontaine 58cc362251 test: rewrite spawnsync test
The spawnsync test was written wrong, the timeout can never fire before
the sync process has returned, the delta is immaterial and times when
it was succeeding are not reliable cases.

Instead verify that the timeout doesn't fire while the sync process is
happening.
2014-05-21 13:14:10 -07:00
cjihrig f1dc55d701 net: don't throw on net.Server.close()
When close() is called on a non-listening server, a synchronous
error is thrown. This commit causes the error to be passed to
the asynchronous callback function instead.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-18 17:59:52 +04:00
Dan Kaplun 655ec2113a readline: fixes scoping bug
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-17 21:11:53 +04:00
Dan Kaplun 4a90f51bfe readline: implements keypress buffering
There was an underlying assumption in readline.emitKeypressEvents (and
by extension emitKey) that the given stream (usually process.stdin)
would emit 'data' once per keypress, which is not always the case.

This commit buffers the input stream and ensures a 'keypress' event is
triggered for every keypress (including escape codes).

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-13 13:36:53 +04:00
Dan Kaplun 52527e03d3 test: fixes test/disabled/test-readline.js
This test is still in test/disabled because it requires a tty, however
when executed directly this test now passes.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-13 13:09:50 +04:00
Greg Sabia Tucker 92875501d2 child_process: spawn() does not throw TypeError
Ensure TypeError is thrown, fix a bug where `env` option was
assuming the option was actually an object.

This case is especially bad because it then sets `env == null`
instead of using `process.env`.

Fix #7456

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-13 12:25:00 +04:00
Trevor Norris b1a44dfe9e buffer: remove Buffer#toArrayBuffer()
A recent change to v8's API now makes it impossible to memcpy to a
v8::ArrayBuffer without causing it to be externalized. This means that
the garbage collector will not automatically free the memory when the
object is collected.

When/If the necessary API is included to allow the above
Buffer#toArrayBuffer() will be reintroduced.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-12 16:58:30 -07:00
Yazhong Liu e1aa066fe1 readline: fix close event of readline.Interface()
Not removing 'end' listeners for input and output on the 'close' event
resulted in an EventEmitter related memory leak.

This issue also might be reproduced at:
https://github.com/npm/npm/issues/5203

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-05-12 14:13:14 -07:00
Refael Ackermann 9b7888ef88 src: fix StringBytes::Write if string is external
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-05-12 14:59:16 +04:00
isaacs f7ede33f09 url: treat \ the same as /
See https://code.google.com/p/chromium/issues/detail?id=25916

Parse URLs with backslashes the same as web browsers, by replacing all
backslashes with forward slashes, except those that occur after the
first # character.

Manual rebase of 9520ade

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-05-07 14:07:00 -07:00
Feross Aboukhadijeh 522dda2f12 buffer: Fix incorrect Buffer.compare behavior
Fixes #7551

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-05-07 13:44:12 -07:00
Ben Noordhuis 17fbdc18b8 lib: name EventEmitter prototype methods
Before this commit the EventEmitter methods were anonymous functions.
V8 tries to infer names for anonymous functions based on the execution
context but it frequently gets it wrong and when that happens, the
stack trace is usually confusing and unhelpful.  This commit names all
methods so V8 can fall back to the method.name property.

The above gotcha applies to all anonymous functions but is exacerbated
for EventEmitter methods because those are invoked with a plenitude of
different receivers.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-05-07 12:11:57 -07:00
Timothy J Fontaine 41d8e10f0d test: http-destroyed-socket-write win32 may ABORT
On windows you can see ECONNABORTED instead of ECONNRESET in various
scenarios, and they are both applicable we're testing that Node is not
swallowing these errors which it was known to do prior to 0.10
2014-05-06 10:45:20 -07:00
Vladimir Kurchatkin 82fca9136d stream: don't try to finish if buffer is not empty
fixes #5715
2014-05-06 06:50:25 -07:00
Alexis Campailla 1ab98a130e test: replace http-destroyed-socket-write
As a comment in the test states: "This test should not be ported to
v0.10 and higher, because the problem is fixed by not ignoring
ECONNRESET in the first place."

The test is checking whether write returns false instead of whether an
ECONNRESET has been raised.

Replace with test-http-destroyed-socket-write2, this test verifies that
ECONNRESET is raised when writing to an http request where the server
has destroyed the socket.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-06 06:44:36 -07:00
Fedor Indutny 8398bf9128 debugger: assign Environment to DebugContext too
fix #7517
2014-05-02 22:12:54 +04:00
Timothy J Fontaine 9479399d3b test: use larger buffer in net-error-twice
Use a larger buffer to ensure that we're still writing when the client
disconnects so the write error is actually raised.
2014-05-02 08:50:48 -07:00
Alexis Campailla 29518c17be test: fix test-http-flush on Windows
On Windows we cannot get the server address until a connection
is accepted.

From MSDN:
The getsockname function does not always return information about
the host address when the socket has been bound to an unspecified
address, unless the socket has been connected with connect or accept
(for example, using ADDR_ANY). A Windows Sockets application must not
assume that the address will be specified unless the socket is
connected.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-02 08:39:47 -07:00
Timothy J Fontaine b19b60a05c Merge remote-tracking branch 'upstream/v0.10'
Reverted 9520adeb37

Conflicts:
	deps/cares/src/ares_parse_txt_reply.c
	deps/uv/.mailmap
	deps/uv/AUTHORS
	deps/uv/ChangeLog
	deps/uv/include/uv.h
	deps/uv/src/unix/error.c
	deps/uv/src/unix/process.c
	deps/uv/src/version.c
	deps/uv/src/win/pipe.c
	deps/uv/src/win/signal.c
	deps/uv/src/win/util.c
	deps/uv/test/test-spawn.c
	deps/uv/vcbuild.bat
	deps/v8/src/platform-posix.cc
	deps/v8/tools/gyp/v8.gyp
	lib/util.js
	src/node.cc
	test/simple/test-util-format.js
	test/simple/test-util.js
2014-05-01 13:54:23 -07:00
Trevor Norris d1fe6857ba buffer: normalize compare() output
Because of differences in memcmp() implementation, normalize output to
return -1, 0 or 1 only.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-05-01 09:40:54 -07:00
Vladimir Kurchatkin d0fc5538d1 stream: split `objectMode` for Duplex
This commit introduces `readableObjectMode` and
`writableObjectMode` options for Duplex streams.
This can be used mostly to make parsers and
serializers with Transform streams.

Also the docs section about stream state objects
is removed, because it is not relevant anymore.
The example from the section is remade to show
new options.

fixes #6284

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-04-30 10:44:31 -07:00
Timothy J Fontaine 7b72e15665 test: update test-dns.js after a60a9b0
resolveTxt now returns a 2-d array for all the chunks string chunks
relating to the record
2014-04-30 09:14:55 -07:00
Shigeki Ohtsu ab7a3d098d child_process: fix assertion error in spawnSync
When ExitCallback was not called with an error such as ENOENT in
uv_spawn, the process handle still remains refed and needs to be closed.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-04-30 09:02:18 -07:00
Ingmar Runge 26a1b712ec crypto: improve error messages
1) ThrowCryptoTypeErrors was not actually used for
   type-related errors. Removed it.
2) For AEAD modes, OpenSSL does not set any internal
   error information if Final does not complete suc-
   cessfully. Therefore, "TypeError:error:00000000:l
   ib(0):func(0):reason(0)" would be the error mess-
   age. Use a default message for these cases.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-29 14:20:14 +04:00
Sean McArthur 226f98a356 buffer: add compare and equals methods
compare() works like String.localeCompare such that:

    Buffer.compare(a, b) === a.compare(b);

equals() does a native check to see if two buffers are equal.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-28 22:09:48 -07:00
Rod Vagg 250782d139 util: format as Error if instanceof Error
Conflicts:
	lib/util.js
	test/simple/test-util-format.js

This is a backport to fix #7253

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-26 00:52:49 +04:00
Denys Zariaiev 681fe599d7 vm: assign Environment to created context
ContextifyContext::CreateV8Context is now create context
with Environment pointer

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-26 00:34:55 +04:00
Ben Noordhuis bd24ab2bd7 http: add request.flush() method
Forcibly flushes the request headers.  You need this with long-lived
HTTP connections where the first data isn't written until the connection
has been established (think: tunneling requests over HTTP CONNECT.)

Fixes #7296.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-24 10:43:51 +04:00
Fedor Indutny 345c40b661 tls: `getPeerCertificate(detailed)`
Add `raw` property to certificate, add mode to output full certificate
chain.
2014-04-18 02:21:16 +04:00
Fedor Indutny b3ef289ffb tls: support OCSP on client and server 2014-04-18 02:21:16 +04:00
isaacs 9520adeb37 url: treat \ the same as /
See https://code.google.com/p/chromium/issues/detail?id=25916

Parse URLs with backslashes the same as web browsers, by replacing all
backslashes with forward slashes, except those that occur after the
first # character.
2014-04-15 15:30:43 -07:00
Vladimir Kurchatkin 2c6b424829 events: check if _events is an own property
Without this check it is possible to have the _events object shared
amongst instances.

Fixes #7157

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-15 13:00:31 -07:00
Trevor Norris c7f424e44b fs: return blksize on stats object
Oversight to not pass blksize to fs.Stats on initialization.

Also added a test to make sure the object property has been set. Since
now on Windows both blksize and blocks will simply be set to undefined.
2014-04-14 16:35:33 -07:00
Fedor Indutny 1bd4f3a605 child_process: fix deadlock when sending handles
Fix possible deadlock, when handles are sent in both direction
simultaneously. In such rare cases, both sides may queue their
`NODE_HANDLE_ACK` replies and wait for them.

fix #7465
2014-04-14 20:15:09 +04:00
goussardg 8e823bcbe6 buffer: return uint if MSB is 1 in readUInt32
Fix issue where a signed integer is returned.

Example:

var b = new Buffer(4);
b.writeUInt32BE(0xffffffff);
b.readUInt32BE(0) == -1

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-10 14:22:05 -07:00
Fedor Indutny 4c36f3e7e6 buffer: truncate buffer after string decode
When our estimates for a storage size are higher than the actual length
of decoded data, the destination buffer should be truncated. Otherwise
`Buffer::Length` will give misleading information to C++ layer.

fix #7365

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-11 01:20:43 +04:00
Fedor Indutny 525fad473b test: remove vm-infinite-recursion
It doesn't work reliably on all platforms.

see #7432

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-11 00:54:12 +04:00
Fedor Indutny 045f765a1a test: add `reuseAddr` in dgram-multicast...
Add `reuseAddr` option in `test-dgram-multicast-multi-process.js`
2014-04-10 19:55:38 +04:00
Fedor Indutny 592be014b6
dgram: introduce `reuseAddr` option
Introduce new signature for both `dgram.createSocket` method and
`dgram.Socket` constructor:

    dgram.createSocket(options, [listener])

Options should contain `type` property and may contain `reuseAddr`
property. When `reuseAddr` is `true` - SO_REUSEADDR will be issued on
socket on bind.

fix #7415

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-04-10 19:39:49 +04:00
Fedor Indutny 3054decc19 test: fix test-crypto 2014-04-08 08:56:12 +04:00
Fedor Indutny f2b297cc7c http: do not emit EOF non-readable socket
Socket may become not `readable`, but http should not rely on this
property and should not think that it means that no data will ever
arrive from it. In fact, it may arrive in a next tick and, since
`this.push(null)` was already called, it will result in a error like
this:

    Error: stream.push() after EOF
        at readableAddChunk (_stream_readable.js:143:15)
        at IncomingMessage.Readable.push (_stream_readable.js:123:10)
        at HTTPParser.parserOnBody (_http_common.js:132:22)
        at Socket.socketOnData (_http_client.js:277:20)
        at Socket.EventEmitter.emit (events.js:101:17)
        at Socket.Readable.read (_stream_readable.js:367:10)
        at Socket.socketCloseListener (_http_client.js:196:10)
        at Socket.EventEmitter.emit (events.js:123:20)
        at TCP.close (net.js:479:12)

fix #6784
2014-04-08 00:40:22 +04:00
Alex Kocharin 42a33c1bb8 domain: don't crash on "throw null"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-02 15:36:30 -07:00
C. Scott Ananian 08a5b442e4 node: add signature to SET_PROTOTYPE_METHOD
This prevents segfaults when a native method is reassigned to a
different object (which corrupts args.This()).  When unwrapping,
clients should use args.Holder() instead of args.This().

Closes #6690.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-04-02 01:48:34 -07:00
Ben Noordhuis c7214fe355 src: fix up after v8 upgrade
The two biggest changes are that v8::Script::New() has been removed and
that a v8::Script object now has to be explicitly bound to a context if
you want to run it from another context.

We can accommodate both changes without breaking the vm module's public
API or even the internal JS API.
2014-04-02 00:05:25 +04:00
Andrew Low f984555d47 test: make test-smalloc endian aware
The test/simple/test-smalloc.js has an implicit assumption
of the byte order of the data stored for Double and Uint32
values. On a big endian platform this test fails without
these patches.

Use os.endianness() to detect the endian of the platform
and use it to gate the static value used for comparison.
2014-04-01 23:17:43 +04:00
Fedor Indutny 5d2aef17ee
crypto: move `createCredentials` to tls
Move `createCredentials` to `tls` module and rename it to
`createSecureContext`. Make it use default values from `tls` module:
`DEFAULT_CIPHERS` and `DEFAULT_ECDH_CURVE`.

fix #7249
2014-03-29 12:01:43 +04:00
Nathan Rajlich 6d15b163b0 http: better client "protocol not supported" error
Include the "expected protocol" in the Error message
string, which evaluates to "http:" for the `http`
core module, and "https:" for the `https` module.

Closes #7355.
2014-03-28 11:05:35 -10:00
Fedor Indutny d24946b1b4 tls: do not call SNICallback unless present
When asynchronously parsing ClientHello for session resumption -
SNICallback may not be set. Check if it is present before invoking
it.

fix #7010
2014-03-27 23:26:52 +04:00
Fedor Indutny ef096f8d8f tls: force readable/writable to `true`
These are an old and deprecated properties that was used by previous
stream implementation, and are still in use in some user-land modules.

Prior to this commit, they were read from the underlying socket, which
may be non-readable/non-writable while connecting or while staying
uninitialized.

Force set them to `true`, just to make sure that there will be no
inconsistency.

fix #7152
2014-03-27 23:25:30 +04:00
Nathan Rajlich 9f23fe1141 http: use defaultAgent.protocol in protocol check
Default to the `defaultAgent.protocol` when comparing the
user-specified `options.protocol` string. This is so that
`http.Agent` instances do not need to specify their own
`protocol` field, since we have the relevant information
already from the `defaultAgent`.

Note that the test case could be separately cherry-picked
to the `v0.10` branch, since it already passes correctly.

Fixes #7349.
Fixes the regression described in: http://git.io/2ds-WQ
2014-03-24 12:59:31 -10:00
Fedor Indutny b76a1ff940 vm: share security token between contexts
By default, each `v8::Context` has a different Security Token, which
prevents access to one context from another.

fix #7140
2014-03-21 16:16:58 +04:00
Timothy J Fontaine ee4b9b552d test: update our branched weakref to v8 3.24 2014-03-17 10:19:47 -07:00
Ben Noordhuis 1f17f88071 src, test: fix up ObjectWrap, `make test-addons`
V8 was upgraded from 3.22 to 3.24 in commit 1c7bf24.  Upgrade source
files in test/addons/ and automatically generated tests from
doc/api/addons.markdown to the new V8 API.

This coincidentally fixes a bug in src/node_object_wrap.h where it was
still using the old V8 weak persistent handle interface, which is gone
in 3.24.
2014-03-14 00:41:04 +04:00
Fedor Indutny ce04c726a3 src: update to v8 3.24 APIs 2014-03-13 20:56:55 +04:00
Yazhong Liu 93c3674ff7 readline: consider newlines for cursor position
Fixes #7266.
Closes #7279.
2014-03-12 14:47:17 -03:00
Bryan Cantrill e496707d39 mdb_v8: update to latest version
* ::jsstack -v prints function defintion
 * ::jsprint works with objects with only numeric properties
 * update tests to use builtin mdb_v8
 * add more symbols to postmortem script - pending upstream
   inclusion
2014-03-10 19:12:14 -07:00
Timothy J Fontaine b444392a98 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	src/node.cc
	src/node.js
	test/message/max_tick_depth_trace.out
2014-03-10 16:50:00 -07:00
Fedor Indutny f0d870501e crypto: do not lowercase cipher/hash names
`crypto.getCiphers()` and `crypto.getHashes()` should prefer lower-case
variants of names, but should not introduce them.

fix #7282
2014-03-11 01:08:43 +04:00
Timothy J Fontaine a18c9b7dde test: timers-ordering should be more precise
Internally we use hrtime to schedule when a timer will fire, to avoid
the perils of clock drift or other external operation making time go
backward. The timers ordering test should use the same timing mechanism
2014-03-10 14:01:24 -07:00
Vladimir Kurchatkin e108ff4da7 buffer: fix typo in `SlowBuffer` 2014-03-10 13:23:56 -07:00
Brian White 68bfa91af7 buffer: allow toString to accept Infinity for end 2014-03-10 13:20:28 -07:00
Benoit Vallée a9d24fa40d test: test sending a handle twice
Added test-cluster-send-handle-twice.js testing to send a handle
twice to the parent process.
2014-03-05 09:36:32 -08:00
Brian White 31ce34887f crypto: allow setting add'l authenticated data 2014-03-04 12:42:03 +04:00
Greg Brail 6eb4d1d15c timer: don't reschedule timer bucket in a domain
If two timers run on the same tick, and the first timer uses a domain,
and then catches an exception and disposes of the domain, then the
second timer never runs. (And even if the first timer does not dispose
of the domain, the second timer could run under the wrong domain.)

This happens because timer.js uses "process.nextTick()" to schedule
continued processing of the timers for that tick. However, there was
an exception inside a domain, then "process.nextTick()" runs under
the domain of the first timer function, and will do nothing if
the domain has been disposed.

To avoid this, we temporarily save the value of "process.domain"
before calling nextTick so that it does not run inside any domain.
2014-03-03 17:46:49 -08:00
Timothy J Fontaine 06453a94a7 src: domain should not replace nextTick function
Previously if you cached process.nextTick and then require('domain')
subsequent nextTick() calls would not be caught because enqueued
functions were taking the wrong path. This keeps nextTick to a single
function reference and changes the implementation details after domain
has been required.
2014-03-03 16:27:58 -08:00
Fedor Indutny 78d245f5b2 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	configure
	lib/_stream_readable.js
	lib/http.js
	src/node_dtrace.cc
2014-03-02 23:54:19 +04:00
Sam Roberts 37d3c56c0b doc: document `beforeExit` and add more tests 2014-02-28 15:36:22 +04:00
Ben Noordhuis a2eeb43ded src: emit 'beforeExit' event on process object
Unlike the 'exit' event, this event allows the user to schedule more
work and thereby postpone the exit.  That also means that the
'beforeExit' event may be emitted many times, see the attached test
case for an example.

Refs #6305.
2014-02-28 14:43:30 +04:00
Nathan Rajlich 0a5d8ca197 test: update "http-*" tests to only use public API
Don't invoke the `agent.requst()` or `agent.get()` functions
directly. Instead, use the public API and pass the agent
instance in as the `agent` option.
2014-02-26 13:19:06 -08:00
Nathan Rajlich d307bebec4 test: add failing http `agent: null` test
See #7012.
2014-02-26 13:05:56 -08:00
Nathan Rajlich 47abdd9c43 test: add `agent: null` http client request test
This is just the test portion from #7012 / #7189,
but targetted for the v0.10 branch.
2014-02-26 11:39:53 -08:00
Nathan Rajlich 0a01a42e87 http: invoke createConnection when no agent
This makes it so that the user may pass in a
`createConnection()` option, and they don't have
to pass `agent: false` at the same time.

Also adding a test for the `createConnection` option,
since none was in place before.

See #7014.
2014-02-26 11:14:32 -08:00
Trevor Norris 846f304fa8 test: fix async-listener-run-error-once
Rely on defined order of operations by closing the server and
destorying the client socket, instead of when setImmediate fires
2014-02-26 10:38:13 -08:00
Alexis Campailla 20176a9841 src: make stdout/sterr pipes blocking
Expose `setBlocking` on Pipe's and if a pipe is being created for stdio
on windows then make the pipes blocking.

This fixes test-stream2-stderr-sync.js on Windows.

Fixes #3584
2014-02-26 10:36:58 -08:00
Alexis Campailla c1bb886990 test: remove invalid part of stream2-stderr-sync
One test case in test-stream2-stderr-sync.js was creating a TTY
object using an undocumented constructor and passing in fd 2.
However, this is running in a child process and fd 2 is actually
a pipe, not a TTY.

The constructor fails on Windows and causes the handle type to be
left uninitialized, which later causes an assert to fail.

On Unix, the constructor fails to retrieve the windows size but unlike
on Windows, it just leaves the size fields undefined and continues
with initializing the stream type, yielding a semi-usable object.

I could make the Windows version match Unix behavior, but it
seems to me that the test is relying on an implementation detail of
an undocumented API, and the Unix behavior is not necessarily more
correct than the Windows one. Thus it makes more sense to remove this
test.
2014-02-26 10:36:23 -08:00
Timothy J Fontaine 98a0909da0 test: internet/test-dns disable implicit ipv6
This ends up being too difficult to test across different deployments
2014-02-25 13:44:37 -08:00
Timothy J Fontaine 67dfcd55be test: pummel/net-connect-econnrefused backoff
We were trying too hard to connect, and getting timeouts instead of
the refusals, slow down how hard we try.
2014-02-25 11:58:33 -08:00
Timothy J Fontaine d2952cce36 test: migrate pummel/keep-alive to wrk 2014-02-25 11:28:45 -08:00
Mike Pennisi aae51ecf7d assert: Ensure reflexivity of deepEqual
Ensure that the behavior of `assert.deepEqual` does not depend on
argument ordering  when comparing an `arguments` object with a
non-`arguments` object.
2014-02-25 20:32:49 +04:00
Timothy J Fontaine de56ffa58b test: pummel/*ci-reneg* handle EPIPE
When calling out to the openssl client handle the child closing and
returning EPIPE on writes
2014-02-24 18:38:41 -08:00
Timothy J Fontaine 265fdc8e91 test: internet/test-dns handle ESERVFAIL
ESERVFAIL is also an acceptable error code when failing to resolve a
domain.
2014-02-24 17:53:57 -08:00
Timothy J Fontaine 78a854f872 test: move pummel/test-fs-largefile to disabled
This test is particularly pathological, and requires a ton of time to
run, we need to find a better way to manage it but in general this path
is fairly safe these days.
2014-02-24 17:03:28 -08:00
Timothy J Fontaine 95bb347d6c test: pummel/test-net-throttle adhere to streams
bufferSize is now a getter that shows all that has not been
acknowledged by the os, as well as in the buffer state. The test is
only looking to verify the js verified state.
2014-02-24 16:55:35 -08:00
Timothy J Fontaine 3a3b7488b5 test: pummel fs-watch-file-slow handle spurious
watch file will now generate an empty event when the file doesn't exist
initially
2014-02-24 16:54:04 -08:00
Timothy J Fontaine e324717f8d test: remove next-tick-loops-quick
Scheduling of next ticks from within the next tick handler will result
in a tight execution loop where a timer cannot break into.

This test was invalid
2014-02-24 16:34:01 -08:00
Timothy J Fontaine af1418325b test: backoff client connection rates
We were being very aggressive in our connection creations, resulting
in the pipeline flood detection to drop us. Relax how fast we're
creating these connections so the gc can run all its tests.
2014-02-24 11:52:47 -08:00
David Björklund b105997193 http: avoid duplicate keys in writeHead
Use setHeader in writeHead to avoid sending duplicate headers

Fixes #5036
2014-02-19 09:24:16 -08:00
Timothy J Fontaine 3e6e63406d test: make test-net-error-twice less racey 2014-02-18 13:10:09 -08:00
Timothy J Fontaine 937e2e351b child_process: execFileSync stderr should inherit
If you don't set your options.stdio for execSync and execFileSync
capture and write to stderr of the parent process by default.

Fixes #7110
2014-02-18 16:03:13 +04:00
Timothy J Fontaine 59baab2776 net: add localPort to connect options
Expose localPort for binding to a specific port for outbound
connections.

If localAddress is not specified '0.0.0.0' is used for ip4 and '::'
for ip6 connections.

Fixes #7092
2014-02-18 15:55:04 +04:00
Brian White a226be4f76 crypto: allow custom generator for DiffieHellman 2014-02-18 15:49:23 +04:00