platform/upstream/nodejs.git
10 years agocrypto: fix CipherFinal return value check
Brian White [Mon, 3 Mar 2014 05:25:11 +0000 (00:25 -0500)]
crypto: fix CipherFinal return value check

10 years agoMerge remote-tracking branch 'origin/v0.10'
Fedor Indutny [Sun, 2 Mar 2014 19:54:19 +0000 (23:54 +0400)]
Merge remote-tracking branch 'origin/v0.10'

Conflicts:
configure
lib/_stream_readable.js
lib/http.js
src/node_dtrace.cc

10 years agosmalloc: remove `env.h` include
Fedor Indutny [Fri, 28 Feb 2014 16:52:32 +0000 (20:52 +0400)]
smalloc: remove `env.h` include

Since `smalloc.h` is included in a `node_buffer.h`, including private
headers in it is strictly prohibited.

fix #7206

10 years agonode: invoke `beforeExit` again if loop was active
Fedor Indutny [Fri, 28 Feb 2014 13:25:28 +0000 (17:25 +0400)]
node: invoke `beforeExit` again if loop was active

When `setImmediate(cb)` is called in `beforeExit` event handler the
consequent `uv_run(..., UV_RUN_NOWAIT)` may return `0`, even if there
was some active handles at start.

Fixes simple/test-beforeexit-event.js.

10 years agostream_wrap: don't write twice on uv_try_write err
Fedor Indutny [Fri, 28 Feb 2014 08:14:05 +0000 (12:14 +0400)]
stream_wrap: don't write twice on uv_try_write err

fix #7155

10 years agodoc: document `beforeExit` and add more tests
Sam Roberts [Fri, 25 Oct 2013 21:05:39 +0000 (14:05 -0700)]
doc: document `beforeExit` and add more tests

10 years agosrc: emit 'beforeExit' event on process object
Ben Noordhuis [Mon, 7 Oct 2013 13:39:39 +0000 (15:39 +0200)]
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.

10 years agosrc: use new loop API
Saúl Ibarra Corretgé [Fri, 28 Feb 2014 09:17:32 +0000 (10:17 +0100)]
src: use new loop API

uv_loop_new and uv_loop_delete are considered deprecated now.

10 years agosrc: spawn_sync should close handles upon exit
Saúl Ibarra Corretgé [Thu, 27 Feb 2014 02:14:14 +0000 (18:14 -0800)]
src: spawn_sync should close handles upon exit

When the exit callback is fired for the child process we should close
the handle associated with it.

10 years agosrc: update to latest libuv api
Timothy J Fontaine [Wed, 26 Feb 2014 23:24:03 +0000 (15:24 -0800)]
src: update to latest libuv api

libuv gyp builds now require you to define the library disposition
(static or shared).

Also, libuv now supports vectored IO for file system reads and writes,
update to those function signatures

10 years agouv: Upgrade to v0.11.21
Timothy J Fontaine [Thu, 27 Feb 2014 02:08:30 +0000 (18:08 -0800)]
uv: Upgrade to v0.11.21

10 years agohttp: remove the circular dependency
Nathan Rajlich [Tue, 25 Feb 2014 22:19:25 +0000 (14:19 -0800)]
http: remove the circular dependency

Between `ClientRequest` and `Agent`. The circular require was doing
weird things at load time, like making the `globalAgent` property
be `undefined` from within the context of the "_http_client"
module.

Removing the circular dependency completely fixes this.

This commit effectively removes the undocumented `Agent#request()`
and `Agent#get()` functions.

10 years agotest: update "http-*" tests to only use public API
Nathan Rajlich [Tue, 25 Feb 2014 22:18:43 +0000 (14:18 -0800)]
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.

10 years agohttp, https: don't depend on `globalAgent`
Nathan Rajlich [Tue, 25 Feb 2014 22:15:02 +0000 (14:15 -0800)]
http, https: don't depend on `globalAgent`

For the `request()` and `get()` functions. I could never
really understand why these two functions go through agent
first... Especially since the user could be passing `agent: false`
or a different Agent instance completely, in which `globalAgent`
will be completely bypassed.

Moved the relevant logic from `Agent#request()` into the
`ClientRequest` constructor.

Incidentally, this commit fixes #7012 (which was the original
intent of this commit).

