platform/upstream/nodejs.git
10 years agosrc: remove global HandleScope
Ben Noordhuis [Mon, 11 Nov 2013 20:03:08 +0000 (21:03 +0100)]
src: remove global HandleScope

Make it more difficult to accidentally leak handles by removing the
top-level HandleScope.  Now if there's no valid HandleScope now, V8
will complain and, in debug builds, abort.

10 years agosrc: fix Environment::GetCurrent() usage
Ben Noordhuis [Mon, 11 Nov 2013 21:02:03 +0000 (22:02 +0100)]
src: fix Environment::GetCurrent() usage

Create a HandleScope before calling the Environment::GetCurrent() that
takes a v8::Isolate* as an argument because it creates a handle with
the call to v8::Isolate::CurrentContext().

10 years agonode: add HandleScope to prevent memory leak
Trevor Norris [Mon, 11 Nov 2013 19:24:31 +0000 (11:24 -0800)]
node: add HandleScope to prevent memory leak

MakeCallback can only be called from a valid v8::HandleScope.

Fixed #6487

10 years agov8: upgrade to 3.22.24
Ben Noordhuis [Sun, 10 Nov 2013 01:02:27 +0000 (02:02 +0100)]
v8: upgrade to 3.22.24

This commit removes the simple/test-event-emitter-memory-leak test for
being unreliable with the new garbage collector: the memory pressure
exerted by the test case is too low for the garbage collector to kick
in.  It can be made to work again by limiting the heap size with the
--max_old_space_size=x flag but that won't be very reliable across
platforms and architectures.

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 agotools: check in certdata.txt from mozilla NSS
Ben Noordhuis [Sat, 9 Nov 2013 22:32:12 +0000 (23:32 +0100)]
tools: check in certdata.txt from mozilla NSS

This is a file from the NSS project containing root certificate data.
It can be downloaded from:

  https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1

Once downloaded, running `perl tools/mk-ca-bundle.pl` will update
src/node_root_certs.h.  Commit, rebuild and go.

10 years agotools: customize mk-ca-bundle.pl
Ben Noordhuis [Sat, 9 Nov 2013 22:31:54 +0000 (23:31 +0100)]
tools: customize mk-ca-bundle.pl

Remove unneeded functionality and tweak the generated output so we
can #include it in C++ source code.

10 years agotools: bundle mk-ca-bundle.pl from upstream curl
Ben Noordhuis [Sat, 9 Nov 2013 22:01:26 +0000 (23:01 +0100)]
tools: bundle mk-ca-bundle.pl from upstream curl

10 years agoMerge remote-tracking branch 'ry/v0.10'
isaacs [Fri, 8 Nov 2013 21:41:44 +0000 (13:41 -0800)]
Merge remote-tracking branch 'ry/v0.10'

10 years agonpm: Upgrade to 1.3.14
isaacs [Fri, 8 Nov 2013 21:41:21 +0000 (13:41 -0800)]
npm: Upgrade to 1.3.14

10 years agobuild: make v8 use random seed for hash tables
Ben Noordhuis [Fri, 8 Nov 2013 21:23:59 +0000 (22:23 +0100)]
build: make v8 use random seed for hash tables

Upstream V8 as of commit v8/v8@4bc70e8 uses a fixed seed of 314159265
for hash tables unless instructed otherwise.  Tell V8 to keep using a
random seed.

10 years agosrc: remove container_of, use CONTAINER_OF
Ben Noordhuis [Fri, 8 Nov 2013 20:44:32 +0000 (21:44 +0100)]
src: remove container_of, use CONTAINER_OF

CONTAINER_OF was introduced a while ago but was not used consistently
everywhere yet.  This commit fixes that.

Why CONTAINER_OF instead of container_of?  The former makes it crystal
clear that it's a macro, not a function.

10 years agocrypto: unbreak build with no-NPN shared openssl
Ben Noordhuis [Fri, 8 Nov 2013 16:47:39 +0000 (17:47 +0100)]
crypto: unbreak build with no-NPN shared openssl

Unbreak the build when linking against a shared version of OpenSSL that
doesn't support NPN (Next Protocol Negotiation.)

Fixes the following build error:

  ../src/node_crypto.cc:140: error: no member function
  'AdvertiseNextProtoCallback' declared in
  'node::crypto::SSLWrap<node::TLSCallbacks>'
  ../src/node_crypto.cc:147: error: no member function
  'SelectNextProtoCallback' declared in
  'node::crypto::SSLWrap<node::TLSCallbacks>'

