Commit Graph

2676 Commits (b444392a98e66b49dfee8c7e36c59d4e7c6ea1ac)

Author SHA1 Message Date
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
Timothy J Fontaine 466a9b5c78 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	src/node_zlib.cc
2014-02-17 20:57:53 -08:00
Farid Neshat 562b015170 debugger: Fix breakpoint not showing after restart
The reason this wasn't working was because after restart, when restoring
breakpoints the scripts wasn't loaded, so the breakpoint.script was
undefined. As a fix I added another check to use breakpoint.scriptReq
instead of breakpoint.script, which is the same except when the
breakpoint is a function.

fixes #7027
2014-02-17 20:47:46 -08:00
Yazhong Liu cfe0bab85b readline: fix `line` event, if input emit 'end'
If an input stream would emit `end` event, like
`fs.createReadStream`, then readline need to get the last line
correctly even though that line isnt ended with `\n`.
2014-02-17 16:21:29 -08:00
Yazhong Liu 3ae0b17c76 repl: REPLServer inherits from readline.Interface
This exposes a setPrompt for and other readline features
2014-02-17 16:04:36 -08:00
Fedor Indutny 829a9b8cba zlib: introduce pending close state
zlib should not crash in `close()` if the write is still in progress.

fix #7101
2014-02-18 01:11:05 +04:00
Fedor Indutny 75ea11fc08 tls: introduce asynchronous `newSession`
fix #7105
2014-02-18 01:07:09 +04:00
Timothy J Fontaine a4436bab7b dgram: pass the bytes sent to the send callback
Fixes #6953
2014-02-15 19:24:42 -08:00
Fedor Indutny 940abd0b19 test: fix tls-honorcipherorder slowness
End accepted stream to prevent client fd from hanging in FIN_WAIT_1
state. The 30 second delay was caused by default non-zero SO_LINGER.
2014-02-16 01:19:54 +04:00
Alexis Campailla bb2af7dd4d test: give repl-timeout-throw more time to run
Short timeout was causing the test to fail on Windows debug builds.
2014-02-13 16:49:15 -08:00
Alexis Campailla 0f10dd4cb2 test: increase timeout in readable stream test
A slightly higher timeout is needed for the test to pass on
Windows debug builds.
2014-02-13 16:49:08 -08:00
Alexis Campailla 8f94ef46b7 test: fix assert in test-http-outgoing-finish
Given the assert message, and the fact that endCb is always true
in the assert, I am pretty sure the test author was intending
to test for finishEvent, not endCb.
2014-02-13 16:46:04 -08:00
Alexis Campailla 527cabefcb test: fix connection reset in http test
In this test, an HTTP server was ending the response before
consuming all the data sent in the PUT request.

Ending the response would cause the socket to be destroyed,
and since there is some data still to be read, an ECONNRESET is
surfaced on the client side, event though the client has already
ended its side and even seen a 'finish' event.

See:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.2

While it is certainly admissible for the server to send a response
before consuming the entire request, it seems reasonable to
expect that the server would close the connection afterwards
and that the ECONNRESET would be raised on the client.

So I have changed the test to wait until the entire request has been
consumed before sending the response.
2014-02-13 16:46:04 -08:00
orangemocha@github.com e7a03f1c62 test: fix test-child-process-double-pipe
On Windows, grep and sed were stripping the CR character out of CRLF.
Passing --binary will force them to preserve the CR.
2014-02-13 16:41:31 -08:00
Timothy J Fontaine e8df267674 child_process: js bits for spawnSync/execSync
This implements the user-facing APIs that lets one run a child process
and block until it exits.

Logic shared with the async counterpart of each function was refactored
to enable code reuse.

Docs and tests are included.
2014-02-10 13:35:37 -08:00
Timothy J Fontaine d58c206862 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	lib/_stream_writable.js
2014-02-10 11:21:09 -08:00