platform/upstream/nodejs.git
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

10 years agosrc: refactor buffer bounds checking
Timothy J Fontaine [Wed, 5 Feb 2014 16:50:40 +0000 (08:50 -0800)]
src: refactor buffer bounds checking

Consolidate buffer bounds checking logic into Buffer namespace and use
it consistently throughout the source.

10 years agonpm: upgrade to 1.3.26
isaacs [Mon, 3 Feb 2014 04:24:09 +0000 (20:24 -0800)]
npm: upgrade to 1.3.26

10 years agodoc: fix diffieHellman.getGenerator() description
Brian White [Sat, 8 Feb 2014 18:19:04 +0000 (13:19 -0500)]
doc: fix diffieHellman.getGenerator() description

10 years agoRevert "dns: validate arguments in resolve"
Fedor Indutny [Fri, 7 Feb 2014 22:15:33 +0000 (02:15 +0400)]
Revert "dns: validate arguments in resolve"

This reverts commit 56e80a37e0df0d131d3a3ad6426d52f887ef8e94.

10 years agoRevert "dns: verify argument is valid function in resolve"
Fedor Indutny [Fri, 7 Feb 2014 22:15:29 +0000 (02:15 +0400)]
Revert "dns: verify argument is valid function in resolve"

This reverts commit 2ee86c624ecd6b9dbaad10989143325fc64778cd.

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 agodns: validate arguments in resolve
Kenan Sulayman [Fri, 7 Feb 2014 17:50:29 +0000 (18:50 +0100)]
dns: validate arguments in resolve

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

fix #7070

10 years agoheaders: fix spelling error
Austin Moran [Sun, 2 Feb 2014 23:39:43 +0000 (18:39 -0500)]
headers: fix spelling error

10 years agowebsite: update cla email address
Timothy J Fontaine [Fri, 7 Feb 2014 19:17:23 +0000 (11:17 -0800)]
website: update cla email address

10 years agovm: don't copy Proxy object from parent context
Ben Noordhuis [Thu, 30 Jan 2014 12:21:07 +0000 (13:21 +0100)]
vm: don't copy Proxy object from parent context

Make vm.runInContext() and vm.runInNewContext() stop copying the Proxy
object from the parent context into the new context when --harmony or
--harmony_proxies is in effect because it overwrites the new context's
native Proxy object.

This commit also adds a regression test for Harmony symbols.  They work
okay in the current implementation and the test should ensure it stays
that way.

10 years agotest: don't compute knownGlobals lazily
Ben Noordhuis [Thu, 30 Jan 2014 12:02:58 +0000 (13:02 +0100)]
test: don't compute knownGlobals lazily

Conditional globals like 'gc' should only be recognized when --expose_gc
is set.  The global.gc feature check works only when done eagerly, else
it lets through a leaked variable called 'gc'.

10 years agoutil: show meaningful values for boxed primitives
Nathan Rajlich [Thu, 6 Feb 2014 02:09:23 +0000 (18:09 -0800)]
util: show meaningful values for boxed primitives

Before, `new String('foo')` would be inspected as `"{}"` which
is simply not very helpful. Now, a more meaningful
`"[String: 'foo']"` result will be returned from `util.inspect()`.

Boxed String, Boolean, and Number types are all supported.

Closes #7047

10 years agonode: do not print SyntaxError hints to stderr
Fedor Indutny [Wed, 5 Feb 2014 16:38:33 +0000 (20:38 +0400)]
node: do not print SyntaxError hints to stderr

Try embedding the ` ... ^` lines inside the `SyntaxError` (or any other
native error) object before giving up and printing them to the stderr.

fix #6920
fix #1310

10 years agofs: make unwatchFile() insensitive to path
iamdoron [Thu, 6 Feb 2014 06:29:58 +0000 (08:29 +0200)]
fs: make unwatchFile() insensitive to path

10 years agosrc: move AsyncListener from process to tracing
Trevor Norris [Wed, 5 Feb 2014 23:37:12 +0000 (15:37 -0800)]
src: move AsyncListener from process to tracing

The AsyncListener API has been moved into the "tracing" module in order
to keep the process object free from unnecessary clutter.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
10 years agoenv: add watched_providers for AsyncListener
Trevor Norris [Tue, 21 Jan 2014 19:32:55 +0000 (11:32 -0800)]
env: add watched_providers for AsyncListener