10 years agotest: add failing http `agent: null` test
Nathan Rajlich [Wed, 26 Feb 2014 21:05:56 +0000 (13:05 -0800)]
test: add failing http `agent: null` test

See #7012.

10 years agotest: add `agent: null` http client request test
Nathan Rajlich [Wed, 26 Feb 2014 19:39:53 +0000 (11:39 -0800)]
test: add `agent: null` http client request test

This is just the test portion from #7012 / #7189,
but targetted for the v0.10 branch.

10 years agohttp: invoke createConnection when no agent
Nathan Rajlich [Wed, 26 Feb 2014 02:17:35 +0000 (18:17 -0800)]
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.

10 years agotest: fix async-listener-run-error-once
Trevor Norris [Wed, 26 Feb 2014 18:33:21 +0000 (10:33 -0800)]
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

10 years agosrc: make stdout/sterr pipes blocking
Alexis Campailla [Wed, 26 Feb 2014 14:03:59 +0000 (15:03 +0100)]
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

10 years agotest: remove invalid part of stream2-stderr-sync
Alexis Campailla [Thu, 16 Jan 2014 12:17:01 +0000 (04:17 -0800)]
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.

10 years agotls: stop NodeBIO::Gets from reading off end of buffer
Maxwell Krohn [Tue, 25 Feb 2014 20:48:31 +0000 (15:48 -0500)]
tls: stop NodeBIO::Gets from reading off end of buffer

NodeBIO::Gets was reading off the end of a buffer if it
didn't find a "\n" before the EOF.  This behavior
was causing X509 certificates passed to `https.Agent`
via the "ca" option to be silently discarded. It also
was causing improper parsing of certs and keys
passed to https.Agent, but those problems were worked
around in cdde9a3.

Backed out workaround in `lib/crypto.js` from ccde9a3,
which now isn't needed.  But keep the test introduced
in that commit, which tests properly for this
bug.

This bug was first introduced in a58f93f

Gist containing test code, bisection log, and notes:
   https://gist.github.com/maxtaco/9211605

10 years agowindows: fix module registration
Alexis Campailla [Tue, 25 Feb 2014 17:57:43 +0000 (18:57 +0100)]
windows: fix module registration

The linker was optimizing the static variables that were supposed
to trigger module initialization.

I am making them non-static, and dllexport so that they don't get
optimized away.

Fixes #7116

10 years agonet: fix listening on FDs on Windows
Alexis Campailla [Mon, 24 Feb 2014 17:28:49 +0000 (09:28 -0800)]
net: fix listening on FDs on Windows

Fix a bug introduced by 3da36fe of a missed early return of a handle
that needed to be passed to listen.

Fixes test-net-listen-fd0.js on Windows

10 years agotest: internet/test-dns disable implicit ipv6
Timothy J Fontaine [Tue, 25 Feb 2014 21:24:16 +0000 (13:24 -0800)]
test: internet/test-dns disable implicit ipv6

This ends up being too difficult to test across different deployments

10 years agotest: pummel/net-connect-econnrefused backoff
Timothy J Fontaine [Tue, 25 Feb 2014 19:32:01 +0000 (11:32 -0800)]
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.

10 years agobenchmark: update to use new wrk
Timothy J Fontaine [Tue, 25 Feb 2014 19:05:54 +0000 (11:05 -0800)]
benchmark: update to use new wrk

10 years agowrk: compile on sunos
Timothy J Fontaine [Tue, 25 Feb 2014 04:59:39 +0000 (20:59 -0800)]
wrk: compile on sunos

10 years agowrk: build against our distributed ssl
Timothy J Fontaine [Tue, 25 Feb 2014 04:20:25 +0000 (20:20 -0800)]
wrk: build against our distributed ssl

10 years agotools: wrk update to 5b2fa06
Timothy J Fontaine [Tue, 25 Feb 2014 03:49:45 +0000 (19:49 -0800)]
tools: wrk update to 5b2fa06

10 years agotest: migrate pummel/keep-alive to wrk
Timothy J Fontaine [Tue, 25 Feb 2014 03:40:47 +0000 (19:40 -0800)]
test: migrate pummel/keep-alive to wrk

10 years agoassert: Ensure reflexivity of deepEqual
Mike Pennisi [Mon, 24 Feb 2014 19:16:40 +0000 (14:16 -0500)]
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.