10 years agocrypto: try moving read head in Peek()
Fedor Indutny [Thu, 15 Aug 2013 21:30:47 +0000 (01:30 +0400)]
crypto: try moving read head in Peek()

Otherwise it might get stall (`Peek()` will return zero-length chunk)
in following situation:

1. `Write(kBufferLength)`
2. `Read(kBufferLength)`
3. `Write(anything)`
4. `Peek()` => `len=0`

10 years agodoc: encoding is ignored if input is a Buffer
Fedor Indutny [Mon, 21 Oct 2013 12:26:29 +0000 (16:26 +0400)]
doc: encoding is ignored if input is a Buffer

NOTE: it wasn't in 0.8

fixes #6386

10 years agohttp: force socket encoding to be null
isaacs [Sun, 3 Nov 2013 22:32:03 +0000 (14:32 -0800)]
http: force socket encoding to be null

Otherwise the string triggers an assertion error in node_http_parser.c,
line 370:

    assert(Buffer::HasInstance(args[0]) == true);

because the first argument is not a Buffer object.

10 years agodoc: cluster: bump stability level to 'unstable'
Ben Noordhuis [Thu, 7 Nov 2013 11:34:22 +0000 (12:34 +0100)]
doc: cluster: bump stability level to 'unstable'

As discussed on the mailing list: the module will not go away but the
API will continue to receive updates as the need arises.

Link: https://groups.google.com/forum/#!topic/nodejs/uqyTcQfimAI
Message-ID: <7384b30e-b64c-4086-b78f-b5acca9842a9@googlegroups.com>

10 years agohttp: cleanup freeSockets when socket destroyed
fengmk2 [Wed, 6 Nov 2013 11:58:03 +0000 (19:58 +0800)]
http: cleanup freeSockets when socket destroyed

If the socket was destroyed, we need to remove it from the agent's
`freeSockets` list, otherwise dead socket could be reused by new
request.

10 years agobenchmark: Correct the bufferSize to highWaterMark
Jackson Tian [Sun, 1 Sep 2013 17:41:00 +0000 (01:41 +0800)]
benchmark: Correct the bufferSize to highWaterMark

  The bufferSize has been removed. Use highWaterMark instead of.

10 years agotls: more accurate wrapping of connecting socket
Fedor Indutny [Tue, 5 Nov 2013 14:14:28 +0000 (18:14 +0400)]
tls: more accurate wrapping of connecting socket

When socket, passed in `tls.connect()` `options` argument is not yet
connected to the server, `_handle` gets assigned to a `net.Socket`,
instead of `TLSSocket`.

When socket is connecting to the remote server (i.e. not yet connected,
but already past dns resolve phase), derive `_connecting` property from
it, because otherwise `afterConnect()` will throw an assertion.

fix #6443

10 years agofs: make fs.watch() non-recursive by default
Ben Noordhuis [Tue, 5 Nov 2013 07:23:58 +0000 (08:23 +0100)]
fs: make fs.watch() non-recursive by default

Fixes a behavioral regression introduced in commit 691b9eb.

10 years agosrc: fix whitespace/braces lint error from 962686b
Ben Noordhuis [Mon, 4 Nov 2013 21:42:48 +0000 (22:42 +0100)]
src: fix whitespace/braces lint error from 962686b

Silly warning.  One day I'll probably remove it altogether, see if I
don't.

10 years agohttp: make DELETE requests set `req.method`
Nathan Rajlich [Mon, 4 Nov 2013 17:39:29 +0000 (09:39 -0800)]
http: make DELETE requests set `req.method`

Fixes #6461.

10 years agosrc: squelch unused variable warning
Ben Noordhuis [Sun, 3 Nov 2013 20:00:37 +0000 (21:00 +0100)]
src: squelch unused variable warning

|i| and |j| arent't used when building without crypto support.  Hat tip
to Brian White.

Rename |l| to |k| while we're here because it's quite hard to discern
from |i| or |j| with some fonts.

10 years agodoc: Correct and add several items
isaacs [Thu, 31 Oct 2013 20:35:54 +0000 (13:35 -0700)]
doc: Correct and add several items

Several names/urls were out of date, and some really
awesome stuff was missing.

10 years agodoc: document node signal handling
Sam Roberts [Wed, 30 Oct 2013 23:19:17 +0000 (16:19 -0700)]
doc: document node signal handling

Partly lifted from uv.h, partly from observation of node.cc.