Now the second field in asyncFlags will tell if the provider is
currently being watched, or listened for.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
10 years agoasync_wrap: add provider types/pass to constructor
Trevor Norris [Mon, 20 Jan 2014 21:33:16 +0000 (13:33 -0800)]
async_wrap: add provider types/pass to constructor

These will be used to allow users to filter for which types of calls
they wish their callbacks to run.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
10 years agonode: make AsyncListenerInst field more explicit
Trevor Norris [Tue, 21 Jan 2014 20:36:28 +0000 (12:36 -0800)]
node: make AsyncListenerInst field more explicit

"flags" could mean one of many things, and multiple flag types could be
checked. So make the field more explicit on what type of flags are being
stored.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
10 years agodoc: document the tracing api
Timothy J Fontaine [Sun, 2 Feb 2014 21:59:11 +0000 (13:59 -0800)]
doc: document the tracing api

10 years agosrc: add v8.getHeapStatistics() function
Ben Noordhuis [Fri, 15 Nov 2013 21:19:31 +0000 (22:19 +0100)]
src: add v8.getHeapStatistics() function

Add a one-to-one binding to v8::GetHeapStatistics().  Returns info on
the current state of the JS heap, like total size and amount used.

10 years agosrc: add tracing.v8.on('gc') statistics hooks
Ben Noordhuis [Mon, 28 Oct 2013 13:57:47 +0000 (14:57 +0100)]
src: add tracing.v8.on('gc') statistics hooks

Add a new 'tracing' module with a v8 property that lets the user
register listeners for gc events.  The listeners are invoked after
every garbage collection cycle with 'before' and 'after' statistics.
Useful for monitoring tools that want to keep track of memory usage.

10 years agosrc: fix MakeCallback() handle leak
Ben Noordhuis [Sat, 16 Nov 2013 19:05:42 +0000 (20:05 +0100)]
src: fix MakeCallback() handle leak

Create a new HandleScope before looking up the object context with
v8::Object::CreationContext(), else we leak the Local<Context> into
the current HandleScope.

That's relatively harmless unless the HandleScope is long-lived and
MakeCallback() is called a lot.  In a scenario like that, we may end
up leaking a lot of memory.

What is unfortunate about this change is that we're trying hard to
eradicate the node_isolate global.  Longer term, we will probably have
to change the MakeCallback() prototype to one that requires an explicit
v8::Isolate* argument.

10 years agosrc: update MakeCallback() function prototype
Ben Noordhuis [Mon, 27 Jan 2014 02:58:16 +0000 (18:58 -0800)]
src: update MakeCallback() function prototype

Make it possible to invoke MakeCallback() on a v8::Value but only for
the variant that takes a v8::Function as the thing to call.

The const char* and v8::String variants still require a v8::Object
because the function to call is looked up as a property on the receiver,
but that only works when the receiver is an object, not a primitive.

10 years agotls: more session configuration options, methods
Fedor Indutny [Mon, 3 Feb 2014 21:32:13 +0000 (01:32 +0400)]
tls: more session configuration options, methods

Introduce `ticketKeys` server option, `session` client option,
`getSession()` and `getTLSTicket()` methods.

fix #7032

10 years agocontextify: handle infinite recursion errors
Fedor Indutny [Wed, 5 Feb 2014 09:46:00 +0000 (13:46 +0400)]
contextify: handle infinite recursion errors

Try to be consistent with v0.10 and emit "Maximum call stack size
reached", even if it happens when allocating context or doing other
stuff.

fix #7045

10 years agotest: fix test-tcp-wrap-listen
Alexis Campailla [Tue, 4 Feb 2014 17:16:44 +0000 (09:16 -0800)]
test: fix test-tcp-wrap-listen

If the call to writeBuffer completes asynchronously, we need to have
an oncomplete callback on the request object no matter what. The
writeQueueSize seems irrelvant to that regard.

Note that on Windows writeBuffer always completes asynchronously.

See related commit 9836a4eeda1e2d43aad0923f1f72b364792629bc

