platform/upstream/nodejs.git
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: 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 agodoc: http: reword IncomingMessage 'close' event
Ben Noordhuis [Wed, 16 Oct 2013 10:32:47 +0000 (12:32 +0200)]
doc: http: reword IncomingMessage 'close' event

The bit that says "before response.end() was called or able to flush"
doesn't apply to incoming streams.

Fixes #6359.

10 years agodoc: http: add cross-links for easier clicking
Ben Noordhuis [Wed, 16 Oct 2013 10:20:25 +0000 (12:20 +0200)]
doc: http: add cross-links for easier clicking

Make it a little easier to navigate the http module documentation by
turning class names and methods into links to the appropriate section.

10 years agodoc: expand os.loadavg() section
Ben Noordhuis [Tue, 15 Oct 2013 08:01:50 +0000 (10:01 +0200)]
doc: expand os.loadavg() section

Add a short explanation of what the load average is and why it's
unavailable on Windows.

Also sneak in a fix for a typo that I introduced in commit 56c5806.

10 years agodoc: document os.loadavg() behavior on windows
Ben Noordhuis [Mon, 14 Oct 2013 11:15:00 +0000 (12:15 +0100)]
doc: document os.loadavg() behavior on windows

The load average is a very UNIX-y concept.  That's why os.loadavg()
always returns zeros on Windows.  Mention that in the documentation.

10 years agotest: use proper findjsobjects output format
Dave Pacheco [Thu, 10 Oct 2013 16:41:59 +0000 (09:41 -0700)]
test: use proper findjsobjects output format

Closes #6329

10 years agodoc: net: remove bad net.Server description
Ben Noordhuis [Thu, 10 Oct 2013 12:34:15 +0000 (14:34 +0200)]
doc: net: remove bad net.Server description

net.Server is not an instance of net.Socket so don't say it is.

10 years agodoc: addon: fix object instantiation examples
Ben Noordhuis [Thu, 10 Oct 2013 12:09:38 +0000 (14:09 +0200)]
doc: addon: fix object instantiation examples

* Extend examples to show how to handle non-constructor invocation in
  constructor callback functions.

* Fix up examples to initialize member variables at object construction.

* Fix up a few naming inconsistencies.

Fixes #5701.

10 years agoblog: Remove wp-to-markdown script
isaacs [Mon, 9 Sep 2013 11:31:05 +0000 (12:31 +0100)]
blog: Remove wp-to-markdown script

10 years agotls: fix premature connection termination
Ben Noordhuis [Wed, 9 Oct 2013 15:46:17 +0000 (17:46 +0200)]
tls: fix premature connection termination

Destroying the TLS session implies destroying the underlying socket but
before this commit, that was done with net.Socket#destroy() rather than
net.Socket#destroySoon().  The former closes the connection right away,
even when there is still data to write.  In other words, sometimes the
final TLS record got truncated.

Fixes #6107.

10 years agodtrace: backport two byte string fix
Dave Pacheco [Fri, 4 Oct 2013 22:02:42 +0000 (15:02 -0700)]
dtrace: backport two byte string fix

This is a partial backport of 5921158

Re #6309
Closes #6319

10 years agofs: fix fs.truncate() file content zeroing bug
Ben Noordhuis [Tue, 8 Oct 2013 09:25:22 +0000 (11:25 +0200)]
fs: fix fs.truncate() file content zeroing bug

fs.truncate() and its synchronous sibling are implemented in terms of
open() + ftruncate().  Unfortunately, it opened the target file with
mode 'w' a.k.a. 'write-only and create or truncate at open'.

The subsequent call to ftruncate() then moved the end-of-file pointer
from zero to the requested offset with the net result of a file that's
neatly truncated at the right offset and filled with zero bytes only.

This bug was introduced in commit 168a5557 but in fairness, before that
commit fs.truncate() worked like fs.ftruncate() so it seems we've never
had a working fs.truncate() until now.