10 years agoblog: Post for v0.11.8
Timothy J Fontaine [Wed, 30 Oct 2013 16:09:04 +0000 (09:09 -0700)]
blog: Post for v0.11.8

10 years agotls: add ECDH ciphers support
Erik Dubbelboer [Mon, 14 Oct 2013 14:53:59 +0000 (16:53 +0200)]
tls: add ECDH ciphers support

Switch test fixtures to 1024 bit keys.

10 years agotest: fix async listener test for windows
Trevor Norris [Fri, 1 Nov 2013 20:57:09 +0000 (13:57 -0700)]
test: fix async listener test for windows

10 years agobenchmark: add http chunked encoding benchmarks
Ben Noordhuis [Fri, 1 Nov 2013 14:44:43 +0000 (15:44 +0100)]
benchmark: add http chunked encoding benchmarks

Test both "Content-Length: xxx" and "Transfer-Encoding: chunked" responses in
the http/simple benchmark.

10 years agodoc: add docs for AsyncListeners
Trevor Norris [Wed, 30 Oct 2013 00:05:40 +0000 (17:05 -0700)]
doc: add docs for AsyncListeners

Documentation has been added on how to use the AsyncListener API.

10 years agotest: add additional async listener tests
Jacob Groundwater [Tue, 15 Oct 2013 20:50:00 +0000 (13:50 -0700)]
test: add additional async listener tests

10 years agodomain: use AsyncListener API
Trevor Norris [Tue, 29 Oct 2013 23:35:32 +0000 (16:35 -0700)]
domain: use AsyncListener API

The domain module has been switched over to use the domain module API as
much as currently possible. There are still some hooks in the
EventEmitter, but hopefully we can remove those in the future.

10 years agocares: add AsyncListener support
Trevor Norris [Sat, 28 Sep 2013 00:04:30 +0000 (17:04 -0700)]
cares: add AsyncListener support

10 years agocrypto: convert pbkdf2_req to a class
Trevor Norris [Tue, 1 Oct 2013 00:24:41 +0000 (17:24 -0700)]
crypto: convert pbkdf2_req to a class

pbkdf2_req has been renamed to PBKDF2Request and converted to a class.
It now uses AsyncWrap::MakeCallback.

Also includes, using env()->ondone_string() instead of "ondone" and
using malloc instead of new char[].

10 years agocrypto: convert RandomBytesRequest to a class
Trevor Norris [Sun, 29 Sep 2013 06:33:29 +0000 (23:33 -0700)]
crypto: convert RandomBytesRequest to a class

Since RandomBytesRequest makes a call to MakeCallback, needed it to be
a class so AsyncWrap could handle any async listeners.

Also added a simple test for an issue had during implementation where
the memory was being released and returned.

10 years agoasync-wrap: add methods to udp/tcp/pipe/timers
Trevor Norris [Mon, 7 Oct 2013 19:39:52 +0000 (12:39 -0700)]
async-wrap: add methods to udp/tcp/pipe/timers

Now it's possible to add/remove an async listener to an individual
handle created by UDP, TCP, Pipe or Timer.

10 years agoasync-wrap: integrate with WeakObject
Trevor Norris [Fri, 27 Sep 2013 17:30:02 +0000 (10:30 -0700)]
async-wrap: integrate with WeakObject

Making WeakObject inherit from AsyncWrap allows us to peak into almost
all the MakeCallback calls in Node internals.

10 years agonode: add AsyncListener support
Trevor Norris [Tue, 24 Sep 2013 21:12:11 +0000 (14:12 -0700)]
node: add AsyncListener support

AsyncListener is a JS API that works in tandem with the AsyncWrap class
to allow the user to be alerted to key events in the life cycle of an
asynchronous event. The AsyncWrap class has its own MakeCallback
implementation that core will be migrated to use, and uses state sharing
techniques to allow quicker communication between JS and C++ whether the
async event callbacks need to be called.

10 years agotest: fix tls-client-reject after ba7c9ce96
Fedor Indutny [Thu, 31 Oct 2013 19:39:43 +0000 (23:39 +0400)]
test: fix tls-client-reject after ba7c9ce96

10 years agobuild: use zero overhead systemtap probes
Ben Noordhuis [Mon, 28 Oct 2013 19:18:59 +0000 (20:18 +0100)]
build: use zero overhead systemtap probes

Profiling suggested that on Linux sometimes over 10% of CPU time was
being spent inside the systemtap probe entry points in the binding
layer, even when the process was not actively being traced with the
`stap` tool.

