From 50ba0f27d9a14473201c93fab09c2c6cf96c063b Mon Sep 17 00:00:00 2001 From: Eugene Girshov Date: Sat, 23 Feb 2013 18:59:05 +0200 Subject: [PATCH 1/6] doc: remove note about close event --- doc/api/http.markdown | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 59a9f8a305..e66e099765 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -221,8 +221,6 @@ Indicates that the underlaying connection was terminated before Just like `'end'`, this event occurs only once per request, and no more `'data'` events will fire afterwards. -Note: `'close'` can fire after `'end'`, but not vice versa. - ### request.method The request method as a string. Read only. Example: @@ -881,8 +879,6 @@ Just like `'end'`, this event occurs only once per response, and no more `'data'` events will fire afterwards. See [http.ServerResponse][]'s `'close'` event for more information. -Note: `'close'` can fire after `'end'`, but not vice versa. - ### response.statusCode From f26362e9381d88d4c906e3624f90fc76e9087c20 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 1 Mar 2013 13:01:53 +0100 Subject: [PATCH 2/6] http: use socket.once, not socket.on Register the 'close' event listener with .once(), not .on(). It doesn't matter in the grand scheme of things because the listener doesn't keep references to any heavy-weight objects but using .once() for a oneshot listener is something of a best practice. --- lib/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http.js b/lib/http.js index 212b8becb9..8fddd394a3 100644 --- a/lib/http.js +++ b/lib/http.js @@ -515,7 +515,7 @@ OutgoingMessage.prototype._writeRaw = function(data, encoding) { var timer = setTimeout(function() { socket.emit('close'); }); - socket.on('close', function() { + socket.once('close', function() { clearTimeout(timer); }); } From be770a3839f3bce6cc35c573390179bba05abcaa Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 1 Mar 2013 11:22:07 -0800 Subject: [PATCH 3/6] blog: Post about v0.9.11 --- doc/blog/release/v0.9.11.md | 88 +++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 doc/blog/release/v0.9.11.md diff --git a/doc/blog/release/v0.9.11.md b/doc/blog/release/v0.9.11.md new file mode 100644 index 0000000000..ee4b28b6ac --- /dev/null +++ b/doc/blog/release/v0.9.11.md @@ -0,0 +1,88 @@ +date: Fri Mar 1 11:17:40 PST 2013 +version: 0.9.11 +category: release +title: Node v0.9.11 (Unstable) +slug: node-v0-9-11-unstable + +2013.03.01, Version 0.9.11 (Unstable) + +* V8: downgrade 3.14.5 + +* openssl: update to 1.0.1e + +* darwin: Make process.title work properly (Ben Noordhuis) + +* fs: Support mode/flag options to read/append/writeFile (isaacs) + +* stream: _read() no longer takes a callback (isaacs) + +* stream: Add stream.unshift(chunk) (isaacs) + +* stream: remove lowWaterMark feature (isaacs) + +* net: omit superfluous 'connect' event (Ben Noordhuis) + +* build, windows: disable SEH (Ben Noordhuis) + +* core: remove errno global (Ben Noordhuis) + +* core: Remove the nextTick for running the main file (isaacs) + +* core: Mark exit() calls with status codes (isaacs) + +* core: Fix debug signal handler race condition lock (isaacs) + +* crypto: clear error stack (Ben Noordhuis) + +* test: optionally set common.PORT via env variable (Timothy J Fontaine) + +* path: Throw TypeError on non-string args to path.resolve/join (isaacs, Arianit Uka) + +* crypto: fix uninitialized memory access in openssl (Ben Noordhuis) + + +Source Code: http://nodejs.org/dist/v0.9.11/node-v0.9.11.tar.gz + +Macintosh Installer (Universal): http://nodejs.org/dist/v0.9.11/node-v0.9.11.pkg + +Windows Installer: http://nodejs.org/dist/v0.9.11/node-v0.9.11-x86.msi + +Windows x64 Installer: http://nodejs.org/dist/v0.9.11/x64/node-v0.9.11-x64.msi + +Windows x64 Files: http://nodejs.org/dist/v0.9.11/x64/ + +Linux 32-bit Binary: http://nodejs.org/dist/v0.9.11/node-v0.9.11-linux-x86.tar.gz + +Linux 64-bit Binary: http://nodejs.org/dist/v0.9.11/node-v0.9.11-linux-x64.tar.gz + +Solaris 32-bit Binary: http://nodejs.org/dist/v0.9.11/node-v0.9.11-sunos-x86.tar.gz + +Solaris 64-bit Binary: http://nodejs.org/dist/v0.9.11/node-v0.9.11-sunos-x64.tar.gz + +Other release files: http://nodejs.org/dist/v0.9.11/ + +Website: http://nodejs.org/docs/v0.9.11/ + +Documentation: http://nodejs.org/docs/v0.9.11/api/ + +Shasums: +``` +2e11c53449523642f1b3f2cad9726d032ebf0a1b node-v0.9.11-darwin-x64.tar.gz +6a8c18185d67ff50979a143b9e100d56b35aedde node-v0.9.11-darwin-x86.tar.gz +16a95dfc6974ba3562801d9f7bb9e2fa0c001d32 node-v0.9.11-linux-x64.tar.gz +4711aae106edf9a2bf9f644b08db1b608e9829c1 node-v0.9.11-linux-x86.tar.gz +897c21d0fc59faebbdf515e0dfee27551386c4af node-v0.9.11-sunos-x64.tar.gz +09c2b469ef984237bbd606d78f523d1c8b92e680 node-v0.9.11-sunos-x86.tar.gz +81627efd5c591f636147100e2e95bbbb17fd0290 node-v0.9.11-x86.msi +a0e91028c7fd091db1667ccf9dba6216ee321e98 node-v0.9.11.pkg +66370601eb824305b12c7f3e5b2a5e8ca94f1209 node-v0.9.11.tar.gz +db08f56a8258dd8a6a525595a023ad9eb72603e6 node.exe +759fe57cbceeee5820c7de176b6ef8c2a5af7fab node.exp +299f0f8aebbc755b37fc6b40e463cb455a5bb1c6 node.lib +f12b3dc557ae16834ae3a793d768e251d1ba5db3 node.pdb +807520a39d6f7518e53da796fa1ca62316219146 x64/node-v0.9.11-x64.msi +e27a6adc077629ae9a367b4a5cb7fb31853863d3 x64/node.exe +fdcf8ccea3b2c5e3f4f99fa606715e1e27a96acc x64/node.exp +fa0db53aac8d97bab3566c7d80fceb8e148c6d0d x64/node.lib +e24cf62376b8439ae40b84d37c55ab23fbad4e47 x64/node.pdb +``` From 7189b3ed337484cbfeb7209bde2dae72c5bae743 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 2 Mar 2013 02:09:14 +0100 Subject: [PATCH 4/6] crypto: don't assert when calling Cipher#final() twice Remove the assert() that triggered when Cipher#final() or Decipher#final() was called twice. Fixes #4886. --- src/node_crypto.cc | 11 ++--------- test/simple/test-crypto.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 7e168b6f34..2b51455611 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2301,11 +2301,7 @@ class Cipher : public ObjectWrap { int r = cipher->CipherFinal(&out_value, &out_len); - assert(out_value != NULL); - assert(out_len != -1 || r == 0); - - if (out_len == 0 || r == 0) { - // out_value always get allocated. + if (out_len <= 0 || r == 0) { delete[] out_value; if (r == 0) { Local exception = Exception::TypeError( @@ -2756,10 +2752,7 @@ class Decipher : public ObjectWrap { int r = cipher->DecipherFinal(&out_value, &out_len); - assert(out_value != NULL); - assert(out_len != -1); - - if (out_len == 0 || r == 0) { + if (out_len <= 0 || r == 0) { delete [] out_value; // allocated even if out_len == 0 if (r == 0) { Local exception = Exception::TypeError( diff --git a/test/simple/test-crypto.js b/test/simple/test-crypto.js index 535af760fa..7d6332d326 100644 --- a/test/simple/test-crypto.js +++ b/test/simple/test-crypto.js @@ -665,3 +665,16 @@ crypto.pbkdf2('pass\0word', 'sa\0lt', 4096, 16, function(err, result) { assert.throws(function() { crypto.pbkdf2('password', 'salt', 1, 20, null); }); + +// Calling Cipher.final() or Decipher.final() twice should error but +// not assert. See #4886. +(function() { + var c = crypto.createCipher('aes-256-cbc', 'secret'); + try { c.final('xxx') } catch (e) { /* Ignore. */ } + try { c.final('xxx') } catch (e) { /* Ignore. */ } + try { c.final('xxx') } catch (e) { /* Ignore. */ } + var d = crypto.createDecipher('aes-256-cbc', 'secret'); + try { d.final('xxx') } catch (e) { /* Ignore. */ } + try { d.final('xxx') } catch (e) { /* Ignore. */ } + try { d.final('xxx') } catch (e) { /* Ignore. */ } +})(); From 0b70a14abf9f5931d1d37896dffe59afc04a3d4d Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Mon, 25 Feb 2013 22:19:16 -0800 Subject: [PATCH 5/6] test: optionally set common.PORT via env variable This is a back-port of commit 17a8126 from the master branch. --- test/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common.js b/test/common.js index 4f96369f37..ef0ae09ad6 100644 --- a/test/common.js +++ b/test/common.js @@ -26,7 +26,7 @@ exports.testDir = path.dirname(__filename); exports.fixturesDir = path.join(exports.testDir, 'fixtures'); exports.libDir = path.join(exports.testDir, '../lib'); exports.tmpDir = path.join(exports.testDir, 'tmp'); -exports.PORT = 12346; +exports.PORT = +process.env.NODE_COMMON_PORT || 12346; if (process.platform === 'win32') { exports.PIPE = '\\\\.\\pipe\\libuv-test'; From 426cbedb44e1dfff645b9f275f7b27a389dc86b0 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 2 Mar 2013 23:04:05 +0100 Subject: [PATCH 6/6] test: make simple/test-dgram-pingpong respect PORT Don't use hard-coded port numbers, use common.PORT instead. Should fix the occasional Jenkins failure; the builds run in parallel. --- test/simple/test-dgram-pingpong.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/simple/test-dgram-pingpong.js b/test/simple/test-dgram-pingpong.js index 18b39b5aa6..2231058d03 100644 --- a/test/simple/test-dgram-pingpong.js +++ b/test/simple/test-dgram-pingpong.js @@ -102,9 +102,9 @@ function pingPongTest(port, host) { } // All are run at once, so run on different ports -pingPongTest(20989, 'localhost'); -pingPongTest(20990, 'localhost'); -pingPongTest(20988); +pingPongTest(common.PORT + 0, 'localhost'); +pingPongTest(common.PORT + 1, 'localhost'); +pingPongTest(common.PORT + 2); //pingPongTest('/tmp/pingpong.sock'); process.on('exit', function() {