Fixes #6233.

10 years agodoc: add warning to fs.exists() documentation
Ben Noordhuis [Sat, 5 Oct 2013 12:45:10 +0000 (14:45 +0200)]
doc: add warning to fs.exists() documentation

Warn against the open-if-exists anti-pattern, it's susceptible to
race conditions.

10 years agodoc: link to pre-built binaries, add install note
Ben Noordhuis [Tue, 1 Oct 2013 06:35:24 +0000 (08:35 +0200)]
doc: link to pre-built binaries, add install note

lLnk to http://nodejs.org/download/ and add a short primer on how to
extract the tarballs.

Fixes #6292.

10 years agoblog: Post for v0.10.20
Timothy J Fontaine [Mon, 30 Sep 2013 22:06:14 +0000 (15:06 -0700)]
blog: Post for v0.10.20

10 years agoNow working on 0.10.21
Timothy J Fontaine [Mon, 30 Sep 2013 22:06:14 +0000 (15:06 -0700)]
Now working on 0.10.21

10 years agoMerge branch 'v0.10.20-release' into v0.10
Timothy J Fontaine [Mon, 30 Sep 2013 22:06:02 +0000 (15:06 -0700)]
Merge branch 'v0.10.20-release' into v0.10

10 years ago2013.09.30, Version 0.10.20 (Stable) v0.10.20
Timothy J Fontaine [Mon, 30 Sep 2013 20:52:48 +0000 (13:52 -0700)]
2013.09.30, Version 0.10.20 (Stable)

* tls: fix sporadic hang and partial reads (Fedor Indutny)
  - fixes "npm ERR! cb() never called!"

10 years agosrc: turn uv_pipe_open() failures into exceptions
Ben Noordhuis [Sat, 28 Sep 2013 08:27:11 +0000 (10:27 +0200)]
src: turn uv_pipe_open() failures into exceptions

uv_pipe_open() is unlikely to fail but when it does, the failure should
not be quietly ignored.  Raise the error as an exception.

See joyent/libuv#941.

10 years agotls: fix sporadic hang and partial reads
Fedor Indutny [Fri, 27 Sep 2013 19:47:13 +0000 (23:47 +0400)]
tls: fix sporadic hang and partial reads

Do not decrement size in read loop, its used later, when comparing to
`bytesRead`.

fix #6270

NOTE: Original patch contributed by @roadrunner2

10 years agoblog: add missing shasums for v0.10.19 release
Timothy J Fontaine [Tue, 24 Sep 2013 22:16:44 +0000 (15:16 -0700)]
blog: add missing shasums for v0.10.19 release

10 years agoblog: Post for v0.10.19
Timothy J Fontaine [Tue, 24 Sep 2013 22:10:22 +0000 (15:10 -0700)]
blog: Post for v0.10.19

10 years agoNow working on 0.10.20
Timothy J Fontaine [Tue, 24 Sep 2013 22:10:22 +0000 (15:10 -0700)]
Now working on 0.10.20

10 years agoMerge branch 'v0.10.19-release' into v0.10
Timothy J Fontaine [Tue, 24 Sep 2013 22:10:10 +0000 (15:10 -0700)]
Merge branch 'v0.10.19-release' into v0.10

10 years ago2013.09.24, Version 0.10.19 (Stable) v0.10.19
Timothy J Fontaine [Tue, 24 Sep 2013 21:10:33 +0000 (14:10 -0700)]
2013.09.24, Version 0.10.19 (Stable)

* uv: Upgrade to v0.10.17

* npm: upgrade to 1.3.11

* readline: handle input starting with control chars (Eric Schrock)

* configure: add mips-float-abi (soft, hard) option (Andrei Sedoi)

* stream: objectMode transforms allow falsey values (isaacs)

* tls: prevent duplicate values returned from read (Nathan Rajlich)

* tls: NPN protocols are now local to connections (Fedor Indutny)