10 years agodoc: fix references to error keyword
Benjamin Waters [Tue, 4 Feb 2014 01:56:21 +0000 (20:56 -0500)]
doc: fix references to error keyword

References for err.signal and err.code should be error.signal and
error.code.

Fixes joyent/node#6862

10 years agoopenssl: fix keypress requirement in apps on win32
Alexis Campailla [Tue, 4 Feb 2014 01:23:15 +0000 (17:23 -0800)]
openssl: fix keypress requirement in apps on win32

Re-applying commit 153784b3489e2feb9d93a3a5eee5a4aa34f74e39, which
was overwritten by the update to openssl 1.0.1f.

Original source:

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

10 years agodoc: fix after message in addAsyncListener example
Yuriy Nemtsov [Mon, 3 Feb 2014 20:53:29 +0000 (15:53 -0500)]
doc: fix after message in addAsyncListener example

10 years agocrypto: update root certificates
Ben Noordhuis [Sat, 9 Nov 2013 22:46:05 +0000 (23:46 +0100)]
crypto: update root certificates

Update the list of root certificates in src/node_root_certs.h with
tools/mk-ca-bundle.pl and update src/node_crypto.cc to make use of
the new format.

Fixes #6013.

10 years agozlib: separate sync/async methods
Fedor Indutny [Mon, 3 Feb 2014 07:55:47 +0000 (11:55 +0400)]
zlib: separate sync/async methods

10 years agotls: fix crash in SNICallback
Fedor Indutny [Fri, 31 Jan 2014 12:49:24 +0000 (16:49 +0400)]
tls: fix crash in SNICallback

`tls_wrap.cc` was crashing in an `Unwrap` call, when non
`SecureContext` object was passed to it. Check that the passed object
is a `SecureContext` instance before unwrapping it.

fix #7008

10 years agodebugger: remove unused definition `currentSource`
Oguz Bastemur [Mon, 3 Feb 2014 12:47:29 +0000 (13:47 +0100)]
debugger: remove unused definition `currentSource`

Client's property `currentSource` has no use throughout the project.

10 years agodoc: add an example about multiple extensions
Maxime Quandalle [Sat, 1 Feb 2014 15:10:25 +0000 (16:10 +0100)]
doc: add an example about multiple extensions

`path.extname` returns only the last extension

10 years agozlib: add sync versions for convenience methods
Nikolai Vavilov [Tue, 28 Jan 2014 17:35:51 +0000 (19:35 +0200)]
zlib: add sync versions for convenience methods

10 years agodtrace: fix arguments warning
Fedor Indutny [Fri, 31 Jan 2014 20:12:42 +0000 (00:12 +0400)]
dtrace: fix arguments warning

Add enough arguments to `NODE_NET_SOCKET_READ()` and
`NODE_NET_SOCKET_WRITE()` stubs.

10 years agodeps: backport 883637bd from latest v8
Fedor Indutny [Thu, 30 Jan 2014 11:25:20 +0000 (15:25 +0400)]
deps: backport 883637bd from latest v8

Original commit message:

  VS2013 contains a number of improvements, most notably the addition
  of all C99 math functions.

  I'm a little bit concerned about the change I had to make in
  cpu-profiler.cc, but I spent quite a bit of time looking at it and was
  unable to figure out any rational explanation for the warning. It's
  possible it's spurious. Since it seems like a useful warning in
  general   though, I chose not to disable globally at the gyp level.

  I do think someone with expertise here should probably try to
  determine if this is a legitimate warning.

  BUG=288948
  R=dslomov@chromium.org

  Review URL: https://codereview.chromium.org/23449035

NOTE: Path applied without `cpu-profiler.cc` changes because in our
version it was looking totally different.

10 years agotest: delete invalid http test
Alexis Campailla [Thu, 30 Jan 2014 17:31:02 +0000 (09:31 -0800)]
test: delete invalid http test

The test is no longer valid for the original scenario.

It now fails intermittently because of two other issues:
1. Since the client is only processing one readable event, the
   client request is not enough to keep the process alive and the
   process can exit before the desired events have been raised.
2. Reading just 1 byte is not enough to guarantee that the parser
   will eventually consume all the data and raise the desired
   parse error. I tried postponing the server.close() to address
   the issue at [1], but then the test just hangs sometimes.

