isaacs [Tue, 19 Feb 2013 21:23:47 +0000 (13:23 -0800)]
2013.02.19, Version 0.9.10 (Unstable)
* V8: Upgrade to 3.15.11.15
* npm: Upgrade to 1.2.12
* fs: Change default WriteStream config, increase perf (isaacs)
* process: streamlining tick callback logic (Trevor Norris)
* stream_wrap, udp_wrap: add read-only fd property (Ben Noordhuis)
* buffer: accept negative indices in Buffer#slice() (Ben Noordhuis)
* tls: Cycle data when underlying socket drains (isaacs)
* stream: read(0) should not always trigger _read(n,cb) (isaacs)
* stream: Empty strings/buffers do not signal EOF any longer (isaacs)
* crypto: improve cipher/decipher error messages (Ben Noordhuis)
* net: Respect the 'readable' flag on sockets (isaacs)
* net: don't suppress ECONNRESET (Ben Noordhuis)
* typed arrays: copy Buffer in typed array constructor (Ben Noordhuis)
* typed arrays: make DataView throw on non-ArrayBuffer (Ben Noordhuis)
* windows: MSI installer enhancements (Scott Blomquist, Jim Schubert)
isaacs [Tue, 19 Feb 2013 21:18:36 +0000 (13:18 -0800)]
npm: Upgrade to 1.2.12
isaacs [Tue, 19 Feb 2013 19:37:48 +0000 (11:37 -0800)]
tls: Write pending data on socket drain
Fixes #4800
isaacs [Tue, 19 Feb 2013 02:26:29 +0000 (18:26 -0800)]
test: Fix regression in tls test
Undefined reference, introduced by a77c29a.
isaacs [Tue, 19 Feb 2013 02:26:29 +0000 (18:26 -0800)]
test: Fix tls tests which fail sporadically
The count of ECONNRESETs is dependent on timing, and thus unreliable,
especially on Linux machines.
isaacs [Mon, 18 Feb 2013 19:24:14 +0000 (11:24 -0800)]
doc: Use 'close' rather than 'exit' in spawn examples
Close #4515
isaacs [Mon, 18 Feb 2013 18:38:37 +0000 (10:38 -0800)]
http: Add fixme comment about ECONNRESET handling
isaacs [Mon, 18 Feb 2013 18:21:08 +0000 (10:21 -0800)]
Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
AUTHORS
ChangeLog
lib/http.js
src/node_version.h
test/simple/test-http-header-response-splitting.js
Gil Pedersen [Thu, 14 Feb 2013 19:26:54 +0000 (20:26 +0100)]
stream: Pipe data in chunks matching read data
This creates better flow for large values of lowWaterMark.
isaacs [Sun, 3 Feb 2013 20:53:33 +0000 (12:53 -0800)]
fs: Change default WriteStream config, increase perf
This increases fs.WriteStream throughput dramatically by removing the
"higher default water marks" for fs.WriteStream.
Also includes a benchmark. Current performance is significantly higher
than v0.8 for strings at all tested levels except size=1. Buffer
performance is still lackluster.
Further improvement in the stream.Writable base class is required, but
this is a start.
isaacs [Sat, 16 Feb 2013 02:31:43 +0000 (18:31 -0800)]
test: Bump up debugger timeouts
200ms is still short enough for occasional spurious failures.
Trevor Norris [Wed, 13 Feb 2013 14:30:06 +0000 (06:30 -0800)]
process: allow ticker to cross communicate better
Using external memory values allows for quick communication between js
and cc land, so we can check if the js land callback needs to be run.
(this is where I meant that manually tracking nextTickQueue.length would
be helpful)
Also did some minor cleanup of removing the old Tick and
StartTickSpinner functions, and a few unneeded comments.
Conflicts:
src/node.cc
Trevor Norris [Thu, 7 Feb 2013 01:26:18 +0000 (17:26 -0800)]
process: streamlining tick callback logic
* Callbacks from spinner now calls its own function, separate from the
tickCallback logic
* MakeCallback will call a domain specific function if a domain is
detected
* _tickCallback assumes no domains, until nextTick receives a callback
with a domain. After that _tickCallback is overridden with the domain
specific implementation.
* _needTickCallback runs in startup() instead of nextTick (isaacs)
* Fix bug in _fatalException where exit would be called twice (isaacs)
* Process.domain has a default value of null
* Manually track nextTickQueue.length (will be useful later)
* Update tests to reflect internal api changes
isaacs [Fri, 1 Feb 2013 22:23:28 +0000 (14:23 -0800)]
Revert "Move MakeCallback to JS"
This reverts commit
0109a9f90acdfdb287436676f2384f7b072fbb6a.
Also included: Port all the changes to process._makeCallback into the
C++ version. Immediate nextTick, etc.
This yields a slight boost in several benchmarks. V8 is optimizing and
deoptimizing process._makeCallback repeatedly.
Shigeki Ohtsu [Wed, 6 Feb 2013 02:14:24 +0000 (11:14 +0900)]
doc: add setImmediate execute timing description
Shigeki Ohtsu [Wed, 6 Feb 2013 02:13:02 +0000 (11:13 +0900)]
timer: move setImmediate from timer to uv_check
uv_check is the robust place to invoke setImmediate callbacks after
process.nextTick and before timers(setTimeout/setInterval)
isaacs [Fri, 15 Feb 2013 19:24:20 +0000 (11:24 -0800)]
blog: Release v0.8.20
isaacs [Fri, 15 Feb 2013 19:24:08 +0000 (11:24 -0800)]
Now working on v0.8.21
isaacs [Fri, 15 Feb 2013 19:23:55 +0000 (11:23 -0800)]
Merge branch 'v0.8.20-release' into v0.8
isaacs [Fri, 15 Feb 2013 17:57:32 +0000 (09:57 -0800)]
2013.02.15, Version 0.8.20 (Stable)
* npm: Upgrade to v1.2.11
* http: Do not let Agent hand out destroyed sockets (isaacs)
* http: Raise hangup error on destroyed socket write (isaacs)
* http: protect against response splitting attacks (Bert Belder)
isaacs [Fri, 15 Feb 2013 18:49:16 +0000 (10:49 -0800)]
npm: Upgrade to v1.2.11
isaacs [Thu, 14 Feb 2013 23:37:12 +0000 (15:37 -0800)]
http: Do not let Agent hand out destroyed sockets
Fix #4373
isaacs [Thu, 14 Feb 2013 16:57:32 +0000 (08:57 -0800)]
http: Raise hangup error on destroyed socket write
Prior to v0.10, Node ignored ECONNRESET errors in many situations.
There *are* valid cases in which ECONNRESET should be ignored as a
normal part of the TCP dance, but in many others, it's a very relevant
signal that must be heeded with care.
Exacerbating this problem, if the OutgoingMessage does not have a
req.connection._handle, it assumes that it is in the process of
connecting, and thus buffers writes up in an array.
The problem happens when you reuse a socket between two requests, and it
is destroyed abruptly in between them. The writes will be buffered,
because the socket has no handle, but it's not ever going to GET a
handle, because it's not connecting, it's destroyed.
The proper fix is to treat ECONNRESET correctly. However, this is a
behavior/semantics change, and cannot land in a stable branch.
Fix #4775
Ben Noordhuis [Thu, 14 Feb 2013 18:41:33 +0000 (19:41 +0100)]
doc: clarify child_process.exec() stdio option
It only works for stdin, not stdout/stderr, for obvious reasons.
Ben Noordhuis [Thu, 14 Feb 2013 11:42:54 +0000 (12:42 +0100)]
doc: add tools/ dir to CONTRIBUTING.md verboten list
Dan Kohn [Tue, 12 Feb 2013 20:04:23 +0000 (15:04 -0500)]
doc: add prompt to fix repl_test.js example
Running repl.start without the prompt set produces this error:
repl.js:95
throw new Error('An options Object, or a prompt String are required');
^
Error: An options Object, or a prompt String are required
at new REPLServer (repl.js:95:11)
at Object.exports.start (repl.js:321:14)
at Object.<anonymous> (/Users/dan/Dropbox/Documents/dev/nextgen/repl_test.js:5:6)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Ben Noordhuis [Wed, 13 Feb 2013 15:09:03 +0000 (16:09 +0100)]
stream_wrap, udp_wrap: add read-only fd property
Expose the file descriptor as a read-only property on the internal
handle objects. Intended for debugging purposes, not part of the API
proper. The property is always null on Windows.
Fixes #4754.
Ben Noordhuis [Wed, 13 Feb 2013 14:54:17 +0000 (15:54 +0100)]
udp_wrap: use proper imports in source file
Ben Noordhuis [Wed, 13 Feb 2013 14:44:35 +0000 (15:44 +0100)]
udp_wrap: don't use namespace imports in header
It's not really harmful but it's inconsistent with the other header
files.
Ben Noordhuis [Tue, 12 Feb 2013 13:58:35 +0000 (14:58 +0100)]
buffer: accept negative indices in Buffer#slice()
A negative start or end parameter now indexes from the end of the
buffer. More in line with String#slice() and ArrayBuffer#slice().
isaacs [Tue, 12 Feb 2013 17:08:50 +0000 (09:08 -0800)]
net: Respect the 'readable' flag on sockets
Previously, we were only destroying sockets on end if their readable
side had already been ended. This causes a problem for non-readable
streams, since we don't expect to ever see an 'end' event from those.
Treat the lack of a 'readable' flag the same as if it was an ended
readable stream.
Fix #4751
isaacs [Wed, 13 Feb 2013 00:30:25 +0000 (16:30 -0800)]
blog: Forgot slug on peer-dependencies article
isaacs [Tue, 12 Feb 2013 20:03:52 +0000 (12:03 -0800)]
blog: Peer Dependencies article
Thanks, @domenic
Ben Noordhuis [Tue, 12 Feb 2013 18:37:30 +0000 (19:37 +0100)]
bench: make io.c file path configurable
Fedor Indutny [Tue, 12 Feb 2013 11:00:13 +0000 (15:00 +0400)]
test: fix tests after ECONNRESET patch
Victor Costan [Sat, 9 Feb 2013 01:47:00 +0000 (20:47 -0500)]
Fix crypto.hmac behavior with empty keys.
node 0.9.6 introduced Buffer changes that cause the key argument of
Hmac::HmacInit (used in crypto.createHmac) to be NULL when the key is
empty. This argument is passed to OpenSSL's HMAC_Init, which does not
like NULL keys.
This change works around the issue by passing an empty string to
HMAC_Init when the key is empty, and adds crypto.createHmac tests for
the edge cases of empty keys and values.
isaacs [Mon, 11 Feb 2013 23:46:19 +0000 (15:46 -0800)]
tls: Cycle data when underlying socket drains
isaacs [Mon, 11 Feb 2013 23:37:50 +0000 (15:37 -0800)]
stream: read(0) should not always trigger _read(n,cb)
This is causing the CryptoStreams to get into an awful state when
there is a tight loop calling connection.write(chunk) waiting for
a false return.
Because CryptoStreams use read(0) to cycle data, this was causing
the encrypted side to pull way too much data in from the cleartext
side, since the read(0) would make it always call _read.
The unfortunate side effect, fixed in the next patch, is that
CryptoStreams don't automatically cycle when the Socket drains.
isaacs [Mon, 11 Feb 2013 23:45:53 +0000 (15:45 -0800)]
stream: Empty strings/buffers do not signal EOF any longer
Ben Noordhuis [Mon, 11 Feb 2013 20:22:34 +0000 (21:22 +0100)]
crypto: improve cipher/decipher error messages
Throw the OpenSSL error string instead of the rather less informative
error message "fail".
isaacs [Sun, 3 Feb 2013 04:52:04 +0000 (20:52 -0800)]
test: update http tests for ECONNRESET change
Ben Noordhuis [Thu, 31 Jan 2013 18:48:25 +0000 (19:48 +0100)]
net: don't suppress ECONNRESET
Let ECONNRESET network errors bubble up so clients can detect them.
Commit
c4454d2e suppressed and turned them into regular end-of-stream
events to fix the then-failing simple/test-regress-GH-1531 test. See
also issue #1571 for (scant) details.
It turns out that special handling is no longer necessary. Remove the
special casing and let the error bubble up naturally.
pummel/test-https-ci-reneg-attack and pummel/test-tls-ci-reneg-attack
are updated because they expected an EPIPE error code that is now an
ECONNRESET. Suppression of the ECONNRESET prevented the test from
detecting that the connection has been severed whereupon the next
write would fail with an EPIPE.
Fixes #1776.
Ben Noordhuis [Mon, 11 Feb 2013 13:01:18 +0000 (14:01 +0100)]
fs: fix immediate WriteStream#end()
Fix an exception that was raised when the WriteStream was closed
immediately after creating it:
TypeError: Cannot read property 'fd' of undefined
at WriteStream.close (fs.js:1537:18)
<snip>
Avoid the TypeError and make sure the file descriptor is closed.
Fixes #4745.
Ben Noordhuis [Mon, 11 Feb 2013 16:34:56 +0000 (17:34 +0100)]
typed arrays: make call-as-function work for ctors
Turn call-as-function calls into constructor calls. Makes the following
snippet work:
var buf = ArrayBuffer(32); // no 'new' but does the right thing
Ben Noordhuis [Mon, 11 Feb 2013 16:30:04 +0000 (17:30 +0100)]
node: don't malloc in FromConstructorTemplate
* allocate space for argv on the stack
* move the declaration to node_internals.h
Ben Noordhuis [Mon, 11 Feb 2013 12:33:50 +0000 (13:33 +0100)]
test: fix common.mustCall
Don't run the 'has function been called?' checks if the test is exiting
with an error because a failed check will mask the real exception.
v0.8 doesn't have the _fatalException machinery in src/node.js and
src/node.cc so it doesn't have this issue.
Ben Noordhuis [Sun, 10 Feb 2013 20:41:06 +0000 (21:41 +0100)]
doc: update buffer/typed array documentation
Clarify that typed array constructors accept buffers as their first
argument but that the memory is not shared and why this was changed
in v0.9.
Ben Noordhuis [Sun, 10 Feb 2013 20:28:11 +0000 (21:28 +0100)]
typed arrays: copy Buffer in typed array constructor
Convert the Buffer to an ArrayBuffer. The typed_array.buffer property
should be an ArrayBuffer to avoid confusion: a Buffer doesn't have a
byteLength property and more importantly, its slice() method works
subtly different.
That means that before this commit:
var buf = new Buffer(1);
var arr = new Int8Array(buf);
assert.equal(arr.buffer, buf);
assert(arr.buffer instanceof Buffer);
And now:
var buf = new Buffer(1);
var arr = new Int8Array(buf);
assert.notEqual(arr.buffer, buf);
assert(arr.buffer instanceof ArrayBuffer);
Ben Noordhuis [Sat, 9 Feb 2013 08:09:13 +0000 (09:09 +0100)]
typed arrays: make DataView throw on non-ArrayBuffer
Make the DataView constructor throw an exception when the first
argument is not an ArrayBuffer. Follows the spec and the browsers.
Ben Noordhuis [Sat, 9 Feb 2013 07:58:48 +0000 (08:58 +0100)]
buffer: fix Buffer::HasInstance() check
It was returning true for typed arrays. Check that the object was
instantiated with the Buffer constructor.
Ben Noordhuis [Sat, 9 Feb 2013 07:49:45 +0000 (08:49 +0100)]
Revert "typed arrays: only share ArrayBuffer backing store"
We're going to fix this differently. The real bug is that
Buffer::HasInstance() returns true for typed arrays.
This reverts commit
01ee551e704776d8547250ac015a5463613afb45.
Ben Noordhuis [Sat, 9 Feb 2013 07:49:10 +0000 (08:49 +0100)]
Revert "typed arrays: copy non-ArrayBuffer in DataView ctor"
We're going to follow browser behavior here.
This reverts commit
7b0770bff56122c245f83e8ee9608e1a0082c15e.
Nathan Rajlich [Sat, 9 Feb 2013 18:32:24 +0000 (10:32 -0800)]
doc: document the writable.end() callback function
Support for it was added in
a9c4a20331d123dc38dcc878af335d88e1933562.
isaacs [Sat, 9 Feb 2013 01:18:37 +0000 (17:18 -0800)]
V8: Reapply floating patches
isaacs [Sat, 9 Feb 2013 01:17:45 +0000 (17:17 -0800)]
V8: Upgrade to 3.15.11.15
Ben Noordhuis [Fri, 8 Feb 2013 00:33:29 +0000 (01:33 +0100)]
test: disable simple/test-dgram-send-error
It's not a good citizen, it spams random IP addresses with UDP packets.
Fixes #4730.
Scott Blomquist [Wed, 30 Jan 2013 04:37:57 +0000 (20:37 -0800)]
windows/msi: more installer enhancements
Noteworthy installer improvements provided here:
* Support in the Installer UI for not installing shortcuts.
* Support in the Installer UI for choosing a custom install directory.
* Command line support for not installing shortcuts (ADDDEFAULT=nodejs)
* Command line support for custom install directory (INSTALLDIR=c:\tools\node)
Jim Schubert [Mon, 17 Dec 2012 05:23:23 +0000 (00:23 -0500)]
windows/msi: add feature selection to installer
isaacs [Thu, 7 Feb 2013 18:35:35 +0000 (10:35 -0800)]
blog: v0.9.9 is unstable, not stable
isaacs [Thu, 7 Feb 2013 18:34:45 +0000 (10:34 -0800)]
blog: v0.9.9
isaacs [Thu, 7 Feb 2013 18:34:07 +0000 (10:34 -0800)]
Now working on v0.9.10
isaacs [Thu, 7 Feb 2013 18:33:54 +0000 (10:33 -0800)]
Merge branch 'v0.9.9-release'
isaacs [Thu, 7 Feb 2013 17:09:21 +0000 (09:09 -0800)]
2013.02.07, Version 0.9.9 (Unstable)
* tls: port CryptoStream to streams2 (Fedor Indutny)
* typed arrays: only share ArrayBuffer backing store (Ben Noordhuis)
* stream: make Writable#end() accept a callback function (Nathan Rajlich)
* buffer: optimize 'hex' handling (Ben Noordhuis)
* dns, cares: don't filter NOTIMP, REFUSED, SERVFAIL (Ben Noordhuis)
* readline: treat bare \r as a line ending (isaacs)
* readline: make \r\n emit one 'line' event (Ben Noordhuis)
* cluster: support datagram sockets (Bert Belder)
* stream: Correct Transform class backpressure (isaacs)
* addon: Pass module object to NODE_MODULE init function (isaacs, Rod Vagg)
* buffer: slow buffer copy compatibility fix (Trevor Norris)
* Add bytesWritten to tls.CryptoStream (Andy Burke)
isaacs [Thu, 7 Feb 2013 16:50:18 +0000 (08:50 -0800)]
stream: Writable should ignore encoding for buffers
Fix #4727
Fix einaros/ws#159
Nikhil Marathe [Sat, 19 Jan 2013 23:49:30 +0000 (15:49 -0800)]
Update http docs with http.IncomingMessage.
http.ServerRequest and http.ClientResponse are merged into http.IncomingMessage
which has fields for both, and acts as a Readable Stream and EventEmitter.
Fixes #3851.
Bert Belder [Thu, 7 Feb 2013 13:39:47 +0000 (14:39 +0100)]
http: protect against response splitting attacks
This patch is a back-port of 3c293ba.
Closes #4696
isaacs [Thu, 7 Feb 2013 00:29:30 +0000 (16:29 -0800)]
Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
AUTHORS
ChangeLog
deps/npm/html/api/bin.html
deps/npm/html/api/bugs.html
deps/npm/html/api/commands.html
deps/npm/html/api/config.html
deps/npm/html/api/deprecate.html
deps/npm/html/api/docs.html
deps/npm/html/api/edit.html
deps/npm/html/api/explore.html
deps/npm/html/api/help-search.html
deps/npm/html/api/init.html
deps/npm/html/api/install.html
deps/npm/html/api/link.html
deps/npm/html/api/load.html
deps/npm/html/api/ls.html
deps/npm/html/api/npm.html
deps/npm/html/api/outdated.html
deps/npm/html/api/owner.html
deps/npm/html/api/pack.html
deps/npm/html/api/prefix.html
deps/npm/html/api/prune.html
deps/npm/html/api/publish.html
deps/npm/html/api/rebuild.html
deps/npm/html/api/restart.html
deps/npm/html/api/root.html
deps/npm/html/api/run-script.html
deps/npm/html/api/search.html
deps/npm/html/api/shrinkwrap.html
deps/npm/html/api/start.html
deps/npm/html/api/stop.html
deps/npm/html/api/submodule.html
deps/npm/html/api/tag.html
deps/npm/html/api/test.html
deps/npm/html/api/uninstall.html
deps/npm/html/api/unpublish.html
deps/npm/html/api/update.html
deps/npm/html/api/version.html
deps/npm/html/api/view.html
deps/npm/html/api/whoami.html
deps/npm/html/doc/README.html
deps/npm/html/doc/adduser.html
deps/npm/html/doc/bin.html
deps/npm/html/doc/bugs.html
deps/npm/html/doc/build.html
deps/npm/html/doc/bundle.html
deps/npm/html/doc/cache.html
deps/npm/html/doc/changelog.html
deps/npm/html/doc/coding-style.html
deps/npm/html/doc/completion.html
deps/npm/html/doc/config.html
deps/npm/html/doc/dedupe.html
deps/npm/html/doc/deprecate.html
deps/npm/html/doc/developers.html
deps/npm/html/doc/disputes.html
deps/npm/html/doc/docs.html
deps/npm/html/doc/edit.html
deps/npm/html/doc/explore.html
deps/npm/html/doc/faq.html
deps/npm/html/doc/folders.html
deps/npm/html/doc/global.html
deps/npm/html/doc/help-search.html
deps/npm/html/doc/help.html
deps/npm/html/doc/index.html
deps/npm/html/doc/init.html
deps/npm/html/doc/install.html
deps/npm/html/doc/json.html
deps/npm/html/doc/link.html
deps/npm/html/doc/ls.html
deps/npm/html/doc/npm.html
deps/npm/html/doc/outdated.html
deps/npm/html/doc/owner.html
deps/npm/html/doc/pack.html
deps/npm/html/doc/prefix.html
deps/npm/html/doc/prune.html
deps/npm/html/doc/publish.html
deps/npm/html/doc/rebuild.html
deps/npm/html/doc/registry.html
deps/npm/html/doc/removing-npm.html
deps/npm/html/doc/restart.html
deps/npm/html/doc/rm.html
deps/npm/html/doc/root.html
deps/npm/html/doc/run-script.html
deps/npm/html/doc/scripts.html
deps/npm/html/doc/search.html
deps/npm/html/doc/semver.html
deps/npm/html/doc/shrinkwrap.html
deps/npm/html/doc/star.html
deps/npm/html/doc/start.html
deps/npm/html/doc/stop.html
deps/npm/html/doc/submodule.html
deps/npm/html/doc/tag.html
deps/npm/html/doc/test.html
deps/npm/html/doc/uninstall.html
deps/npm/html/doc/unpublish.html
deps/npm/html/doc/update.html
deps/npm/html/doc/version.html
deps/npm/html/doc/view.html
deps/npm/html/doc/whoami.html
deps/npm/man/man1/global.1
deps/npm/man/man1/ls.1
deps/npm/man/man1/npm.1
deps/npm/man/man1/rm.1
deps/npm/man/man3/npm.3
deps/npm/node_modules/glob/glob.js
deps/npm/node_modules/glob/package.json
deps/npm/node_modules/node-gyp/package.json
deps/npm/node_modules/npm-registry-client/package.json
deps/npm/node_modules/npmconf/package.json
deps/npm/node_modules/read-installed/package.json
deps/npm/node_modules/rimraf/package.json
deps/npm/node_modules/rimraf/rimraf.js
deps/npm/package.json
deps/uv/src/win/error.c
doc/api/crypto.markdown
lib/zlib.js
src/node_version.h
src/node_zlib.cc
test/simple/test-buffer.js
Ben Noordhuis [Wed, 6 Feb 2013 21:13:05 +0000 (22:13 +0100)]
typed arrays: copy non-ArrayBuffer in DataView ctor
This is commit 01ee551, except for the DataView type this time.
Make the behavior of DataView consistent with that of typed arrays:
make a copy of the backing store.
Fedor Indutny [Thu, 31 Jan 2013 17:20:49 +0000 (21:20 +0400)]
tls: port CryptoStream to streams2
isaacs [Wed, 6 Feb 2013 17:48:11 +0000 (09:48 -0800)]
blog: v0.8.19 release
isaacs [Wed, 6 Feb 2013 17:46:47 +0000 (09:46 -0800)]
Now working on 0.8.20
isaacs [Wed, 6 Feb 2013 17:44:38 +0000 (09:44 -0800)]
Merge branch 'v0.8.19-release' into v0.8
isaacs [Wed, 6 Feb 2013 16:46:14 +0000 (08:46 -0800)]
2013.02.06, Version 0.8.19 (Stable)
* npm: Upgrade to v1.2.10
* zlib: pass object size hint to V8 (Ben Noordhuis)
* zlib: reduce memory consumption, release early (Ben Noordhuis)
* buffer: slow buffer copy compatibility fix (Trevor Norris)
* zlib: don't assert on malformed dictionary (Ben Noordhuis)
* zlib: don't assert on missing dictionary (Ben Noordhuis)
* windows: better ipv6 support (Bert Belder)
* windows: add error mappings related to unsupported protocols (Bert Belder)
* windows: map ERROR_DIRECTORY to UV_ENOENT (Bert Belder)
isaacs [Wed, 6 Feb 2013 16:39:27 +0000 (08:39 -0800)]
npm: Upgrade to v1.2.10
Fedor Indutny [Wed, 6 Feb 2013 14:45:06 +0000 (18:45 +0400)]
streams: both `finish` and `close` should unpipe
Otherwise sockets that are 'finish'ed won't be unpiped and `writing to
ended stream` error will arise.
This might sound unrealistic, but it happens in net.js. When
`socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which
ends the writable side of net.Socket.
Ben Noordhuis [Wed, 6 Feb 2013 14:10:48 +0000 (15:10 +0100)]
test: add cluster EADDRINUSE test
Check that having a worker bind to a port that's already taken doesn't
leave the master process in a confused state. Releasing the port and
trying again should Just Work[TM].
Ben Noordhuis [Tue, 5 Feb 2013 13:24:43 +0000 (14:24 +0100)]
typed arrays: only share ArrayBuffer backing store
Follow browser behavior, only share the backing store when it's a
ArrayBuffer. That is:
var abuf = new ArrayBuffer(32);
var a = new Int8Array(abuf);
var b = new Int8Array(abuf);
a[0] = 0;
b[0] = 1;
assert(a[0] === b[0]); // a and b share memory
But:
var a = new Int8Array(32);
var b = new Int8Array(a);
a[0] = 0;
b[0] = 1;
assert(a[0] !== b[0]); // a and b don't share memory
The typed arrays spec allows both `a[0] === b[0]` and `a[0] !=== b[0]`
but Chrome and Firefox implement the behavior where memory is not
shared.
Copying the memory is less efficient but let's do it anyway for the
sake of the Principle of Least Surprise.
Fixes #4714.
Bryan Cantrill [Tue, 18 Sep 2012 22:35:29 +0000 (15:35 -0700)]
v8: loosen artificial mmap constraint
Fixes #4010.
Nathan Rajlich [Tue, 5 Feb 2013 22:58:16 +0000 (14:58 -0800)]
stream: make Writable#end() accept a callback function
This is more backwards-compatible with stream1 streams like `fs.WriteStream`
which would allow a callback function to be passed in as the only argument.
Closes #4719.
Ben Noordhuis [Tue, 5 Feb 2013 21:34:49 +0000 (22:34 +0100)]
blog: remove dangling symlink
Fixes #4716.
Ben Noordhuis [Tue, 30 Oct 2012 13:40:50 +0000 (14:40 +0100)]
zlib: pass object size hint to V8
Inform V8 that the zlib context object is tied to a large off-heap buffer.
This makes the GC run more often (in theory) and improves the accuracy of
--trace_external_memory.
Ben Noordhuis [Tue, 30 Oct 2012 00:19:01 +0000 (01:19 +0100)]
zlib: reduce memory consumption, release early
In zlibBuffer(), don't wait for the garbage collector to reclaim the zlib memory
but release it manually. Reduces memory consumption by a factor of 10 or more
with some workloads.
Test case:
function f() {
require('zlib').deflate('xxx', g);
}
function g() {
setTimeout(f, 5);
}
f();
Observe RSS memory usage with and without this commit. After 10,000 iterations,
RSS stabilizes at ~35 MB with this commit. Without, RSS is over 300 MB and keeps
growing.
Cause: whenever the JS object heap hits the high-water mark, the V8 GC sweeps
it clean, then tries to grow it in order to avoid more sweeps in the near
future. Rule of thumb: the bigger the JS heap, the lazier the GC can be.
A side effect of a bigger heap is that objects now live longer. This is harmless
in general but it affects zlib context objects because those are tied to large
buffers that live outside the JS heap, on the order of 16K per context object.
Ergo, don't wait for the GC to reclaim the memory - it may take a long time.
Fixes #4172.
Ben Noordhuis [Tue, 5 Feb 2013 11:47:23 +0000 (12:47 +0100)]
doc: don't suggest to reuse net.Socket objects
Using Socket.prototype.connect() to reconnect an existing Socket object
is not reliable. Users should just create a new Socket object.
See #4698.
isaacs [Sat, 2 Feb 2013 19:14:42 +0000 (11:14 -0800)]
blog: Correct shasums for v0.9.8 release
Ben Noordhuis [Fri, 1 Feb 2013 23:40:10 +0000 (00:40 +0100)]
buffer: optimize Buffer.prototype.write(s, 'hex')
Move the implementation to C++ land. This is similar to commit 3f65916
but this time for the write() function and the Buffer(s, 'hex')
constructor.
Speeds up the benchmark below about 24x (2.6s vs 1:02m).
var s = 'f';
for (var i = 0; i < 26; ++i) s += s; // 64 MB
Buffer(s, 'hex');
isaacs [Fri, 1 Feb 2013 23:55:03 +0000 (15:55 -0800)]
debugger: Make the debugger timeout configurable
If the NODE_DEBUGGER_TIMEOUT environment variable is set, then use
that as the number of ms to wait for the debugger to start.
This is primarily to work around a race condition that almost never
happens in real usage with the debugger, but happens EVERY FRACKING
TIME when the debugger tests run as part of 'make test'.
Ben Noordhuis [Fri, 1 Feb 2013 21:35:57 +0000 (22:35 +0100)]
buffer: optimize Buffer.prototype.toString('hex')
Move the implementation to C++ land. The old JS implementation used
string concatenation, was dog slow and consumed copious amounts of
memory for large buffers. Example:
var buf = Buffer(0x1000000); // 16 MB
buf.toString('hex') // Used 3+ GB of memory.
The new implementation operates in O(n) time and space.
Fixes #4700.
isaacs [Fri, 1 Feb 2013 18:17:22 +0000 (10:17 -0800)]
gitignore: Ignore release tarballs and shasum files
Ben Noordhuis [Fri, 1 Feb 2013 16:33:19 +0000 (17:33 +0100)]
dns, cares: don't filter NOTIMP, REFUSED, SERVFAIL
Report the aforementioned DNS server failure codes as-is, stop c-ares
from reporting them as ARES_ECONNREFUSED.
Reported by Steve Freegard.
isaacs [Thu, 31 Jan 2013 21:33:37 +0000 (13:33 -0800)]
stream: Don't stop reading on zero-length decoded output
Fixes regression introduced in
7e1cf84c9efd491d72b25968a70656458ecb6b7c
isaacs [Thu, 31 Jan 2013 19:22:07 +0000 (11:22 -0800)]
stream: Don't signal EOF on '' or Buffer(0)
Those values, if passed to the _read() cb, will not signal an EOF. Only
null or undefined will mark the end of data, and trigger the end event.
However, great care must be taken if you are returning an empty string
or buffer! There must be some other thing somewhere that will trigger
a read() call, because there will never be a readable event fired later.
This is in preparation for CryptoStreams being ported to streams2, where
it is safe to simply stop reading, because the crypto cycle process will
cause it to read(0) again at some future date.
Bert Belder [Wed, 30 Jan 2013 19:30:10 +0000 (20:30 +0100)]
deps: upgrade libuv to 034ea31
isaacs [Wed, 30 Jan 2013 07:23:36 +0000 (23:23 -0800)]
node: Do not use fn.apply() in process._makeCallback
isaacs [Wed, 30 Jan 2013 07:55:58 +0000 (23:55 -0800)]
lint
Ben Noordhuis [Tue, 29 Jan 2013 16:27:33 +0000 (17:27 +0100)]
os: rename tmpDir() to tmpdir() for consistency
Make the casing consistent with the other os.* functions but keep
os.tmpDir() around as an alias.
isaacs [Wed, 30 Jan 2013 01:50:44 +0000 (17:50 -0800)]
readline: treat bare \r as a line ending
Fixes #3305
Ben Noordhuis [Mon, 28 Jan 2013 12:13:28 +0000 (13:13 +0100)]
readline: make \r\n emit one 'line' event
Make lines ending \r\n emit one 'line' event, not two (where the second
one is an empty string).
This adds a new keypress name: 'return' (as in: 'carriage return').
Fixes #3305.
isaacs [Tue, 29 Jan 2013 01:15:22 +0000 (17:15 -0800)]
Revert "net: Avoid tickDepth warnings on small writes"
This commit breaks simple/test-stream2-stderr-sync. Need to figure out
a better way, or just accept that `(function W(){stream.write(b,W)})()`
is going to be noisy. People should really be using the `'drain'` event
for this use-case anyway.
This reverts commit
02f7d1bfd8b5b75620352774967dce63b0934037.
isaacs [Mon, 28 Jan 2013 19:15:53 +0000 (11:15 -0800)]
net: Avoid tickDepth warnings on small writes
Always defer the _write callback. The optimization here was only
relevant in some oddball edge cases that we don't actually care about.
Our benchmarks confirm that just always deferring the Socket._write cb
is perfectly fine to do, and in some cases, even slightly more
performant.
Bert Belder [Mon, 28 Jan 2013 21:19:02 +0000 (22:19 +0100)]
dgram: avoid EventEmitter leak warning
When a datagram socket hasn't been bound yet, node will defer `send()`
operations until binding has completed. Before this patch a `listening`
listener would be installed every time `send` was called. This triggered
an EventEmitter leak warning when more than 10 packets were sent in a
tight loop. Therefore switch to using a single `listening` listener, and
use an array to enqueue outbound packets.