10 years agouv: Upgrade to v0.10.17
Timothy J Fontaine [Tue, 24 Sep 2013 20:45:57 +0000 (13:45 -0700)]
uv: Upgrade to v0.10.17

10 years agoreadline: handle input starting with control chars
Eric Schrock [Mon, 20 May 2013 18:44:26 +0000 (14:44 -0400)]
readline: handle input starting with control chars

Handle control characters only when there is a single byte in the
stream, otherwise fall through to the standard multibyte handling.

10 years agodoc: document reserved status of SIGUSR1
Ben Noordhuis [Thu, 19 Sep 2013 10:27:06 +0000 (12:27 +0200)]
doc: document reserved status of SIGUSR1

Fixes #1212.

10 years agodoc: fix typos in the tls `NPNProtocols` option
Nathan Rajlich [Mon, 16 Sep 2013 20:57:34 +0000 (13:57 -0700)]
doc: fix typos in the tls `NPNProtocols` option

10 years agodoc: specify the format of the `ca` tls option
Nathan Rajlich [Mon, 16 Sep 2013 20:57:00 +0000 (13:57 -0700)]
doc: specify the format of the `ca` tls option

10 years agotls: don't push() incoming data when ondata is set
Nathan Rajlich [Thu, 12 Sep 2013 01:18:10 +0000 (18:18 -0700)]
tls: don't push() incoming data when ondata is set

Otherwise the data ends up "on the wire" twice, and
switching between consuming the stream using `ondata`
vs. `read()` would yield duplicate data, which was bad.

10 years agodoc: fix blog link in blog posts and README
Ben Noordhuis [Fri, 13 Sep 2013 12:46:06 +0000 (14:46 +0200)]
doc: fix blog link in blog posts and README

Apparently Joyent decommissioned joyeur.com but at least they saved the
contents of the blog.  Update the links in the README and the nodejs.org
blog posts.

Hat tip to Eugen Pirogoff (@eugenpirogoff) for pointing it out.

Fixes #6224.

10 years agotls: fix setting NPN protocols
Fedor Indutny [Mon, 9 Sep 2013 14:18:05 +0000 (18:18 +0400)]
tls: fix setting NPN protocols

The NPN protocols was set on `require('tls')` or `global` object instead
of being a local property. This fact lead to strange persistence of NPN
protocols, and sometimes incorrect protocol selection (when no NPN
protocols were passed in client options).

fix #6168

10 years agoconfigure: add mips-float-abi (soft, hard) option
Andrei Sedoi [Wed, 19 Jun 2013 11:48:36 +0000 (14:48 +0300)]
configure: add mips-float-abi (soft, hard) option

10 years agonpm: upgrade to 1.3.11
isaacs [Sat, 7 Sep 2013 19:31:04 +0000 (14:31 -0500)]
npm: upgrade to 1.3.11

10 years agonpm: upgrade to v1.3.10
isaacs [Fri, 6 Sep 2013 00:13:50 +0000 (17:13 -0700)]
npm: upgrade to v1.3.10

10 years agostream: objectMode transforms allow falsey values
isaacs [Thu, 5 Sep 2013 20:11:51 +0000 (13:11 -0700)]
stream: objectMode transforms allow falsey values

Closes #6183

10 years agouv: upgrade to v0.10.16
Bert Belder [Thu, 5 Sep 2013 14:49:47 +0000 (16:49 +0200)]
uv: upgrade to v0.10.16

10 years agoblog: Post for v0.11.7
Timothy J Fontaine [Wed, 4 Sep 2013 22:27:06 +0000 (15:27 -0700)]
blog: Post for v0.11.7

10 years agoblog: Post for v0.10.18
Timothy J Fontaine [Wed, 4 Sep 2013 18:25:19 +0000 (11:25 -0700)]
blog: Post for v0.10.18