10 years agonode: do not ever close stdio
Fedor Indutny [Thu, 23 Jan 2014 09:35:18 +0000 (13:35 +0400)]
node: do not ever close stdio

Even if stdio streams are opened as file streams, we should not ever try
to close them. This could be accomplished by passing `autoClose: false`
in options on their creation.

10 years agosrc: move header inclusion out of namespace
Timothy J Fontaine [Wed, 29 Jan 2014 17:37:29 +0000 (09:37 -0800)]
src: move header inclusion out of namespace

The placement of a previous fix to include proper size_t types in
addons was erroneously placed inside a namespace, move to just before.

Fix #6992

10 years agoblog: Post for v0.11.11
Timothy J Fontaine [Wed, 29 Jan 2014 03:48:54 +0000 (19:48 -0800)]
blog: Post for v0.11.11

10 years agoNow working on 0.11.12
Timothy J Fontaine [Wed, 29 Jan 2014 03:46:17 +0000 (19:46 -0800)]
Now working on 0.11.12

10 years agoMerge branch 'v0.11.11-release'
Timothy J Fontaine [Wed, 29 Jan 2014 03:46:04 +0000 (19:46 -0800)]
Merge branch 'v0.11.11-release'

10 years ago2014.01.29, Version 0.11.11 (Unstable) v0.11.11
Timothy J Fontaine [Wed, 29 Jan 2014 01:27:13 +0000 (17:27 -0800)]
2014.01.29, Version 0.11.11 (Unstable)

* v8: Upgrade to 3.22.24.19

* http_parser: Upgrade to 2.2.1

* openssl: Upgrade to 1.0.1f

* uv: Upgrade to 0.11.18

* async-listener: revamp of subsystem (Trevor Norris)

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

* http: use writev on chunked encoding (Trevor Norris)

* async_wrap/timers: remove Add/RemoveAsyncListener (Trevor Norris)

* child_process: better error reporting for exec (Fedor Indutny)

* crypto: add newline to cert and key if not present (Fedor Indutny)

* crypto: clear error in GetPeerCertificate (Fedor Indutny)

* crypto: honor default ciphers in client mode (Jacob Hoffman-Andrews)

* crypto: introduce .setEngine(engine, [flags]) (Fedor Indutny)

* crypto: support custom pbkdf2 digest methods (Ben Noordhuis)

* domain: fix off-by-one in Domain.exit() (Ryan Graham)

* http: concatenate duplicate headers by default (Alex Kocharin)

* http: do not emit EOF non-readable socket (Fedor Indutny)

* node: fix argument parsing with -p arg (Alexis Campailla)

* path: improve POSIX path.join() performance (Jo Liss)

* tls: emit `clientError` on early socket close (Fedor Indutny)

* tls: introduce `.setMaxSendFragment(size)` (Fedor Indutny)

* tls: make cert/pfx optional in tls.createServer() (Ben Noordhuis)

* tls: process accumulated input (Fedor Indutny)

* tls: show human-readable error messages (Ben Noordhuis)

* util: handle escaped forward slashes correctly (Tom Gallacher)

10 years agov8: Upgrade to 3.22.24.19
Timothy J Fontaine [Wed, 29 Jan 2014 01:16:28 +0000 (17:16 -0800)]
v8: Upgrade to 3.22.24.19

10 years agodocs: clarify origin in agent.maxSockets section
Wyatt Preul [Wed, 12 Jun 2013 04:02:51 +0000 (23:02 -0500)]
docs: clarify origin in agent.maxSockets section

10 years agonode: do not ever close stdio
Fedor Indutny [Thu, 23 Jan 2014 09:35:18 +0000 (13:35 +0400)]
node: do not ever close stdio

Even if stdio streams are opened as file streams, we should not ever try
to close them. This could be accomplished by passing `autoClose: false`
in options on their creation.

10 years agodeps: update http_parser to 2.2.1
Fedor Indutny [Tue, 28 Jan 2014 23:23:52 +0000 (03:23 +0400)]
deps: update http_parser to 2.2.1

Main changes:

  * Fixed content-length and chunk-size overflow test