That's why this commit makes it possible to use the *_ENABLED() macros
and bail out early when we're not being traced, reducing the overhead
of unused probes to (almost) zero.

Said macros were already being generated by `dtrace -h` but were not
usable because they rely on external definitions.  To remedy that, we
now generate the accompanying object files with `dtrace -G`.

This commit includes a change to libuv that has been landed upstream in
commit joyent/libuv@3c172ea.

10 years agotls: do not default to 'localhost' servername
Fedor Indutny [Mon, 28 Oct 2013 12:10:10 +0000 (16:10 +0400)]
tls: do not default to 'localhost' servername

10 years agotls: reuse hostname from underlying net.Socket
Fedor Indutny [Mon, 28 Oct 2013 10:25:27 +0000 (14:25 +0400)]
tls: reuse hostname from underlying net.Socket

When `tls.connect()` is called with `socket` option, it should try to
reuse hostname previously passed to `net.connect()` and only after that
fall back to `'localhost'`.

fix #6409

10 years agofs: add recursive subdirectory support to fs.watch
Nick Simmons [Tue, 22 Oct 2013 02:08:28 +0000 (22:08 -0400)]
fs: add recursive subdirectory support to fs.watch

Currently fs.watch does not have an option to specify if a directory
should be recursively watched for events across all subdirectories.

Several file watcher APIs support this. FSEvents on OS X > 10.5 is
one example. libuv has added support for FSEvents, but fs.watch had
no way to specify that a recursive watch was required.

fs.watch now has an additional boolean option 'recursive'. When set
to true, and when supported, fs.watch will return notifications for
the entire directory tree hierarchy rooted at the specified path.

10 years agoNow working on 0.11.9
Timothy J Fontaine [Wed, 30 Oct 2013 15:55:06 +0000 (08:55 -0700)]
Now working on 0.11.9

10 years agoMerge branch 'v0.11.8-release'
Timothy J Fontaine [Wed, 30 Oct 2013 15:54:48 +0000 (08:54 -0700)]
Merge branch 'v0.11.8-release'

10 years ago2013.10.30, Version 0.11.8 (Unstable) v0.11.8
Timothy J Fontaine [Wed, 30 Oct 2013 00:08:07 +0000 (17:08 -0700)]
2013.10.30, Version 0.11.8 (Unstable)

* uv: Upgrade to v0.11.14

* v8: upgrade 3.21.18.3

* assert: indicate if exception message is generated (Glen Mailer)

* buffer: add buf.toArrayBuffer() API (Trevor Norris)

* cluster: fix premature 'disconnect' event (Ben Noordhuis)

* crypto: add SPKAC support (Jason Gerfen)

* debugger: count space for line numbers correctly (Alex Kocharin)

* debugger: make busy loops SIGUSR1-interruptible (Ben Noordhuis)

* debugger: repeat last command (Alex Kocharin)

* debugger: show current line, fix for #6150 (Alex Kocharin)

* dgram: send() can accept strings (Trevor Norris)

* dns: rename domain to hostname (Ben Noordhuis)

* dns: set hostname property on error object (Ben Noordhuis)

* dtrace, mdb_v8: support more string, frame types (Dave Pacheco)

* http: add statusMessage (Patrik Stutz)

* http: expose supported methods (Ben Noordhuis)

* http: provide backpressure for pipeline flood (isaacs)

* process: Add exitCode property (isaacs)

* tls: socket.renegotiate(options, callback) (Fedor Indutny)

* util: format as Error if instanceof Error (Rod Vagg)

10 years agofs_event_wrap: update to new libuv api
Timothy J Fontaine [Tue, 29 Oct 2013 23:46:15 +0000 (16:46 -0700)]
fs_event_wrap: update to new libuv api

10 years agouv: Upgrade to v0.11.14
Timothy J Fontaine [Tue, 29 Oct 2013 23:33:17 +0000 (16:33 -0700)]
uv: Upgrade to v0.11.14

10 years agosrc: shorten Object{Wrap,Unwrap}
Trevor Norris [Tue, 29 Oct 2013 20:23:58 +0000 (13:23 -0700)]
src: shorten Object{Wrap,Unwrap}

Going back to the original names of Wrap/Unwrap now that most all the
class members that duplicate the name and functionality have been
removed.

10 years agosrc: don't use class specific Unwrap methods
Trevor Norris [Tue, 29 Oct 2013 20:09:52 +0000 (13:09 -0700)]
src: don't use class specific Unwrap methods

Instead use the template functions in util.h.