10 years agoNow working on 0.10.19
Timothy J Fontaine [Wed, 4 Sep 2013 18:25:19 +0000 (11:25 -0700)]
Now working on 0.10.19

10 years agoMerge branch 'v0.10.18-release' into v0.10
Timothy J Fontaine [Wed, 4 Sep 2013 18:25:04 +0000 (11:25 -0700)]
Merge branch 'v0.10.18-release' into v0.10

10 years ago2013.09.04, Version 0.10.18 (Stable) v0.10.18
Timothy J Fontaine [Wed, 4 Sep 2013 17:51:53 +0000 (10:51 -0700)]
2013.09.04, Version 0.10.18 (Stable)

* uv: Upgrade to v0.10.15

* stream: Don't crash on unset _events property (isaacs)

* stream: Pass 'buffer' encoding with decoded writable chunks (isaacs)

10 years agodoc: fix writable.write link
Kyle Robinson Young [Tue, 3 Sep 2013 22:00:45 +0000 (15:00 -0700)]
doc: fix writable.write link

10 years agobenchmark: Fix execArgv handling
isaacs [Sun, 1 Sep 2013 00:58:17 +0000 (17:58 -0700)]
benchmark: Fix execArgv handling

Bug in 01f3b46 causes the same benchmark to be run repeatedly.

Not so useful for the compare scripts.

10 years agobenchmark: Support passing v8 flags to benchmarks
isaacs [Sat, 31 Aug 2013 05:39:06 +0000 (22:39 -0700)]
benchmark: Support passing v8 flags to benchmarks

The better to test --use-strict effects on performance.

(Spoiler: it has no measurable effect on performance.)

10 years agostream: check _events before _events.error
isaacs [Wed, 28 Aug 2013 16:35:36 +0000 (09:35 -0700)]
stream: check _events before _events.error

This fixes the regression introduced by 5458079, which breaks the
net/net-pipe benchmark script.

Closes #6145

10 years agodoc: Adjust util stability index to 'API Frozen'
isaacs [Wed, 28 Aug 2013 02:52:09 +0000 (19:52 -0700)]
doc: Adjust util stability index to 'API Frozen'

Closes #6087

10 years agostream: Pass 'buffer' encoding to decoded writables
isaacs [Tue, 27 Aug 2013 21:53:06 +0000 (14:53 -0700)]
stream: Pass 'buffer' encoding to decoded writables

Since the encoding is no longer relevant once it is decoded to a Buffer,
it is confusing and incorrect to pass the encoding as 'utf8' or whatever
in those cases.

Closes #6119

10 years agouv: update to v0.10.15
Bert Belder [Fri, 23 Aug 2013 17:02:14 +0000 (19:02 +0200)]
uv: update to v0.10.15

10 years agotools: script release steps after jenkins build
Timothy J Fontaine [Wed, 21 Aug 2013 23:59:15 +0000 (16:59 -0700)]
tools: script release steps after jenkins build

10 years agotools: script to report [un]stable build
Timothy J Fontaine [Wed, 21 Aug 2013 23:55:27 +0000 (16:55 -0700)]
tools: script to report [un]stable build

10 years agoblog: Post for v0.10.17
Timothy J Fontaine [Wed, 21 Aug 2013 23:38:30 +0000 (16:38 -0700)]
blog: Post for v0.10.17

10 years agoNow working on 0.10.18
Timothy J Fontaine [Wed, 21 Aug 2013 23:37:43 +0000 (16:37 -0700)]
Now working on 0.10.18

10 years agoMerge branch 'v0.10.17-release' into v0.10
Timothy J Fontaine [Wed, 21 Aug 2013 23:37:31 +0000 (16:37 -0700)]
Merge branch 'v0.10.17-release' into v0.10

10 years ago2013.08.21, Version 0.10.17 (Stable) v0.10.17
Timothy J Fontaine [Wed, 21 Aug 2013 22:00:56 +0000 (15:00 -0700)]
2013.08.21, Version 0.10.17 (Stable)