10 years agolib: fix unnecessary coercion in lib/net.js
Thom Seddon [Tue, 28 Jan 2014 16:18:36 +0000 (16:18 +0000)]
lib: fix unnecessary coercion in lib/net.js

Original patch by @skypjack in #6627

10 years agolib: Remove unused var+operations in util.inspect
Thom Seddon [Tue, 28 Jan 2014 15:33:48 +0000 (15:33 +0000)]
lib: Remove unused var+operations in util.inspect

This was originally introduced in 6034701 to prevent the closing
brace being pushed onto the next line if an object is longer than
the max width, however the functionality was removed in d164989 but
the supplementary variables (and operations) were left behind

10 years agosrc: only define ssize_t on windows if undefined
Timothy J Fontaine [Tue, 28 Jan 2014 22:11:32 +0000 (14:11 -0800)]
src: only define ssize_t on windows if undefined

This matches how libuv handles the definition of ssize_t, by
typedef'ing intptr_t to ssize_t.

However, in the future we will use portable types from stddef.h

10 years agostream_wrap: use `uv_try_write` where possible
Fedor Indutny [Tue, 28 Jan 2014 22:48:10 +0000 (02:48 +0400)]
stream_wrap: use `uv_try_write` where possible

Use `uv_try_write` for string and buffer writes, thus avoiding to do
allocations and copying in some of the cases.

10 years agonode: explicitly include `sys/types.h` for size_t
Fedor Indutny [Thu, 23 Jan 2014 11:21:03 +0000 (15:21 +0400)]
node: explicitly include `sys/types.h` for size_t

fix #6724

10 years agotest: use logical and not or in abort-fatal-error
Timothy J Fontaine [Tue, 28 Jan 2014 02:27:10 +0000 (18:27 -0800)]
test: use logical and not or in abort-fatal-error

10 years agotest: make abort-fatal-error more robust
Timothy J Fontaine [Tue, 28 Jan 2014 02:05:39 +0000 (18:05 -0800)]
test: make abort-fatal-error more robust

It's saner to check exit codes or signals to determine if the process
actually aborted. On OSX and Linux the exit code is 134, on SunOS it
propagates the SIGABRT signal

10 years agotest: fix test-net-listen-fd0 for pipes
Timothy J Fontaine [Tue, 28 Jan 2014 01:39:45 +0000 (17:39 -0800)]
test: fix test-net-listen-fd0 for pipes

In the case of a pipe'd input, i.e. from the CI the fd will be a PIPE
and when listen() is called it will return ENOTSOCK instead of EINVAL.

10 years agonode: register modules from DSO constructors
Keith M Wesolowski [Tue, 17 Dec 2013 00:00:44 +0000 (00:00 +0000)]
node: register modules from DSO constructors

Built-in modules should be automatically registered, replacing the
static module list.  Add-on modules should also be automatically
registered via DSO constructors.  This improves flexibility in adding
built-in modules and is also a prerequisite to pure-C addon modules.

10 years agocrypto: honor default ciphers in client mode
Jacob Hoffman-Andrews [Fri, 24 Jan 2014 01:28:08 +0000 (17:28 -0800)]
crypto: honor default ciphers in client mode

Right now no default ciphers are use in, e.g. https.get, meaning that
weak export ciphers like TLS_RSA_EXPORT_WITH_DES40_CBC_SHA are
accepted.

To reproduce:

node -e "require('https').get({hostname: 'www.howsmyssl.com', \
  path: '/a/check'}, function(res) {res.on('data', \
  function(d) {process.stdout.write(d)})})"

10 years agotest: race condition in test-cluster-disconnect
Alexis Campailla [Fri, 10 Jan 2014 13:27:48 +0000 (05:27 -0800)]
test: race condition in test-cluster-disconnect

The test was not waiting for all the worker-created sockets
to be listening before calling cluster.disconnect().
As a result, the channels with the workers could get closed
before all the socket handles had been passed to them, leading
to various errors.

10 years agonode: fix argument parsing with -p arg
Alexis Campailla [Sat, 28 Dec 2013 08:12:40 +0000 (15:12 +0700)]
node: fix argument parsing with -p arg

node -p would cause an access violation.

Fixes test\message\stdin_messages.js on Windows.

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

Conflicts:
src/node_crypto.cc
test/simple/test-crypto.js