10 years agosrc: don't use WeakObject::Unwrap
Trevor Norris [Tue, 29 Oct 2013 19:49:53 +0000 (12:49 -0700)]
src: don't use WeakObject::Unwrap

Switch out to use UnwrapObject from util.h.

10 years agosrc: use function to get internal pointer
Trevor Norris [Tue, 29 Oct 2013 19:27:24 +0000 (12:27 -0700)]
src: use function to get internal pointer

Remove the NODE_{WRAP,UNWRAP} macros and instead use template functions.

10 years agonode: don't share state with in_tick/last_threw
Trevor Norris [Tue, 27 Aug 2013 18:30:06 +0000 (11:30 -0700)]
node: don't share state with in_tick/last_threw

There was no need to share state between C++ and JS for these two
values. So they have been moved to their respective locations. This will
help performance only a tiny bit, but it does help code complexity much
more.

10 years agodoc: Update documentation to reflect ObjectWrap changes
Scott Blomquist [Tue, 29 Oct 2013 19:49:41 +0000 (12:49 -0700)]
doc: Update documentation to reflect ObjectWrap changes

10 years agowin: fix ObjectWrap for latest v8
Scott Blomquist [Tue, 29 Oct 2013 18:43:31 +0000 (11:43 -0700)]
win: fix ObjectWrap for latest v8

We need to keep ObjectWrap around for module authors (we think), but
v8 3.21 broke node_object_wrap.h with respect to MSVC. Coincidentally,
we no longer use ObjectWrap at all in core, and native modules might
as well use their own entirely internal implementation if they need it.

10 years agosrc: Remove unused refs to node_object_wrap.h
Scott Blomquist [Thu, 24 Oct 2013 20:10:43 +0000 (13:10 -0700)]
src: Remove unused refs to node_object_wrap.h

Turns out that we don't use node_object_wrap.h any more in core,
and, with v8 3.21, it's breaking our Windows build. Removing refs
to it everywhere (and adding node.h in one case where it was the
only way node.h was being included), we have restored the Windows
build.

10 years agosrc: accept passphrase when crypto signing with private key
Thom Seddon [Fri, 4 Oct 2013 11:59:38 +0000 (12:59 +0100)]
src: accept passphrase when crypto signing with private key

Previous behaviour was to drop to an openssl prompt
("Enter PEM pass phrase:") when supplying a private key with a
passphrase. This change adds a fourth, optional, paramter that
will be used as the passphrase.
To include this parameter in a backwards compatible way it was
necessary to expose the previously undocumented (and unexposed)
feature of being able to explitly setting the output encoding.

10 years agodoc: dgram: reword dgram.Socket#send() docs
Ben Noordhuis [Tue, 29 Oct 2013 09:31:14 +0000 (10:31 +0100)]
doc: dgram: reword dgram.Socket#send() docs

Make it clear that the address argument is not really optional and fix
some Engrish and long lines while we're here.

Fixes #6433.

10 years agodgram: send() can accept strings
Trevor Norris [Mon, 28 Oct 2013 21:58:37 +0000 (14:58 -0700)]
dgram: send() can accept strings

Strings passed to Socket#send() will be passed to Buffer and parsed as
UTF8.

10 years agoMerge remote-tracking branch 'ry/v0.10'
isaacs [Mon, 28 Oct 2013 21:12:00 +0000 (14:12 -0700)]
Merge remote-tracking branch 'ry/v0.10'

10 years agonpm@1.3.13
isaacs [Mon, 28 Oct 2013 21:10:47 +0000 (14:10 -0700)]
npm@1.3.13

10 years agovm: Copy missing properties from context
isaacs [Sat, 26 Oct 2013 01:56:25 +0000 (18:56 -0700)]
vm: Copy missing properties from context

This addresses a current shortcoming of the V8 SetNamedPropertyHandler
function.

It does not provide a way to intercept Object.defineProperty(..) calls.
As a result, these properties are not copied onto the contextified
sandbox when a new global property is added via either a function
declaration or a Object.defineProperty(global, ...) call.

Note that any function declarations or Object.defineProperty() globals
that are created asynchronously (in a setTimeout, callback, etc.) will
happen AFTER the call to copy properties, and thus not be caught.

The way to properly fix this is to add some sort of a
Object::SetNamedDefinePropertyHandler() function that takes a callback,
which receives the property name and property descriptor as arguments.

Luckily, such situations are rare, and asynchronously-added globals
weren't supported by Node's VM module until 0.12 anyway.  But, this
should be fixed properly in V8, and this copy function should be removed
once there is a better way.