* uv: Upgrade v0.10.14

* http_parser: Do not accept PUN/GEM methods as PUT/GET (Chris Dickinson)

* tls: fix assertion when ssl is destroyed at read (Fedor Indutny)

* stream: Throw on 'error' if listeners removed (isaacs)

* dgram: fix assertion on bad send() arguments (Ben Noordhuis)

* readline: pause stdin before turning off terminal raw mode (Daniel Chatfield)

10 years agouv: Upgrade v0.10.14
Timothy J Fontaine [Wed, 21 Aug 2013 21:44:20 +0000 (14:44 -0700)]
uv: Upgrade v0.10.14

10 years agoblog: v0.11.6
Timothy J Fontaine [Wed, 21 Aug 2013 21:26:32 +0000 (14:26 -0700)]
blog: v0.11.6

10 years agodoc: Mention python dep in downloads page
isaacs [Wed, 21 Aug 2013 18:11:02 +0000 (11:11 -0700)]
doc: Mention python dep in downloads page

Closes #3604

10 years agodeps: upgrade http_parser to 303c4e4
Ben Noordhuis [Wed, 21 Aug 2013 01:33:20 +0000 (03:33 +0200)]
deps: upgrade http_parser to 303c4e4

Upgrade to joyent/http-parser@303c4e4. Changes:

  * Do not accept PUN/GEM methods as PUT/GET.
  * Further request method check strengthening.

10 years agotls: fix assertion when ssl is destroyed at read
Fedor Indutny [Wed, 21 Aug 2013 11:58:33 +0000 (15:58 +0400)]
tls: fix assertion when ssl is destroyed at read

`maybeInitFinished()` can emit the 'secure' event which
in turn destroys the connection in case of authentication
failure and sets `this.pair.ssl` to `null`.

If such condition appeared after non-empty read - loop will continue
and `clearOut` will be called on `null` object instead of
`crypto::Connection` instance. Resulting in the following assertion:

    ERROR: Error: Hostname/IP doesn't match certificate's altnames
    Assertion failed: handle->InternalFieldCount() > 0

fix #5756

10 years agofs: use correct self reference for autoClose test
Gil Pedersen [Tue, 20 Aug 2013 13:53:54 +0000 (15:53 +0200)]
fs: use correct self reference for autoClose test

10 years agodoc: Minor typos in dgram doc
isaacs [Tue, 20 Aug 2013 00:55:58 +0000 (17:55 -0700)]
doc: Minor typos in dgram doc

a/an usage.  Thanks @KenanSulayman

10 years agodoc: Add callback parameter to dgram socket.bind()
Duan Yao [Tue, 4 Dec 2012 10:12:10 +0000 (18:12 +0800)]
doc: Add callback parameter to dgram socket.bind()

Also, describe more details of bind().

10 years agodoc: fixed syntax error in stream.Transform
ChrisWren [Sun, 11 Aug 2013 19:30:03 +0000 (12:30 -0700)]
doc: fixed syntax error in stream.Transform

10 years agoAdded documentation for process.execArgv
Edward Hutchins [Thu, 23 May 2013 01:04:36 +0000 (18:04 -0700)]
Added documentation for process.execArgv

10 years agodoc: add missing word in Transform stream intro
Eivind Uggedal [Thu, 4 Jul 2013 16:52:14 +0000 (18:52 +0200)]
doc: add missing word in Transform stream intro

10 years agostream: Throw on 'error' if listeners removed
isaacs [Mon, 19 Aug 2013 14:59:39 +0000 (07:59 -0700)]
stream: Throw on 'error' if listeners removed

In this situation:

    writable.on('error', handler);
    readable.pipe(writable);
    writable.removeListener('error', handler);
    writable.emit('error', new Error('boom'));

there is actually no error handler, but it doesn't throw, because of the
fix for stream.once('error', handler), in 23d92ec.