10 years agonet: make Socket destroy() re-entrance safe
Jun Ma [Sat, 25 Jan 2014 17:50:17 +0000 (01:50 +0800)]
net: make Socket destroy() re-entrance safe

So that we are free to call socket.destroy() in error event handler.

fix #6769

10 years agodeps: update uv to 0.11.18
Fedor Indutny [Mon, 27 Jan 2014 17:30:51 +0000 (21:30 +0400)]
deps: update uv to 0.11.18

10 years agocrypto: throw on SignFinal failure
Fedor Indutny [Sun, 26 Jan 2014 16:09:14 +0000 (20:09 +0400)]
crypto: throw on SignFinal failure

fix #6963

10 years agocrypto: clear error in GetPeerCertificate
Fedor Indutny [Thu, 23 Jan 2014 12:03:32 +0000 (16:03 +0400)]
crypto: clear error in GetPeerCertificate

fix #6945

10 years agonet: reset `endEmitted` on reconnect
Fedor Indutny [Wed, 22 Jan 2014 21:15:04 +0000 (01:15 +0400)]
net: reset `endEmitted` on reconnect

fix #6908

10 years agodeps: backport b5135bbc from c-ares repo
Fedor Indutny [Thu, 23 Jan 2014 10:27:36 +0000 (14:27 +0400)]
deps: backport b5135bbc from c-ares repo

Original commit message:

    ares_parse_txt_reply: return a ares_txt_reply node for each sub-string

    Previously, the function would wrongly return all substrings merged into
    one.

fix #6931

10 years agodoc: readline document TTY utils
Fedor Indutny [Thu, 23 Jan 2014 11:35:50 +0000 (15:35 +0400)]
doc: readline document TTY utils

fix #6933

10 years agohttp: do not emit EOF non-readable socket
Fedor Indutny [Fri, 24 Jan 2014 12:25:11 +0000 (16:25 +0400)]
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

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Sat, 25 Jan 2014 03:13:50 +0000 (19:13 -0800)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
AUTHORS
ChangeLog
deps/uv/AUTHORS
deps/uv/ChangeLog
deps/uv/src/unix/process.c
deps/uv/src/version.c
lib/net.js
node.gyp
src/node_version.h

10 years agotls_wrap: propagate errors to write callbacks
Fedor Indutny [Fri, 24 Jan 2014 18:08:25 +0000 (22:08 +0400)]
tls_wrap: propagate errors to write callbacks

fix #6903

10 years agotls: emit `clientError` on early socket close
Fedor Indutny [Wed, 22 Jan 2014 01:07:11 +0000 (05:07 +0400)]
tls: emit `clientError` on early socket close

fix #6903

10 years agodoc: fix typo in readline
Scott González [Thu, 23 Jan 2014 14:59:21 +0000 (09:59 -0500)]
doc: fix typo in readline

10 years agonpm: Upgrade to v1.3.25
isaacs [Thu, 23 Jan 2014 21:04:49 +0000 (13:04 -0800)]
npm: Upgrade to v1.3.25

10 years agolint: use reinterpret_cast, not C-style casts
Trevor Norris [Thu, 23 Jan 2014 21:01:53 +0000 (13:01 -0800)]
lint: use reinterpret_cast, not C-style casts

10 years agotest: fix http-incoming-pipelined-socket-destroy
Alexis Campailla [Wed, 22 Jan 2014 16:28:24 +0000 (08:28 -0800)]
test: fix http-incoming-pipelined-socket-destroy

The test was calling server.close() after write on the socket
had completed. However the fact that the write had completed was
not valid indication that the server had received the data.

This would result in a premutaure closing of the server and
an ECONNRESET event on the client.

10 years agotest: fix http-many-ended-pipelines server close
Alexis Campailla [Thu, 23 Jan 2014 15:10:24 +0000 (07:10 -0800)]
test: fix http-many-ended-pipelines server close

The test was calling server.close() without waiting for the server
to have received all the requests. This would cause an ECONNRESET.

10 years agov8: upgrade to 3.22.24.17
Trevor Norris [Thu, 23 Jan 2014 20:14:40 +0000 (12:14 -0800)]
v8: upgrade to 3.22.24.17