Fix #6416

10 years agohttp: remove MethodToString()
Ben Noordhuis [Mon, 28 Oct 2013 12:44:41 +0000 (13:44 +0100)]
http: remove MethodToString()

The list of supported HTTP methods is available in JS land now so there
is no longer any need to pass a stringified version of the method to the
parser callback, it can look up the method name for itself.

Saves a call to v8::Eternal::Get() in the common case and a costly
v8::String::NewFromOneByte() in the uncommon case.

10 years agohttp: expose supported methods
Ben Noordhuis [Mon, 28 Oct 2013 12:35:33 +0000 (13:35 +0100)]
http: expose supported methods

Expose the list of supported HTTP methods as a property on the 'http'
module object.

Fixes #6422.

10 years agodoc: fs: clarify fs.symlink Windows specific args
Phillip Alexander [Sat, 26 Oct 2013 20:13:56 +0000 (13:13 -0700)]
doc: fs: clarify fs.symlink Windows specific args

10 years agodoc: improve module documentation
Ryan Graham [Sat, 26 Oct 2013 05:03:02 +0000 (22:03 -0700)]
doc: improve module documentation

Expands on when to use module.exports vs. exports. This is a recurring
question on mailing list and continues to confuse new devs.

10 years agodoc: fix missing backtick in 2e16037
Sam Roberts [Fri, 25 Oct 2013 20:16:50 +0000 (13:16 -0700)]
doc: fix missing backtick in 2e16037

10 years agoMerge remote-tracking branch 'upstream/v0.10'
Timothy J Fontaine [Fri, 25 Oct 2013 18:26:05 +0000 (11:26 -0700)]
Merge remote-tracking branch 'upstream/v0.10'

Conflicts:
ChangeLog
deps/uv/ChangeLog
deps/uv/include/uv-darwin.h
deps/uv/src/unix/fsevents.c
deps/uv/src/unix/process.c
deps/uv/src/version.c
doc/api/addons.markdown
doc/api/cluster.markdown
doc/api/http.markdown
lib/http.js
lib/tls.js
src/node_crypto.cc
src/node_http_parser.cc
src/node_version.h
src/pipe_wrap.cc
src/v8abbr.h
src/v8ustack.d
test/simple/test-http-pipeline-flood.js

10 years agodoc: streams: document default objectMode setting
Brian White [Thu, 24 Oct 2013 02:43:23 +0000 (22:43 -0400)]
doc: streams: document default objectMode setting

10 years agodebugger: Fix bug in sb() with unnamed script
Maxim Bogushevich [Tue, 22 Oct 2013 07:27:02 +0000 (17:27 +1000)]
debugger: Fix bug in sb() with unnamed script

setBreakpoint() cause error when unnamed script is loaded

10 years agonpm@1.3.12
isaacs [Thu, 24 Oct 2013 16:21:59 +0000 (09:21 -0700)]
npm@1.3.12

10 years agobuild: fix test-gc weakref build rule
Ben Noordhuis [Wed, 23 Oct 2013 11:42:53 +0000 (13:42 +0200)]
build: fix test-gc weakref build rule

Make the build rule depend on the build artifact (weakref.node) itself
rather than the directory it's built in.  Depending on the directory
means that a build failure won't trigger a rebuild on the next
invocation because the directory's timestamp has been updated.