Note that simply reverting that change is not valid either, because
otherwise this will emit twice, being handled the first time, and then
throwing the second:

    writable.once('error', handler);
    readable.pipe(writable);
    writable.emit('error', new Error('boom'));

Fix this with a horrible hack to make the stream pipe onerror handler
added before any other userland handlers, so that our handler is not
affected by adding or removing any userland handlers.

Closes #6007.

10 years agodgram: fix assertion on bad send() arguments
Ben Noordhuis [Fri, 9 Aug 2013 00:33:40 +0000 (02:33 +0200)]
dgram: fix assertion on bad send() arguments

Add range checks for the offset, length and port arguments to
dgram.Socket#send().  Fixes the following assertion:

    node: ../../src/udp_wrap.cc:264: static v8::Handle<v8::Value>
    node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
    `offset < Buffer::Length(buffer_obj)' failed.

And:

    node: ../../src/udp_wrap.cc:265: static v8::Handle<v8::Value>
    node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion
    `length <= Buffer::Length(buffer_obj) - offset' failed.

Interestingly enough, a negative port number was accepted until now but
silently ignored.  (In other words, it would send the datagram to a
random port.)

This commit exposed a bug in the simple/test-dgram-close test which
has also been fixed.

This is a back-port of commit 41ec6d0 from the master branch.

Fixes #6025.

10 years agoreadline: pause stdin before turning off terminal raw mode
Daniel Chatfield [Tue, 30 Jul 2013 13:43:31 +0000 (14:43 +0100)]
readline: pause stdin before turning off terminal raw mode

On windows, libuv will immediately make a `ReadConsole` call (in the
thread pool) when a 'flowing' `uv_tty_t` handle is switched to
line-buffered mode. That causes an immediate issue for some users,
since libuv can't cancel the `ReadConsole` operation on Windows 8 /
Server 2012 and up if the program switches back to raw mode later.

But even if this will be fixed in libuv at some point, it's better to
avoid the overhead of starting work in the thread pool and immediately
cancelling it afther that.

See also f34f1e3, where the same change is made for the opposite
flow, e.g. move `resume()` after `_setRawMode(true)`.

Fixes #5927