10 years agotest: pummel/*ci-reneg* handle EPIPE
Timothy J Fontaine [Tue, 25 Feb 2014 02:38:41 +0000 (18:38 -0800)]
test: pummel/*ci-reneg* handle EPIPE

When calling out to the openssl client handle the child closing and
returning EPIPE on writes

10 years agotest: internet/test-dns handle ESERVFAIL
Timothy J Fontaine [Tue, 25 Feb 2014 01:53:57 +0000 (17:53 -0800)]
test: internet/test-dns handle ESERVFAIL

ESERVFAIL is also an acceptable error code when failing to resolve a
domain.

10 years agotest: move pummel/test-fs-largefile to disabled
Timothy J Fontaine [Tue, 25 Feb 2014 01:03:28 +0000 (17:03 -0800)]
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.

10 years agotest: pummel/test-net-throttle adhere to streams
Timothy J Fontaine [Tue, 25 Feb 2014 00:55:35 +0000 (16:55 -0800)]
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.

10 years agotest: pummel fs-watch-file-slow handle spurious
Timothy J Fontaine [Tue, 25 Feb 2014 00:54:04 +0000 (16:54 -0800)]
test: pummel fs-watch-file-slow handle spurious

watch file will now generate an empty event when the file doesn't exist
initially

10 years agotest: remove next-tick-loops-quick
Timothy J Fontaine [Tue, 25 Feb 2014 00:34:01 +0000 (16:34 -0800)]
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

10 years agosrc: node.cc use isolate->ThrowException
Alexis Campailla [Mon, 24 Feb 2014 18:55:27 +0000 (10:55 -0800)]
src: node.cc use isolate->ThrowException

Environment doesn't have ThrowException, we meant isolate here.

Introduced in commit
75adde07f9a2de7f38a67bec72bd377d450bdb52.

10 years agotest: backoff client connection rates
Timothy J Fontaine [Mon, 24 Feb 2014 18:20:30 +0000 (10:20 -0800)]
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.

10 years agostream: remove useless check
Brian White [Sun, 23 Feb 2014 19:00:28 +0000 (14:00 -0500)]
stream: remove useless check

10 years agodoc: update assert.markdown
Nicolas Talle [Sat, 22 Feb 2014 15:02:10 +0000 (16:02 +0100)]
doc: update assert.markdown

Update assert.throws() and assert.doesNotThrow() docs

10 years agonode_internals: add missing env-inl.h include
Fedor Indutny [Fri, 21 Feb 2014 23:35:29 +0000 (03:35 +0400)]
node_internals: add missing env-inl.h include

10 years agosrc: remove `node_isolate` from source
Fedor Indutny [Fri, 21 Feb 2014 13:02:42 +0000 (17:02 +0400)]
src: remove `node_isolate` from source

fix #6899

10 years agodebugger: don't set the `repl.prompt` string
Nathan Rajlich [Fri, 21 Feb 2014 06:13:41 +0000 (22:13 -0800)]
debugger: don't set the `repl.prompt` string

It wasn't doing anything, and actually due to
3ae0b17c76f693dd2e68a46f78c7dc7f595b33c6, it was causing
the readline `prompt()` function to be overwritten
which throws an error in the REPL shortly after.

10 years agoinstaller: copy `node.d` only with node_use_dtrace
Fedor Indutny [Thu, 20 Feb 2014 21:03:03 +0000 (01:03 +0400)]
installer: copy `node.d` only with node_use_dtrace

10 years agodtrace: workaround linker bug on FreeBSD
Fedor Indutny [Thu, 20 Feb 2014 20:56:17 +0000 (00:56 +0400)]
dtrace: workaround linker bug on FreeBSD

10 years agoconfigure: allow --with-dtrace on freebsd
Fedor Indutny [Thu, 20 Feb 2014 17:00:29 +0000 (21:00 +0400)]
configure: allow --with-dtrace on freebsd

10 years agogyp: specialize node.d for freebsd
Fedor Indutny [Thu, 20 Feb 2014 16:52:26 +0000 (20:52 +0400)]
gyp: specialize node.d for freebsd

`node.d` should use `psinfo.d` instead of `procfs.d` and have statically
defined architecture on FreeBSD.

10 years agohttp: avoid duplicate keys in writeHead
David Björklund [Mon, 10 Feb 2014 18:56:09 +0000 (19:56 +0100)]
http: avoid duplicate keys in writeHead

Use setHeader in writeHead to avoid sending duplicate headers

Fixes #5036

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Wed, 19 Feb 2014 17:12:32 +0000 (09:12 -0800)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
AUTHORS
ChangeLog
deps/uv/AUTHORS
deps/uv/ChangeLog
deps/uv/build.mk
deps/uv/src/unix/linux-core.c
deps/uv/src/unix/stream.c
deps/uv/src/unix/sunos.c
deps/uv/src/version.c
src/node_version.h

10 years agotools: update to support separate website repo
Timothy J Fontaine [Wed, 19 Feb 2014 02:57:45 +0000 (18:57 -0800)]
tools: update to support separate website repo

10 years agoNow working on v0.10.27
Timothy J Fontaine [Wed, 19 Feb 2014 00:43:12 +0000 (16:43 -0800)]
Now working on v0.10.27

10 years agoMerge branch 'v0.10.26-release' into v0.10
Timothy J Fontaine [Wed, 19 Feb 2014 00:40:23 +0000 (16:40 -0800)]
Merge branch 'v0.10.26-release' into v0.10

10 years agobuild: readd missing installer resources v0.10.26
Timothy J Fontaine [Tue, 18 Feb 2014 23:34:29 +0000 (15:34 -0800)]
build: readd missing installer resources

This were accidentally moved during the website refactor

10 years ago2014.02.18, Version 0.10.26 (Stable)
Timothy J Fontaine [Tue, 18 Feb 2014 22:55:58 +0000 (14:55 -0800)]
2014.02.18, Version 0.10.26 (Stable)

* uv: Upgrade to v0.10.25 (Timothy J Fontaine)

* npm: upgrade to 1.4.3 (isaacs)

* v8: support compiling with VS2013 (Fedor Indutny)

* cares: backport TXT parsing fix (Fedor Indutny)

* crypto: throw on SignFinal failure (Fedor Indutny)

* crypto: update root certificates (Ben Noordhuis)

* debugger: Fix breakpoint not showing after restart (Farid Neshat)

* fs: make unwatchFile() insensitive to path (iamdoron)

* net: do not re-emit stream errors (Fedor Indutny)

* net: make Socket destroy() re-entrance safe (Jun Ma)

* net: reset `endEmitted` on reconnect (Fedor Indutny)

* node: do not close stdio implicitly (Fedor Indutny)

* zlib: avoid assertion in close (Fedor Indutny)

10 years agodocs: clarify process.stdin and old mode
Anton Khlynovskiy [Mon, 8 Jul 2013 17:09:44 +0000 (21:09 +0400)]
docs: clarify process.stdin and old mode

10 years agodoc: stdout blocking or non-blocking behaviour
Pedro Ballesteros [Mon, 17 Feb 2014 15:22:05 +0000 (16:22 +0100)]
doc: stdout blocking or non-blocking behaviour

Makes clear that the behaviour of stdout is blocking
in Linux/Unix even when they refer to pipes.

10 years agotest: make test-net-error-twice less racey
Timothy J Fontaine [Tue, 18 Feb 2014 21:09:41 +0000 (13:09 -0800)]
test: make test-net-error-twice less racey

10 years agouv: Upgrade to v0.10.25
Timothy J Fontaine [Tue, 18 Feb 2014 21:04:29 +0000 (13:04 -0800)]
uv: Upgrade to v0.10.25

10 years agodoc: mention objectMode for Writable streams
Raynos [Tue, 21 May 2013 21:10:34 +0000 (15:10 -0600)]
doc: mention objectMode for Writable streams

10 years agoos: networkInterfaces include scopeid for ipv6
Xidorn Quan [Tue, 18 Feb 2014 18:10:30 +0000 (10:10 -0800)]
os: networkInterfaces include scopeid for ipv6

10 years agochild_process: execFileSync stderr should inherit
Timothy J Fontaine [Tue, 18 Feb 2014 00:29:23 +0000 (16:29 -0800)]
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

10 years agonet: add localPort to connect options
Timothy J Fontaine [Tue, 18 Feb 2014 01:30:12 +0000 (17:30 -0800)]
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

10 years agocrypto: allow custom generator for DiffieHellman
Brian White [Tue, 18 Feb 2014 01:57:08 +0000 (20:57 -0500)]
crypto: allow custom generator for DiffieHellman

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Tue, 18 Feb 2014 04:57:53 +0000 (20:57 -0800)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
src/node_zlib.cc

10 years agodebugger: Fix breakpoint not showing after restart
Farid Neshat [Sat, 15 Feb 2014 03:30:30 +0000 (11:30 +0800)]
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

10 years agobuild: don't enable gc-sections
Timothy J Fontaine [Tue, 18 Feb 2014 04:29:30 +0000 (20:29 -0800)]
build: don't enable gc-sections

In some scenarios this will strip the DOF sections for DTrace, and in a
future world where we re-export all static libraries it would defeat
that purpose.

10 years agonpm: upgrade to 1.4.3
isaacs [Mon, 17 Feb 2014 04:43:16 +0000 (20:43 -0800)]
npm: upgrade to 1.4.3

10 years agolint: fix missing semi colon in repl
Timothy J Fontaine [Tue, 18 Feb 2014 00:17:20 +0000 (16:17 -0800)]
lint: fix missing semi colon in repl

10 years agoreadline: fix `line` event, if input emit 'end'
Yazhong Liu [Wed, 22 Jan 2014 01:53:23 +0000 (09:53 +0800)]
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`.

10 years agorepl: remove a unnecessary concatenation
Yazhong Liu [Mon, 17 Feb 2014 22:59:28 +0000 (14:59 -0800)]
repl: remove a unnecessary concatenation

10 years agorepl: REPLServer inherits from readline.Interface
Yazhong Liu [Sat, 15 Feb 2014 14:21:26 +0000 (22:21 +0800)]
repl: REPLServer inherits from readline.Interface

This exposes a setPrompt for and other readline features

10 years agocrypto: make NewSessionDoneCb public
Fedor Indutny [Mon, 17 Feb 2014 22:47:33 +0000 (02:47 +0400)]
crypto: make NewSessionDoneCb public

Generic friend classes do not work well with old compiler versions (and
MSVC).

10 years agozlib: introduce pending close state
Fedor Indutny [Thu, 13 Feb 2014 13:17:59 +0000 (17:17 +0400)]
zlib: introduce pending close state

zlib should not crash in `close()` if the write is still in progress.

fix #7101

10 years agotls: introduce asynchronous `newSession`
Fedor Indutny [Fri, 14 Feb 2014 13:01:34 +0000 (17:01 +0400)]
tls: introduce asynchronous `newSession`

fix #7105

10 years agodgram: pass the bytes sent to the send callback
Timothy J Fontaine [Sun, 16 Feb 2014 03:24:42 +0000 (19:24 -0800)]
dgram: pass the bytes sent to the send callback

Fixes #6953

10 years agov8: unbreak freebsd build
Ben Noordhuis [Sat, 23 Nov 2013 22:05:34 +0000 (23:05 +0100)]
v8: unbreak freebsd build

reland de8c0a5

Fixes #7020 and #7021

10 years agotest: fix tls-honorcipherorder slowness
Fedor Indutny [Sat, 15 Feb 2014 11:56:37 +0000 (15:56 +0400)]
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.

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Fri, 14 Feb 2014 19:05:27 +0000 (11:05 -0800)]
Merge remote-tracking branch 'upstream/v0.10'

10 years agodoc: re-add node.1 man page
Timothy J Fontaine [Fri, 14 Feb 2014 19:01:49 +0000 (11:01 -0800)]
doc: re-add node.1 man page

The man page was accidentally removed in 37376de for the website
refactor, bring it back.

Fixes #7117

10 years agotest: give repl-timeout-throw more time to run
Alexis Campailla [Tue, 14 Jan 2014 09:32:07 +0000 (01:32 -0800)]
test: give repl-timeout-throw more time to run

Short timeout was causing the test to fail on Windows debug builds.

10 years agotest: increase timeout in readable stream test
Alexis Campailla [Tue, 14 Jan 2014 10:00:33 +0000 (02:00 -0800)]
test: increase timeout in readable stream test

A slightly higher timeout is needed for the test to pass on
Windows debug builds.

10 years agotest: fix assert in test-http-outgoing-finish
Alexis Campailla [Fri, 24 Jan 2014 15:15:15 +0000 (07:15 -0800)]
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.

10 years agotest: fix connection reset in http test
Alexis Campailla [Fri, 24 Jan 2014 15:03:10 +0000 (07:03 -0800)]
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.

10 years agocluster: handle bind errors on Windows
Alexis Campailla [Thu, 16 Jan 2014 11:18:55 +0000 (03:18 -0800)]
cluster: handle bind errors on Windows

Before sending a socket from a cluster master to a worker,
we would call listen in UV but not handle the error.

I made createServerHandle call listen on Windows so we get a chance
the handle any bind/listen errors early.

This fix is 100% windows specific.
It fixes test-cluster-bind-twice and
test-cluster-shared-handle-bind-error on Windows.

10 years agotest: fix test-child-process-double-pipe
orangemocha@github.com [Mon, 10 Feb 2014 21:41:03 +0000 (22:41 +0100)]
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.

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Fri, 14 Feb 2014 00:40:38 +0000 (16:40 -0800)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
doc/blog/feature/streams2.md

10 years agonpm: Upgrade to v1.4.0
isaacs [Thu, 13 Feb 2014 02:16:32 +0000 (18:16 -0800)]
npm: Upgrade to v1.4.0

- Removes 'npm publish -f'
- Documentation
- Bug-fixes
- Update license etc to refer to npm, Inc. rather than @isaacs personally

10 years agowebsite: move website to joyent/node-website
Timothy J Fontaine [Thu, 13 Feb 2014 23:52:01 +0000 (15:52 -0800)]
website: move website to joyent/node-website

The website will no longer be living in the source repository instead
it can be found at http://github.com/joyent/node-website

10 years agodoc: changed timer id to object
Christian [Sun, 9 Feb 2014 09:37:55 +0000 (10:37 +0100)]
doc: changed timer id to object

fix #7074

10 years agochild_process: js bits for spawnSync/execSync
Timothy J Fontaine [Mon, 10 Feb 2014 20:40:48 +0000 (21:40 +0100)]
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.

10 years agobindings: add spawn_sync bindings
Bert Belder [Mon, 10 Feb 2014 20:22:06 +0000 (21:22 +0100)]
bindings: add spawn_sync bindings

This implements a nested event loop that makes it possible to control
a child process, while blocking the main loop until the process exits.

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Mon, 10 Feb 2014 19:21:09 +0000 (11:21 -0800)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
lib/_stream_writable.js

10 years agostream: use `errorEmitted` from `_writableState`
Fedor Indutny [Sun, 9 Feb 2014 11:09:34 +0000 (15:09 +0400)]
stream: use `errorEmitted` from `_writableState`

10 years agonet: do not re-emit stream errors
Fedor Indutny [Sun, 9 Feb 2014 10:59:31 +0000 (14:59 +0400)]
net: do not re-emit stream errors

fix #7015

10 years agoprocess: allow changing `exitCode` in `on('exit')`
Fedor Indutny [Sun, 9 Feb 2014 10:40:57 +0000 (14:40 +0400)]
process: allow changing `exitCode` in `on('exit')`

fix #7081

10 years agodns: validate arguments in resolver
Kenan Sulayman [Fri, 7 Feb 2014 17:50:29 +0000 (18:50 +0100)]
dns: validate arguments in resolver

Mitigate C++-land assertion error, add test accordingly.

Fix #7070

10 years agodns: verify argument is valid function in resolve
Kenan Sulayman [Fri, 7 Feb 2014 17:18:27 +0000 (18:18 +0100)]
dns: verify argument is valid function in resolve

Don't use argument as callback if it's not a valid callback function.
Throw a valid exception instead explaining the issue.

Adds to #7070 ("DNS — Throw meaningful error(s)").

10 years agotest: fix test-http-pipeline-flood
Alexis Campailla [Thu, 6 Feb 2014 13:43:55 +0000 (05:43 -0800)]
test: fix test-http-pipeline-flood

The number of connections achieved by the test can vary by platform
and by machine. Lowering the acceptance threshold so that the
test passes on Windows.

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Sun, 9 Feb 2014 00:45:27 +0000 (16:45 -0800)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
deps/v8/src/preparser.cc
deps/v8/src/win32-math.h
doc/api/http.markdown
src/node_buffer.h
src/node_crypto.cc
src/node_file.cc
src/node_http_parser.cc