This is a back-port of commit 1189571 from the master branch that
hopefully fixes the following CI error:

    executing:  make test/gc/node_modules/weak/build/
    make: *** No rule to make target `test/gc/node_modules/weak/build/'.
    Command exited with non-zero: make test/gc/node_modules/weak/build/
    Build step 'Execute NodeJS script' marked build as failure

10 years agodoc: add nodejs.rs to the community page
Zarko Stankovic [Thu, 12 Sep 2013 18:13:32 +0000 (20:13 +0200)]
doc: add nodejs.rs to the community page

10 years agohttp client: pull last chunk on socket close
isaacs [Wed, 23 Oct 2013 20:08:06 +0000 (13:08 -0700)]
http client: pull last chunk on socket close

When the socket closes, the client's http incoming message object was
emitting an 'aborted' event if it had not yet been ended.

However, it's possible, when a response is being repeatedly paused and
resumed (eg, if piped to a slow FS write stream), that there will be a
final chunk remaining in the js-land buffer when the socket is torn
down.

When that happens, the socketCloseListener function detects that we have
not yet reached the end of the response message data, and treats this as
an abrupt abort, immediately (and forcibly) ending the incoming message
data stream, and discarding that final chunk of data.

The result is that, for example, npm will have problems because tarballs
are missing a few bytes off the end, every time.

Closes GH-6402

10 years agotest: fix up weakref.cc after v8 api change
Ben Noordhuis [Wed, 23 Oct 2013 11:45:57 +0000 (13:45 +0200)]
test: fix up weakref.cc after v8 api change

10 years agobuild: fix test-gc weakref build rule
Ben Noordhuis [Wed, 23 Oct 2013 11:42:53 +0000 (13:42 +0200)]
build: fix test-gc weakref build rule

Make the build rule depend on the build artifact (weakref.node) itself
rather than the directory it's built in.  Depending on the directory
means that a build failure won't trigger a rebuild on the next
invocation because the directory's timestamp has been updated.

10 years agosrc: update after v8 api changes
Ben Noordhuis [Tue, 22 Oct 2013 22:17:45 +0000 (15:17 -0700)]
src: update after v8 api changes

10 years agov8: upgrade 3.21.18.3
Timothy J Fontaine [Tue, 22 Oct 2013 22:14:25 +0000 (15:14 -0700)]
v8: upgrade 3.21.18.3

10 years agosrc: IsInt64() should return bool, not int
Ben Noordhuis [Wed, 23 Oct 2013 11:25:35 +0000 (13:25 +0200)]
src: IsInt64() should return bool, not int

10 years agoblog: HTTP server DoS vulnerability details
isaacs [Tue, 22 Oct 2013 17:56:03 +0000 (10:56 -0700)]
blog: HTTP server DoS vulnerability details

CVE-2013-4450

10 years agoblog: Post for v0.10.21
Timothy J Fontaine [Fri, 18 Oct 2013 22:46:02 +0000 (15:46 -0700)]
blog: Post for v0.10.21

10 years agoblog: Post for v0.8.26
Timothy J Fontaine [Fri, 18 Oct 2013 22:43:55 +0000 (15:43 -0700)]
blog: Post for v0.8.26

10 years agoNow working on 0.10.22
Timothy J Fontaine [Fri, 18 Oct 2013 22:40:32 +0000 (15:40 -0700)]
Now working on 0.10.22

10 years agoMerge branch 'v0.10.21-release' into v0.10
Timothy J Fontaine [Fri, 18 Oct 2013 22:39:56 +0000 (15:39 -0700)]
Merge branch 'v0.10.21-release' into v0.10

10 years ago2013.10.18, Version 0.10.21 (Stable) v0.10.21
Timothy J Fontaine [Fri, 18 Oct 2013 21:26:27 +0000 (14:26 -0700)]
2013.10.18, Version 0.10.21 (Stable)

* uv: Upgrade to v0.10.18

* crypto: clear errors from verify failure (Timothy J Fontaine)

* dtrace: interpret two byte strings (Dave Pacheco)

* fs: fix fs.truncate() file content zeroing bug (Ben Noordhuis)

* http: provide backpressure for pipeline flood (isaacs)

* tls: fix premature connection termination (Ben Noordhuis)

10 years agocrypto: clear errors from verify failure
Timothy J Fontaine [Fri, 18 Oct 2013 21:14:21 +0000 (14:14 -0700)]
crypto: clear errors from verify failure

OpenSSL will push errors onto the stack when a verify fails, which can
disrupt TLS and other routines if we don't clear the error stack

Fixes #6304

10 years agouv: Upgrade to v0.10.18
Timothy J Fontaine [Fri, 18 Oct 2013 20:52:15 +0000 (13:52 -0700)]
uv: Upgrade to v0.10.18

10 years agohttp: add statusMessage
Patrik Stutz [Thu, 17 Oct 2013 00:11:19 +0000 (02:11 +0200)]
http: add statusMessage

Now the status message can be set via req.statusMessage = 'msg';

10 years agohttp: provide backpressure for pipeline flood
isaacs [Wed, 16 Oct 2013 19:57:46 +0000 (12:57 -0700)]
http: provide backpressure for pipeline flood

If a client sends a lot more pipelined requests than we can handle, then
we need to provide backpressure so that the client knows to back off.
Do this by pausing both the stream and the parser itself when the
responses are not being read by the downstream client.

Backport of 085dd30

10 years agohttp_parser: expose pause/resume method for parser
Timothy J Fontaine [Mon, 14 Oct 2013 18:57:45 +0000 (11:57 -0700)]
http_parser: expose pause/resume method for parser

10 years agodoc: cluster documentation cleanup and corrections
Sam Roberts [Fri, 26 Jul 2013 01:17:38 +0000 (18:17 -0700)]
doc: cluster documentation cleanup and corrections

- fixed some incomprehensible wording ("event assigned to..."?)
- removed undocumented and unnecessary process properties from example
- corrected the docs on the default for the exec setting
- described when workers are removed from cluster.workers
- described addressType, which was documented as existing, but not what
  values it might have
- spell out more clearly the limitations of setupMaster
- describe disconnect in sufficient detail that why a child does or does
  not exit can be understood
- clarify which cluster functions and events are available on process or
  just on the worker, as well as which are not available in children,
- don't describe events as the same, when they have receive different
  arguments
- fix misleading disconnect example: since disconnect already calls
  close on all servers, doing it again in the example is a no-op, not
  the "force close" it was claimed to be
- document the error event, not catching it will kill your node
- describe suicide better, it is important, and a bit unintuitive
  (process.exit() is not suicide?)
- use worker consistently throughout, instead of child.

10 years agodoc: child_process corrections and cleanups
Sam Roberts [Fri, 26 Jul 2013 00:35:21 +0000 (17:35 -0700)]
doc: child_process corrections and cleanups

- Make explicit that .disconnected is set before the disconnect event,
  and it is not allowed to send messages after calling .disconnect(),
  even while waiting for a delayed disconect event.
- Remove obsolete claim that explicit exit is required
- Describe silent: in the options for fork()
- Describe .connected as the property it is, not just as an aside in
  the disconnect() method

10 years agocpplint: disallow if one-liners
Fedor Indutny [Wed, 16 Oct 2013 16:57:26 +0000 (20:57 +0400)]
cpplint: disallow if one-liners

10 years agocpplint: disallow comma-first in C++
Fedor Indutny [Wed, 16 Oct 2013 16:34:39 +0000 (20:34 +0400)]
cpplint: disallow comma-first in C++

10 years agodns: set hostname property on error object
Ben Noordhuis [Tue, 15 Oct 2013 11:01:23 +0000 (13:01 +0200)]
dns: set hostname property on error object

Make debugging and logging easier: when a DNS lookup for a hostname
fails, set the hostname as a property on the error object.

Fixes #5393.

10 years agodns: rename domain to hostname
Ben Noordhuis [Tue, 15 Oct 2013 10:51:12 +0000 (12:51 +0200)]
dns: rename domain to hostname

A follow-up commit will save the domain name on the request object but
we can't call that property 'domain' because that gets intercepted by
src/node.cc and lib/domain.js to implement the node.js feature of the
same name.

To avoid confusion, rename all variables called 'domain' to 'hostname'.

10 years agodebugger: fix SIGUSR1 bootstrap race condition
Ben Noordhuis [Wed, 16 Oct 2013 00:54:24 +0000 (02:54 +0200)]
debugger: fix SIGUSR1 bootstrap race condition

Before this commit, the SIGUSR1 signal handler wasn't installed until
late in the bootstrapping process and we were prone to miss signals
sent by other processes.

This commit installs an early-boot signal handler that merely records
the fact that we received a signal.  Once the debugger infrastructure
is in place, the signal is re-raised, kickstarting the debugger.

Among other things, this means that simple/test-debugger-client is
now _much_ less likely to fail.

10 years agodebugger: make busy loops SIGUSR1-interruptible
Ben Noordhuis [Tue, 15 Oct 2013 21:32:18 +0000 (23:32 +0200)]
debugger: make busy loops SIGUSR1-interruptible

Commit 30e5366b ("core: Use a uv_signal for debug listener") changed
SIGUSR1 handling from a signal handler to libuv's uv_signal_*()
functionality to fix a race condition (and possible hang) in the
signal handler.

While a good change in itself, it made it impossible to interrupt
long running scripts.  When a script is stuck in a busy loop, control
never returns to the event loop, which in turn means the signal
callback - and therefore the debugger - is never invoked.

This commit changes SIGUSR1 handling back to a normal signal handler
but one that treads _very_ carefully.

10 years agohttp: provide backpressure for pipeline flood
isaacs [Thu, 10 Oct 2013 22:00:05 +0000 (15:00 -0700)]
http: provide backpressure for pipeline flood

If a client sends a lot more pipelined requests than we can handle, then
we need to provide backpressure so that the client knows to back off.
Do this by pausing both the stream and the parser itself when the
responses are not being read by the downstream client.

Fix GH-6214