This is a backport of dfb0461 (see #5930) to the v0.10 branch.

10 years agoblog: v0.10.16
isaacs [Fri, 16 Aug 2013 19:47:54 +0000 (12:47 -0700)]
blog: v0.10.16

10 years agoNow working on v0.10.17
isaacs [Fri, 16 Aug 2013 19:47:29 +0000 (12:47 -0700)]
Now working on v0.10.17

10 years agoMerge branch 'v0.10.16-release' into v0.10
isaacs [Fri, 16 Aug 2013 19:46:56 +0000 (12:46 -0700)]
Merge branch 'v0.10.16-release' into v0.10

10 years ago2013.08.16, Version 0.10.16 (Stable) v0.10.16
isaacs [Fri, 16 Aug 2013 15:31:10 +0000 (08:31 -0700)]
2013.08.16, Version 0.10.16 (Stable)

* v8: back-port fix for CVE-2013-2882

* npm: Upgrade to 1.3.8

* crypto: fix assert() on malformed hex input (Ben Noordhuis)

* crypto: fix memory leak in randomBytes() error path (Ben Noordhuis)

* events: fix memory leak, don't leak event names (Ben Noordhuis)

* http: Handle hex/base64 encodings properly (isaacs)

* http: improve chunked res.write(buf) performance (Ben Noordhuis)

* stream: Fix double pipe error emit (Eran Hammer)

10 years agonpm: Upgrade to 1.3.8
isaacs [Fri, 16 Aug 2013 15:19:31 +0000 (08:19 -0700)]
npm: Upgrade to 1.3.8

10 years agocrypto: fix memory leak in randomBytes() error path
Ben Noordhuis [Fri, 16 Aug 2013 14:49:00 +0000 (16:49 +0200)]
crypto: fix memory leak in randomBytes() error path

This is the conceptual back-port of commit ec54873 from the master
branch.

10 years agohttp: Handle hex/base64 encodings properly
isaacs [Thu, 15 Aug 2013 22:01:28 +0000 (15:01 -0700)]
http: Handle hex/base64 encodings properly

This is a backport of 6d3d60aced39d59eaa5e705b7d822c227d0d3dae for
v0.10.

10 years agoblog: Post for v0.11.5
Timothy J Fontaine [Wed, 7 Aug 2013 00:14:53 +0000 (17:14 -0700)]
blog: Post for v0.11.5

10 years agostream: Fix double pipe error emit
Eran Hammer [Mon, 5 Aug 2013 09:56:40 +0000 (02:56 -0700)]
stream: Fix double pipe error emit

If an error listener is added to a stream using once() before it is
piped, it is invoked and removed during pipe() but before pipe() sees it
which causes it to be emitted again.

Fixes #4155 #4978

10 years agodoc: Update LICENSE for npm's Artistic 2.0
isaacs [Mon, 5 Aug 2013 20:56:05 +0000 (13:56 -0700)]
doc: Update LICENSE for npm's Artistic 2.0

10 years agov8: back-port fix for CVE-2013-2882
mstarzinger@chromium.org [Mon, 15 Jul 2013 11:41:41 +0000 (11:41 +0000)]
v8: back-port fix for CVE-2013-2882

Quoting the CVE:

    Google V8, as used in Google Chrome before 28.0.1500.95, allows
    remote attackers to cause a denial of service or possibly have
    unspecified other impact via vectors that leverage "type confusion."

Likely has zero impact on node.js because it only runs local, trusted
code but let's apply it anyway.

This is a back-port of upstream commit r15665. Original commit log:

    Use internal array as API function cache.

    R=yangguo@chromium.org
    BUG=chromium:260106
    TEST=cctest/test-api/Regress260106

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

Fixes #5973.

10 years agodoc: document domain.enter() and domain.exit()
Forrest L Norvell [Thu, 14 Mar 2013 20:31:18 +0000 (13:31 -0700)]
doc: document domain.enter() and domain.exit()

Adds the documentation requested in #5017.

10 years agodoc: fs.open, fix flag/mode confusion, etc.
Sam Roberts [Fri, 2 Aug 2013 19:41:24 +0000 (12:41 -0700)]
doc: fs.open, fix flag/mode confusion, etc.

Flags and modes aren't the same, symlinks are followed in all of the
path but the last component, docs should say something about what the
mode argument is for and when its used, fs.openSync should point to the
function that contains the docs for its args, as fs.writeSync does.

10 years agonpm: Upgrade to 1.3.7
isaacs [Fri, 2 Aug 2013 21:55:01 +0000 (14:55 -0700)]
npm: Upgrade to 1.3.7

10 years agotest: future-proof simple/test-event-emitter-memory-leak
Ben Noordhuis [Thu, 1 Aug 2013 14:09:42 +0000 (16:09 +0200)]
test: future-proof simple/test-event-emitter-memory-leak

Run the garbage collector before running the actual test. It doesn't
matter now but if in the future something in node.js core creates a lot
of reclaimable garbage, that will break the test's expectation.

10 years agotest: fix pummel/test-net-connect-memleak
Ben Noordhuis [Thu, 1 Aug 2013 14:00:40 +0000 (16:00 +0200)]
test: fix pummel/test-net-connect-memleak

* Run the garbage collector before creating the big array. It doesn't
  matter now but if in the future something in node.js core creates
  a lot of reclaimable garbage, that will break the test's expectation.

* The first RSS check was being done too late. The garbage collector
  might have run before the check, throwing off the 'reclaimed memory'
  calculation.

* Due to changes in how V8 represents the big array internally, the
  actual memory usage is just below 256 MB on x64. Update the test's
  expectation.

10 years agoevents: fix memory leak, don't leak event names
Ben Noordhuis [Thu, 1 Aug 2013 12:35:13 +0000 (14:35 +0200)]
events: fix memory leak, don't leak event names

Before this commit, events were set to undefined rather than deleted
from the EventEmitter's backing dictionary for performance reasons:
`delete obj.key` causes a transition of the dictionary's hidden class
and that can be costly.

Unfortunately, that introduces a memory leak when many events are added
and then removed again. The strings containing the event names are never
reclaimed by the garbage collector because they remain part of the
dictionary.

That's why this commit makes EventEmitter delete events again. This
effectively reverts commit 0397223.

Fixes #5970.

10 years agohttp: improve chunked res.write(buf) performance
Ben Noordhuis [Wed, 31 Jul 2013 03:50:26 +0000 (05:50 +0200)]
http: improve chunked res.write(buf) performance

Avoid a costly buffer-to-string operation. Instead, allocate a new
buffer, copy the chunk header and data into it and send that.

The speed difference is negligible on small payloads but it really
shines with larger (10+ kB) chunks. benchmark/http/end-vs-write-end
with 64 kB chunks gives 45-50% higher throughput. With 1 MB chunks,
the difference is a staggering 590%.

Of course, YMMV will vary with real workloads and networks but this
commit should have a positive impact on CPU and memory consumption.

Big kudos to Wyatt Preul (@wpreul) for reporting the issue and providing
the initial patch.

Fixes #5941 and #5944.

10 years agodocs: Warning about consuming response
Wyatt Preul [Tue, 11 Jun 2013 20:56:03 +0000 (15:56 -0500)]
docs: Warning about consuming response

10 years agocrypto: fix assert() on malformed hex input
Ben Noordhuis [Tue, 30 Jul 2013 12:27:13 +0000 (14:27 +0200)]
crypto: fix assert() on malformed hex input

Use the StringBytes::IsValidString() function introduced in commit
dce26cc to ensure that the input string meets the expectations of the
other StringBytes functions before processing it further.

Fixes the following assertion:

    Assertion failed: (str->Length() % 2 == 0 && "invalid hex string
    length"), function StorageSize, file ../../src/string_bytes.cc,
    line 301.

Fixes #5725.

10 years agostring_bytes: add StringBytes::IsValidString()
Ben Noordhuis [Tue, 30 Jul 2013 12:26:11 +0000 (14:26 +0200)]
string_bytes: add StringBytes::IsValidString()

Performs a quick, non-exhaustive check on the input string to see if
it's compatible with the specified string encoding.

Curently it only checks that hex strings have a length that is a
multiple of two.

10 years agodoc: clarify fs.read() offset argument
Ben Noordhuis [Sat, 27 Jul 2013 22:05:10 +0000 (00:05 +0200)]
doc: clarify fs.read() offset argument

10 years agodoc: add nodejs.geek.nz to the community page
Andrew Chilton [Sat, 27 Jul 2013 11:13:55 +0000 (23:13 +1200)]
doc: add nodejs.geek.nz to the community page

10 years agodoc: add nodejs.org.au to community listing
Rod Vagg [Sat, 27 Jul 2013 05:20:08 +0000 (15:20 +1000)]
doc: add nodejs.org.au to community listing

10 years agotest: fix simple/test-setproctitle
Ben Noordhuis [Thu, 25 Jul 2013 10:24:40 +0000 (12:24 +0200)]
test: fix simple/test-setproctitle

The title shouldn't be too long; libuv's uv_set_process_title() out of
security considerations no longer overwrites envp, only argv, so the
maximum title length is possibly quite short.

Fixes #5908.

10 years agoblog: Post for v0.10.15
Timothy J Fontaine [Fri, 26 Jul 2013 00:03:21 +0000 (17:03 -0700)]
blog: Post for v0.10.15