diff -Nru nodejs-0.10.17/.gitignore nodejs-0.10.20/.gitignore --- nodejs-0.10.17/.gitignore 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/.gitignore 2013-09-30 20:52:48.000000000 +0000 @@ -54,6 +54,6 @@ # build/release artifacts /*.tar.gz -/SHASUMS.txt* +/SHASUMS*.txt* /tools/wrk/wrk diff -Nru nodejs-0.10.17/AUTHORS nodejs-0.10.20/AUTHORS --- nodejs-0.10.17/AUTHORS 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/AUTHORS 2013-09-30 20:52:48.000000000 +0000 @@ -466,3 +466,4 @@ Edward Hutchins Chris Wren Duan Yao +Eric Schrock diff -Nru nodejs-0.10.17/ChangeLog nodejs-0.10.20/ChangeLog --- nodejs-0.10.17/ChangeLog 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/ChangeLog 2013-09-30 20:52:48.000000000 +0000 @@ -1,4 +1,36 @@ -2013.08.21, Version 0.10.17 (Stable) +2013.09.30, Version 0.10.20 (Stable) + +* tls: fix sporadic hang and partial reads (Fedor Indutny) + - fixes "npm ERR! cb() never called!" + + +2013.09.24, Version 0.10.19 (Stable), 6b5e6a5a3ec8d994c9aab3b800b9edbf1b287904 + +* 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) + + +2013.09.04, Version 0.10.18 (Stable), 67a1f0c52e0708e2596f3f2134b8386d6112561e + +* uv: Upgrade to v0.10.15 + +* stream: Don't crash on unset _events property (isaacs) + +* stream: Pass 'buffer' encoding with decoded writable chunks (isaacs) + + +2013.08.21, Version 0.10.17 (Stable), 469a4a5091a677df62be319675056b869c31b35c * uv: Upgrade v0.10.14 diff -Nru nodejs-0.10.17/README.md nodejs-0.10.20/README.md --- nodejs-0.10.17/README.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/README.md 2013-09-30 20:52:48.000000000 +0000 @@ -50,7 +50,7 @@ --- - [The Wiki](https://github.com/joyent/node/wiki) - [nodejs.org](http://nodejs.org/) - - [how to install node.js and npm (node package manager)](http://joyeur.com/2010/12/10/installing-node-and-npm/) + - [how to install node.js and npm (node package manager)](http://www.joyent.com/blog/installing-node-and-npm/) - [list of modules](https://github.com/joyent/node/wiki/modules) - [searching the npm registry](http://npmjs.org/) - [list of companies and projects using node](https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node) diff -Nru nodejs-0.10.17/benchmark/common.js nodejs-0.10.20/benchmark/common.js --- nodejs-0.10.17/benchmark/common.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/benchmark/common.js 2013-09-30 20:52:48.000000000 +0000 @@ -18,28 +18,29 @@ var spawn = require('child_process').spawn; runBenchmarks(); +} - function runBenchmarks() { - var test = tests.shift(); - if (!test) - return; +function runBenchmarks() { + var test = tests.shift(); + if (!test) + return; - if (test.match(/^[\._]/)) - return process.nextTick(runBenchmarks); + if (test.match(/^[\._]/)) + return process.nextTick(runBenchmarks); - console.error(type + '/' + test); - test = path.resolve(dir, test); + console.error(type + '/' + test); + test = path.resolve(dir, test); - var child = spawn(process.execPath, [ test ], { stdio: 'inherit' }); - child.on('close', function(code) { - if (code) - process.exit(code); - else { - console.log(''); - runBenchmarks(); - } - }); - } + var a = (process.execArgv || []).concat(test); + var child = spawn(process.execPath, a, { stdio: 'inherit' }); + child.on('close', function(code) { + if (code) + process.exit(code); + else { + console.log(''); + runBenchmarks(); + } + }); } exports.createBenchmark = function(fn, options) { diff -Nru nodejs-0.10.17/configure nodejs-0.10.20/configure --- nodejs-0.10.17/configure 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/configure 2013-09-30 20:52:48.000000000 +0000 @@ -250,6 +250,12 @@ help="Specifies which floating-point ABI to use. Valid values are: " "soft, softfp, hard") +parser.add_option("--with-mips-float-abi", + action="store", + dest="mips_float_abi", + help="Specifies which floating-point ABI to use. Valid values are: " + "soft, hard") + parser.add_option("--ninja", action="store_true", dest="use_ninja", @@ -441,6 +447,16 @@ o['variables']['v8_use_arm_eabi_hardfloat'] = b(hard_float) +def configure_mips(o): + if options.mips_float_abi: + if options.mips_float_abi in ('soft', 'hard'): + o['variables']['v8_use_mips_abi_hardfloat'] = b( + options.mips_float_abi == 'hard') + else: + raise Exception( + 'Invalid mips-float-abi value. Valid values are: soft, hard') + + def configure_node(o): o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0 o['variables']['v8_no_strict_aliasing'] = 1 # work around compiler bugs @@ -457,6 +473,8 @@ if target_arch == 'arm': configure_arm(o) + elif target_arch in ('mips', 'mipsel'): + configure_mips(o) cc_version, is_clang = compiler_version() o['variables']['clang'] = 1 if is_clang else 0 diff -Nru nodejs-0.10.17/debian/changelog nodejs-0.10.20/debian/changelog --- nodejs-0.10.17/debian/changelog 2013-08-22 02:59:34.000000000 +0000 +++ nodejs-0.10.20/debian/changelog 2013-09-30 22:12:20.000000000 +0000 @@ -1,3 +1,22 @@ +nodejs (0.10.20-1chl1~precise1) precise; urgency=low + + * 0.10.20 (stable) release. + * Fixes https://github.com/isaacs/npm/issues/2907 + + -- Chris Lea Mon, 30 Sep 2013 15:09:59 -0700 + +nodejs (0.10.19-1chl1~precise1) precise; urgency=low + + * 0.10.19 (stable) release. + + -- Chris Lea Tue, 24 Sep 2013 21:44:30 -0700 + +nodejs (0.10.18-1chl1~precise1) precise; urgency=low + + * 0.10.18 (stable) release. + + -- Chris Lea Thu, 05 Sep 2013 10:00:43 -0700 + nodejs (0.10.17-1chl1~precise1) precise; urgency=low * 0.10.17 (stable) release. diff -Nru nodejs-0.10.17/deps/npm/README.md nodejs-0.10.20/deps/npm/README.md --- nodejs-0.10.17/deps/npm/README.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/README.md 2013-09-30 20:52:48.000000000 +0000 @@ -179,9 +179,8 @@ ## Legal Stuff -"npm" and "the npm registry" are owned by Isaac Z. Schlueter. All -rights not explicitly granted in the MIT license are reserved. See the -included LICENSE file for more details. +"npm" and "the npm registry" are owned by Isaac Z. Schlueter. +All rights reserved. See the included LICENSE file for more details. "Node.js" and "node" are trademarks owned by Joyent, Inc. npm is not officially part of the Node.js project, and is neither owned by nor diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-config.md nodejs-0.10.20/deps/npm/doc/cli/npm-config.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-config.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-config.md 2013-09-30 20:52:48.000000000 +0000 @@ -8,6 +8,7 @@ npm config delete npm config list npm config edit + npm c [set|get|delete|list] npm get npm set [--global] diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-dedupe.md nodejs-0.10.20/deps/npm/doc/cli/npm-dedupe.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-dedupe.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-dedupe.md 2013-09-30 20:52:48.000000000 +0000 @@ -4,6 +4,7 @@ ## SYNOPSIS npm dedupe [package names...] + npm ddp [package names...] ## DESCRIPTION diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-install.md nodejs-0.10.20/deps/npm/doc/cli/npm-install.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-install.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-install.md 2013-09-30 20:52:48.000000000 +0000 @@ -11,6 +11,7 @@ npm install @ npm install @ npm install @ + npm i (with any of the previous argument usage) ## DESCRIPTION diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-link.md nodejs-0.10.20/deps/npm/doc/cli/npm-link.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-link.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-link.md 2013-09-30 20:52:48.000000000 +0000 @@ -5,6 +5,7 @@ npm link (in package folder) npm link + npm ln (with any of the previous argument usage) ## DESCRIPTION diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-rebuild.md nodejs-0.10.20/deps/npm/doc/cli/npm-rebuild.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-rebuild.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-rebuild.md 2013-09-30 20:52:48.000000000 +0000 @@ -4,6 +4,7 @@ ## SYNOPSIS npm rebuild [ [ ...]] + npm rb [ [ ...]] * ``: The package to rebuild diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-rm.md nodejs-0.10.20/deps/npm/doc/cli/npm-rm.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-rm.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-rm.md 2013-09-30 20:52:48.000000000 +0000 @@ -4,7 +4,9 @@ ## SYNOPSIS npm rm + npm r npm uninstall + npm un ## DESCRIPTION diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-search.md nodejs-0.10.20/deps/npm/doc/cli/npm-search.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-search.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-search.md 2013-09-30 20:52:48.000000000 +0000 @@ -4,6 +4,8 @@ ## SYNOPSIS npm search [search terms ...] + npm s [search terms ...] + npm se [search terms ...] ## DESCRIPTION diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-test.md nodejs-0.10.20/deps/npm/doc/cli/npm-test.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-test.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-test.md 2013-09-30 20:52:48.000000000 +0000 @@ -4,6 +4,7 @@ ## SYNOPSIS npm test + npm tst ## DESCRIPTION diff -Nru nodejs-0.10.17/deps/npm/doc/cli/npm-view.md nodejs-0.10.20/deps/npm/doc/cli/npm-view.md --- nodejs-0.10.17/deps/npm/doc/cli/npm-view.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/cli/npm-view.md 2013-09-30 20:52:48.000000000 +0000 @@ -4,6 +4,7 @@ ## SYNOPSIS npm view [@] [[.]...] + npm v [@] [[.]...] ## DESCRIPTION diff -Nru nodejs-0.10.17/deps/npm/doc/files/package.json.md nodejs-0.10.20/deps/npm/doc/files/package.json.md --- nodejs-0.10.17/deps/npm/doc/files/package.json.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/doc/files/package.json.md 2013-09-30 20:52:48.000000000 +0000 @@ -347,6 +347,7 @@ * `version1 - version2` Same as `>=version1 <=version2`. * `range1 || range2` Passes if either range1 or range2 are satisfied. * `git...` See 'Git URLs as Dependencies' below +* `user/repo` See 'GitHub URLs' below For example, these are all valid: @@ -384,6 +385,20 @@ The `commit-ish` can be any tag, sha, or branch which can be supplied as an argument to `git checkout`. The default is `master`. +## GitHub URLs + +As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". For example: + +```json +{ + "name": "foo", + "version": "0.0.0", + "dependencies": { + "express": "visionmedia/express" + } +} +``` + ## devDependencies If someone is planning on downloading and using your module in their diff -Nru nodejs-0.10.17/deps/npm/html/doc/README.html nodejs-0.10.20/deps/npm/html/doc/README.html --- nodejs-0.10.17/deps/npm/html/doc/README.html 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/html/doc/README.html 2013-09-30 20:52:48.000000000 +0000 @@ -185,9 +185,8 @@ -

"npm" and "the npm registry" are owned by Isaac Z. Schlueter. All -rights not explicitly granted in the MIT license are reserved. See the -included LICENSE file for more details.

+

"npm" and "the npm registry" are owned by Isaac Z. Schlueter. +All rights reserved. See the included LICENSE file for more details.

"Node.js" and "node" are trademarks owned by Joyent, Inc. npm is not officially part of the Node.js project, and is neither owned by nor @@ -240,7 +239,7 @@

- + \n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\nv1.4\n* Improved module context detection\n* Removed public RNG functions\n\nv1.3.2:\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\nv1.3:\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", + "version": "1.4.1", + "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/broofa/node-uuid/issues" }, - "_id": "node-uuid@1.4.0", + "_id": "node-uuid@1.4.1", "_from": "node-uuid@~1.4.0" } diff -Nru nodejs-0.10.17/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js nodejs-0.10.20/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js --- nodejs-0.10.17/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js 2013-09-30 20:52:48.000000000 +0000 @@ -1,8 +1,8 @@ // uuid.js // -// (c) 2010-2012 Robert Kieffer -// MIT License -// https://github.com/broofa/node-uuid +// Copyright (c) 2010-2012 Robert Kieffer +// MIT License - http://opensource.org/licenses/mit-license.php + (function() { var _global = this; @@ -224,7 +224,7 @@ uuid.unparse = unparse; uuid.BufferClass = BufferClass; - if (_global.define && define.amd) { + if (typeof define === 'function' && define.amd) { // Publish as AMD module define(function() {return uuid;}); } else if (typeof(module) != 'undefined' && module.exports) { @@ -242,4 +242,4 @@ _global.uuid = uuid; } -}()); +}).call(this); diff -Nru nodejs-0.10.17/deps/npm/node_modules/request/package.json nodejs-0.10.20/deps/npm/node_modules/request/package.json --- nodejs-0.10.17/deps/npm/node_modules/request/package.json 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/request/package.json 2013-09-30 20:52:48.000000000 +0000 @@ -7,7 +7,7 @@ "util", "utility" ], - "version": "2.25.0", + "version": "2.27.0", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" @@ -40,8 +40,8 @@ "scripts": { "test": "node tests/run.js" }, - "readme": "# Request -- Simplified HTTP request method\n\n## Install\n\n
\n  npm install request\n
\n\nOr from source:\n\n
\n  git clone git://github.com/mikeal/request.git \n  cd request\n  npm link\n
\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```javascript\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body) // Print the google web page.\n }\n})\n```\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```javascript\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers.\n\n```javascript\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers.\n\n```javascript\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nNow let's get fancy.\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n if (req.method === 'PUT') {\n req.pipe(request.put('http://mysite.com/doodle.png'))\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n request.get('http://mysite.com/doodle.png').pipe(resp)\n } \n }\n})\n```\n\nYou can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do:\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n var x = request('http://mysite.com/doodle.png')\n req.pipe(x)\n x.pipe(resp)\n }\n})\n```\n\nAnd since pipe() returns the destination stream in node 0.5.x you can do one line proxying :)\n\n```javascript\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```javascript\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n r.get('http://google.com/doodle.png').pipe(resp)\n }\n})\n```\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\nUrl encoded forms are simple\n\n```javascript\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n```\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don't need to worry about piping the form object or setting the headers, `request` will handle that for you.\n\n```javascript\nvar r = request.post('http://service.com/upload')\nvar form = r.form()\nform.append('my_field', 'my_value')\nform.append('my_buffer', new Buffer([1, 2, 3]))\nform.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png'))\nform.append('remote_file', request('http://google.com/doodle.png'))\n```\n\n## HTTP Authentication\n\n```javascript\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'user': 'username',\n 'pass': 'password',\n 'sendImmediately': false\n }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`.\n\n`sendImmediately` defaults to true, which will cause a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a 401 response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).\n\nDigest authentication is supported, but it only works with `sendImmediately` set to `false` (otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail).\n\n## OAuth Signing\n\n```javascript\n// Twitter OAuth\nvar qs = require('querystring')\n , oauth =\n { callback: 'http://mysite.com/callback/'\n , consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n }\n , url = 'https://api.twitter.com/oauth/request_token'\n ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n // Ideally, you would take the body in the response\n // and construct a URL that a user clicks on (like a sign in button).\n // The verifier is only available in the response after a user has \n // verified with twitter that they are authorizing your app.\n var access_token = qs.parse(body)\n , oauth = \n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: access_token.oauth_token\n , verifier: access_token.oauth_verifier\n }\n , url = 'https://api.twitter.com/oauth/access_token'\n ;\n request.post({url:url, oauth:oauth}, function (e, r, body) {\n var perm_token = qs.parse(body)\n , oauth = \n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: perm_token.oauth_token\n , token_secret: perm_token.oauth_token_secret\n }\n , url = 'https://api.twitter.com/1/users/show.json?'\n , params = \n { screen_name: perm_token.screen_name\n , user_id: perm_token.user_id\n }\n ;\n url += qs.stringify(params)\n request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {\n console.log(user)\n })\n })\n})\n```\n\n\n\n### request(options, callback)\n\nThe first argument can be either a url or an options object. The only required option is uri, all others are optional.\n\n* `uri` || `url` - fully qualified uri or a parsed url object from url.parse()\n* `qs` - object containing querystring values to be appended to the uri\n* `method` - http method, defaults to GET\n* `headers` - http headers, defaults to {}\n* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string.\n* `form` - when passed an object this will set `body` but to a querystring representation of value and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no option a FormData instance is returned that will be piped to request.\n* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above.\n* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json.\n* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.\n* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true.\n* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false.\n* `maxRedirects` - the maximum number of redirects to follow, defaults to 10.\n* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer.\n* `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets.\n* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.\n* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request\t\n* `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri.\n* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above.\n* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).\n* `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option.\n* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section)\n* `aws` - object containing aws signing information, should have the properties `key` and `secret` as well as `bucket` unless you're specifying your bucket as part of the path, or you are making a request that doesn't use a bucket (i.e. GET Services)\n* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.\n* `localAddress` - Local interface to bind for network connections.\n\n\nThe callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second is an http.ClientResponse object. The third is the response body String or Buffer.\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options) \n \nThis method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.\n\n### request.put\n\nSame as request() but defaults to `method: \"PUT\"`.\n\n```javascript\nrequest.put(url)\n```\n\n### request.patch\n\nSame as request() but defaults to `method: \"PATCH\"`.\n\n```javascript\nrequest.patch(url)\n```\n\n### request.post\n\nSame as request() but defaults to `method: \"POST\"`.\n\n```javascript\nrequest.post(url)\n```\n\n### request.head\n\nSame as request() but defaults to `method: \"HEAD\"`.\n\n```javascript\nrequest.head(url)\n```\n\n### request.del\n\nSame as request() but defaults to `method: \"DELETE\"`.\n\n```javascript\nrequest.del(url)\n```\n\n### request.get\n\nAlias to normal request method for uniformity.\n\n```javascript\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```javascript\nrequest.cookie('cookie_string_here')\n```\n### request.jar\n\nFunction that creates a new cookie jar.\n\n```javascript\nrequest.jar()\n```\n\n\n## Examples:\n\n```javascript\n var request = require('request')\n , rand = Math.floor(Math.random()*100000000).toString()\n ;\n request(\n { method: 'PUT'\n , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n , multipart: \n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ] \n }\n , function (error, response, body) {\n if(response.statusCode == 201){\n console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n } else {\n console.log('error: '+ response.statusCode)\n console.log(body)\n }\n }\n )\n```\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies set jar to true (either in defaults or in the options sent).\n\n```javascript\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nIf you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option:\n\n```javascript\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\nOR\n\n```javascript\nvar j = request.jar()\nvar cookie = request.cookie('your_cookie_here')\nj.add(cookie)\nrequest({url: 'http://www.google.com', jar: j}, function () {\n request('http://images.google.com')\n})\n```\n", + "readme": "# Request -- Simplified HTTP client\n\n[![NPM](https://nodei.co/npm/request.png)](https://nodei.co/npm/request/)\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```javascript\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body) // Print the google web page.\n }\n})\n```\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```javascript\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers.\n\n```javascript\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers.\n\n```javascript\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nNow let's get fancy.\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n if (req.method === 'PUT') {\n req.pipe(request.put('http://mysite.com/doodle.png'))\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n request.get('http://mysite.com/doodle.png').pipe(resp)\n }\n }\n})\n```\n\nYou can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do:\n\n```javascript\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n var x = request('http://mysite.com/doodle.png')\n req.pipe(x)\n x.pipe(resp)\n }\n})\n```\n\nAnd since pipe() returns the destination stream in node 0.5.x you can do one line proxying :)\n\n```javascript\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```javascript\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n r.get('http://google.com/doodle.png').pipe(resp)\n }\n})\n```\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\nUrl encoded forms are simple\n\n```javascript\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n```\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don't need to worry about piping the form object or setting the headers, `request` will handle that for you.\n\n```javascript\nvar r = request.post('http://service.com/upload')\nvar form = r.form()\nform.append('my_field', 'my_value')\nform.append('my_buffer', new Buffer([1, 2, 3]))\nform.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png'))\nform.append('remote_file', request('http://google.com/doodle.png'))\n```\n\n## HTTP Authentication\n\n```javascript\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'user': 'username',\n 'pass': 'password',\n 'sendImmediately': false\n }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). The method form takes parameters `auth(username, password, sendImmediately)`.\n\n`sendImmediately` defaults to true, which will cause a basic authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a 401 response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).\n\nDigest authentication is supported, but it only works with `sendImmediately` set to `false` (otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail).\n\n## OAuth Signing\n\n```javascript\n// Twitter OAuth\nvar qs = require('querystring')\n , oauth =\n { callback: 'http://mysite.com/callback/'\n , consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n }\n , url = 'https://api.twitter.com/oauth/request_token'\n ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n // Ideally, you would take the body in the response\n // and construct a URL that a user clicks on (like a sign in button).\n // The verifier is only available in the response after a user has\n // verified with twitter that they are authorizing your app.\n var access_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: access_token.oauth_token\n , verifier: access_token.oauth_verifier\n }\n , url = 'https://api.twitter.com/oauth/access_token'\n ;\n request.post({url:url, oauth:oauth}, function (e, r, body) {\n var perm_token = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: perm_token.oauth_token\n , token_secret: perm_token.oauth_token_secret\n }\n , url = 'https://api.twitter.com/1/users/show.json?'\n , params =\n { screen_name: perm_token.screen_name\n , user_id: perm_token.user_id\n }\n ;\n url += qs.stringify(params)\n request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {\n console.log(user)\n })\n })\n})\n```\n\n\n\n### request(options, callback)\n\nThe first argument can be either a url or an options object. The only required option is uri, all others are optional.\n\n* `uri` || `url` - fully qualified uri or a parsed url object from url.parse()\n* `qs` - object containing querystring values to be appended to the uri\n* `method` - http method, defaults to GET\n* `headers` - http headers, defaults to {}\n* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string.\n* `form` - when passed an object this will set `body` but to a querystring representation of value and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no option a FormData instance is returned that will be piped to request.\n* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above.\n* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json.\n* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.\n* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true.\n* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false.\n* `maxRedirects` - the maximum number of redirects to follow, defaults to 10.\n* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer.\n* `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets.\n* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.\n* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request\n* `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri.\n* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above.\n* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).\n* `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option.\n* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section)\n* `aws` - object containing aws signing information, should have the properties `key` and `secret` as well as `bucket` unless you're specifying your bucket as part of the path, or you are making a request that doesn't use a bucket (i.e. GET Services)\n* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.\n* `localAddress` - Local interface to bind for network connections.\n\n\nThe callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second is an http.ClientResponse object. The third is the response body String or Buffer.\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)\n\nThis method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.\n\n### request.put\n\nSame as request() but defaults to `method: \"PUT\"`.\n\n```javascript\nrequest.put(url)\n```\n\n### request.patch\n\nSame as request() but defaults to `method: \"PATCH\"`.\n\n```javascript\nrequest.patch(url)\n```\n\n### request.post\n\nSame as request() but defaults to `method: \"POST\"`.\n\n```javascript\nrequest.post(url)\n```\n\n### request.head\n\nSame as request() but defaults to `method: \"HEAD\"`.\n\n```javascript\nrequest.head(url)\n```\n\n### request.del\n\nSame as request() but defaults to `method: \"DELETE\"`.\n\n```javascript\nrequest.del(url)\n```\n\n### request.get\n\nAlias to normal request method for uniformity.\n\n```javascript\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```javascript\nrequest.cookie('cookie_string_here')\n```\n### request.jar\n\nFunction that creates a new cookie jar.\n\n```javascript\nrequest.jar()\n```\n\n\n## Examples:\n\n```javascript\n var request = require('request')\n , rand = Math.floor(Math.random()*100000000).toString()\n ;\n request(\n { method: 'PUT'\n , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n , multipart:\n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ]\n }\n , function (error, response, body) {\n if(response.statusCode == 201){\n console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n } else {\n console.log('error: '+ response.statusCode)\n console.log(body)\n }\n }\n )\n```\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies set jar to true (either in defaults or in the options sent).\n\n```javascript\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nIf you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option:\n\n```javascript\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\nOR\n\n```javascript\nvar j = request.jar()\nvar cookie = request.cookie('your_cookie_here')\nj.add(cookie)\nrequest({url: 'http://www.google.com', jar: j}, function () {\n request('http://images.google.com')\n})\n```\n", "readmeFilename": "README.md", - "_id": "request@2.25.0", - "_from": "request@latest" + "_id": "request@2.27.0", + "_from": "request@2.27.0" } diff -Nru nodejs-0.10.17/deps/npm/node_modules/request/request.js nodejs-0.10.20/deps/npm/node_modules/request/request.js --- nodejs-0.10.17/deps/npm/node_modules/request/request.js 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/request/request.js 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,1235 @@ +var http = require('http') + , https = false + , tls = false + , url = require('url') + , util = require('util') + , stream = require('stream') + , qs = require('qs') + , querystring = require('querystring') + , crypto = require('crypto') + + , oauth = require('oauth-sign') + , hawk = require('hawk') + , aws = require('aws-sign') + , httpSignature = require('http-signature') + , uuid = require('node-uuid') + , mime = require('mime') + , tunnel = require('tunnel-agent') + , _safeStringify = require('json-stringify-safe') + + , ForeverAgent = require('forever-agent') + , FormData = require('form-data') + + , Cookie = require('cookie-jar') + , CookieJar = Cookie.Jar + , cookieJar = new CookieJar + + , copy = require('./lib/copy') + , debug = require('./lib/debug') + , getSafe = require('./lib/getSafe') + ; + +function safeStringify (obj) { + var ret + try { ret = JSON.stringify(obj) } + catch (e) { ret = _safeStringify(obj) } + return ret +} + +var globalPool = {} +var isUrl = /^https?:/i + +try { + https = require('https') +} catch (e) {} + +try { + tls = require('tls') +} catch (e) {} + + + +// Hacky fix for pre-0.4.4 https +if (https && !https.Agent) { + https.Agent = function (options) { + http.Agent.call(this, options) + } + util.inherits(https.Agent, http.Agent) + https.Agent.prototype._getConnection = function (host, port, cb) { + var s = tls.connect(port, host, this.options, function () { + // do other checks here? + if (cb) cb() + }) + return s + } +} + +function isReadStream (rs) { + if (rs.readable && rs.path && rs.mode) { + return true + } +} + +function toBase64 (str) { + return (new Buffer(str || "", "ascii")).toString("base64") +} + +function md5 (str) { + return crypto.createHash('md5').update(str).digest('hex') +} + +function Request (options) { + stream.Stream.call(this) + this.readable = true + this.writable = true + + if (typeof options === 'string') { + options = {uri:options} + } + + var reserved = Object.keys(Request.prototype) + for (var i in options) { + if (reserved.indexOf(i) === -1) { + this[i] = options[i] + } else { + if (typeof options[i] === 'function') { + delete options[i] + } + } + } + + if (options.method) { + this.explicitMethod = true + } + + this.init(options) +} +util.inherits(Request, stream.Stream) +Request.prototype.init = function (options) { + // init() contains all the code to setup the request object. + // the actual outgoing request is not started until start() is called + // this function is called from both the constructor and on redirect. + var self = this + if (!options) options = {} + + if (!self.method) self.method = options.method || 'GET' + self.localAddress = options.localAddress + + debug(options) + if (!self.pool && self.pool !== false) self.pool = globalPool + self.dests = self.dests || [] + self.__isRequestRequest = true + + // Protect against double callback + if (!self._callback && self.callback) { + self._callback = self.callback + self.callback = function () { + if (self._callbackCalled) return // Print a warning maybe? + self._callbackCalled = true + self._callback.apply(self, arguments) + } + self.on('error', self.callback.bind()) + self.on('complete', self.callback.bind(self, null)) + } + + if (self.url && !self.uri) { + // People use this property instead all the time so why not just support it. + self.uri = self.url + delete self.url + } + + if (!self.uri) { + // this will throw if unhandled but is handleable when in a redirect + return self.emit('error', new Error("options.uri is a required argument")) + } else { + if (typeof self.uri == "string") self.uri = url.parse(self.uri) + } + + if (self.strictSSL === false) { + self.rejectUnauthorized = false + } + + if (self.proxy) { + if (typeof self.proxy == 'string') self.proxy = url.parse(self.proxy) + + // do the HTTP CONNECT dance using koichik/node-tunnel + if (http.globalAgent && self.uri.protocol === "https:") { + var tunnelFn = self.proxy.protocol === "http:" + ? tunnel.httpsOverHttp : tunnel.httpsOverHttps + + var tunnelOptions = { proxy: { host: self.proxy.hostname + , port: +self.proxy.port + , proxyAuth: self.proxy.auth + , headers: { Host: self.uri.hostname + ':' + + (self.uri.port || self.uri.protocol === 'https:' ? 443 : 80) }} + , rejectUnauthorized: self.rejectUnauthorized + , ca: this.ca } + + self.agent = tunnelFn(tunnelOptions) + self.tunnel = true + } + } + + if (!self.uri.pathname) {self.uri.pathname = '/'} + + if (!self.uri.host) { + // Invalid URI: it may generate lot of bad errors, like "TypeError: Cannot call method 'indexOf' of undefined" in CookieJar + // Detect and reject it as soon as possible + var faultyUri = url.format(self.uri) + var message = 'Invalid URI "' + faultyUri + '"' + if (Object.keys(options).length === 0) { + // No option ? This can be the sign of a redirect + // As this is a case where the user cannot do anything (he didn't call request directly with this URL) + // he should be warned that it can be caused by a redirection (can save some hair) + message += '. This can be caused by a crappy redirection.' + } + self.emit('error', new Error(message)) + return // This error was fatal + } + + self._redirectsFollowed = self._redirectsFollowed || 0 + self.maxRedirects = (self.maxRedirects !== undefined) ? self.maxRedirects : 10 + self.followRedirect = (self.followRedirect !== undefined) ? self.followRedirect : true + self.followAllRedirects = (self.followAllRedirects !== undefined) ? self.followAllRedirects : false + if (self.followRedirect || self.followAllRedirects) + self.redirects = self.redirects || [] + + self.headers = self.headers ? copy(self.headers) : {} + + self.setHost = false + if (!self.hasHeader('host')) { + self.setHeader('host', self.uri.hostname) + if (self.uri.port) { + if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') && + !(self.uri.port === 443 && self.uri.protocol === 'https:') ) + self.setHeader('host', self.getHeader('host') + (':'+self.uri.port) ) + } + self.setHost = true + } + + self.jar(self._jar || options.jar) + + if (!self.uri.port) { + if (self.uri.protocol == 'http:') {self.uri.port = 80} + else if (self.uri.protocol == 'https:') {self.uri.port = 443} + } + + if (self.proxy && !self.tunnel) { + self.port = self.proxy.port + self.host = self.proxy.hostname + } else { + self.port = self.uri.port + self.host = self.uri.hostname + } + + self.clientErrorHandler = function (error) { + if (self._aborted) return + + if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' + && self.agent.addRequestNoreuse) { + self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } + self.start() + self.req.end() + return + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + self.emit('error', error) + } + + self._parserErrorHandler = function (error) { + if (this.res) { + if (this.res.request) { + this.res.request.emit('error', error) + } else { + this.res.emit('error', error) + } + } else { + this._httpMessage.emit('error', error) + } + } + + if (options.form) { + self.form(options.form) + } + + if (options.qs) self.qs(options.qs) + + if (self.uri.path) { + self.path = self.uri.path + } else { + self.path = self.uri.pathname + (self.uri.search || "") + } + + if (self.path.length === 0) self.path = '/' + + + // Auth must happen last in case signing is dependent on other headers + if (options.oauth) { + self.oauth(options.oauth) + } + + if (options.aws) { + self.aws(options.aws) + } + + if (options.hawk) { + self.hawk(options.hawk) + } + + if (options.httpSignature) { + self.httpSignature(options.httpSignature) + } + + if (options.auth) { + self.auth( + (options.auth.user==="") ? options.auth.user : (options.auth.user || options.auth.username ), + options.auth.pass || options.auth.password, + options.auth.sendImmediately) + } + + if (self.uri.auth && !self.hasHeader('authorization')) { + var authPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) }) + self.auth(authPieces[0], authPieces.slice(1).join(':'), true) + } + if (self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization') && !self.tunnel) { + self.setHeader('proxy-authorization', "Basic " + toBase64(self.proxy.auth.split(':').map(function(item){ return querystring.unescape(item)}).join(':'))) + } + + + if (self.proxy && !self.tunnel) self.path = (self.uri.protocol + '//' + self.uri.host + self.path) + + if (options.json) { + self.json(options.json) + } else if (options.multipart) { + self.boundary = uuid() + self.multipart(options.multipart) + } + + if (self.body) { + var length = 0 + if (!Buffer.isBuffer(self.body)) { + if (Array.isArray(self.body)) { + for (var i = 0; i < self.body.length; i++) { + length += self.body[i].length + } + } else { + self.body = new Buffer(self.body) + length = self.body.length + } + } else { + length = self.body.length + } + if (length) { + if (!self.hasHeader('content-length')) self.setHeader('content-length', length) + } else { + throw new Error('Argument error, options.body.') + } + } + + var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol + , defaultModules = {'http:':http, 'https:':https} + , httpModules = self.httpModules || {} + ; + self.httpModule = httpModules[protocol] || defaultModules[protocol] + + if (!self.httpModule) return this.emit('error', new Error("Invalid protocol")) + + if (options.ca) self.ca = options.ca + + if (!self.agent) { + if (options.agentOptions) self.agentOptions = options.agentOptions + + if (options.agentClass) { + self.agentClass = options.agentClass + } else if (options.forever) { + self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL + } else { + self.agentClass = self.httpModule.Agent + } + } + + if (self.pool === false) { + self.agent = false + } else { + self.agent = self.agent || self.getAgent() + if (self.maxSockets) { + // Don't use our pooling if node has the refactored client + self.agent.maxSockets = self.maxSockets + } + if (self.pool.maxSockets) { + // Don't use our pooling if node has the refactored client + self.agent.maxSockets = self.pool.maxSockets + } + } + + self.on('pipe', function (src) { + if (self.ntick && self._started) throw new Error("You cannot pipe to this stream after the outbound request has started.") + self.src = src + if (isReadStream(src)) { + if (!self.hasHeader('content-type')) self.setHeader('content-type', mime.lookup(src.path)) + } else { + if (src.headers) { + for (var i in src.headers) { + if (!self.hasHeader(i)) { + self.setHeader(i, src.headers[i]) + } + } + } + if (self._json && !self.hasHeader('content-type')) + self.setHeader('content-type', 'application/json') + if (src.method && !self.explicitMethod) { + self.method = src.method + } + } + + // self.on('pipe', function () { + // console.error("You have already piped to this stream. Pipeing twice is likely to break the request.") + // }) + }) + + process.nextTick(function () { + if (self._aborted) return + + if (self._form) { + self.setHeaders(self._form.getHeaders()) + self._form.pipe(self) + } + if (self.body) { + if (Array.isArray(self.body)) { + self.body.forEach(function (part) { + self.write(part) + }) + } else { + self.write(self.body) + } + self.end() + } else if (self.requestBodyStream) { + console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.") + self.requestBodyStream.pipe(self) + } else if (!self.src) { + if (self.method !== 'GET' && typeof self.method !== 'undefined') { + self.setHeader('content-length', 0) + } + self.end() + } + self.ntick = true + }) +} + +// Must call this when following a redirect from https to http or vice versa +// Attempts to keep everything as identical as possible, but update the +// httpModule, Tunneling agent, and/or Forever Agent in use. +Request.prototype._updateProtocol = function () { + var self = this + var protocol = self.uri.protocol + + if (protocol === 'https:') { + // previously was doing http, now doing https + // if it's https, then we might need to tunnel now. + if (self.proxy) { + self.tunnel = true + var tunnelFn = self.proxy.protocol === 'http:' + ? tunnel.httpsOverHttp : tunnel.httpsOverHttps + var tunnelOptions = { proxy: { host: self.proxy.hostname + , port: +self.proxy.port + , proxyAuth: self.proxy.auth } + , rejectUnauthorized: self.rejectUnauthorized + , ca: self.ca } + self.agent = tunnelFn(tunnelOptions) + return + } + + self.httpModule = https + switch (self.agentClass) { + case ForeverAgent: + self.agentClass = ForeverAgent.SSL + break + case http.Agent: + self.agentClass = https.Agent + break + default: + // nothing we can do. Just hope for the best. + return + } + + // if there's an agent, we need to get a new one. + if (self.agent) self.agent = self.getAgent() + + } else { + // previously was doing https, now doing http + // stop any tunneling. + if (self.tunnel) self.tunnel = false + self.httpModule = http + switch (self.agentClass) { + case ForeverAgent.SSL: + self.agentClass = ForeverAgent + break + case https.Agent: + self.agentClass = http.Agent + break + default: + // nothing we can do. just hope for the best + return + } + + // if there's an agent, then get a new one. + if (self.agent) { + self.agent = null + self.agent = self.getAgent() + } + } +} + +Request.prototype.getAgent = function () { + var Agent = this.agentClass + var options = {} + if (this.agentOptions) { + for (var i in this.agentOptions) { + options[i] = this.agentOptions[i] + } + } + if (this.ca) options.ca = this.ca + if (typeof this.rejectUnauthorized !== 'undefined') options.rejectUnauthorized = this.rejectUnauthorized + + if (this.cert && this.key) { + options.key = this.key + options.cert = this.cert + } + + var poolKey = '' + + // different types of agents are in different pools + if (Agent !== this.httpModule.Agent) { + poolKey += Agent.name + } + + if (!this.httpModule.globalAgent) { + // node 0.4.x + options.host = this.host + options.port = this.port + if (poolKey) poolKey += ':' + poolKey += this.host + ':' + this.port + } + + // ca option is only relevant if proxy or destination are https + var proxy = this.proxy + if (typeof proxy === 'string') proxy = url.parse(proxy) + var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' + if (isHttps) { + if (options.ca) { + if (poolKey) poolKey += ':' + poolKey += options.ca + } + + if (typeof options.rejectUnauthorized !== 'undefined') { + if (poolKey) poolKey += ':' + poolKey += options.rejectUnauthorized + } + + if (options.cert) + poolKey += options.cert.toString('ascii') + options.key.toString('ascii') + + if (options.ciphers) { + if (poolKey) poolKey += ':' + poolKey += options.ciphers + } + + if (options.secureOptions) { + if (poolKey) poolKey += ':' + poolKey += options.secureOptions + } + } + + if (this.pool === globalPool && !poolKey && Object.keys(options).length === 0 && this.httpModule.globalAgent) { + // not doing anything special. Use the globalAgent + return this.httpModule.globalAgent + } + + // we're using a stored agent. Make sure it's protocol-specific + poolKey = this.uri.protocol + poolKey + + // already generated an agent for this setting + if (this.pool[poolKey]) return this.pool[poolKey] + + return this.pool[poolKey] = new Agent(options) +} + +Request.prototype.start = function () { + // start() is called once we are ready to send the outgoing HTTP request. + // this is usually called on the first write(), end() or on nextTick() + var self = this + + if (self._aborted) return + + self._started = true + self.method = self.method || 'GET' + self.href = self.uri.href + + if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { + self.setHeader('content-length', self.src.stat.size) + } + if (self._aws) { + self.aws(self._aws, true) + } + + // We have a method named auth, which is completely different from the http.request + // auth option. If we don't remove it, we're gonna have a bad time. + var reqOptions = copy(self) + delete reqOptions.auth + + debug('make request', self.uri.href) + self.req = self.httpModule.request(reqOptions, self.onResponse.bind(self)) + + if (self.timeout && !self.timeoutTimer) { + self.timeoutTimer = setTimeout(function () { + self.req.abort() + var e = new Error("ETIMEDOUT") + e.code = "ETIMEDOUT" + self.emit("error", e) + }, self.timeout) + + // Set additional timeout on socket - in case if remote + // server freeze after sending headers + if (self.req.setTimeout) { // only works on node 0.6+ + self.req.setTimeout(self.timeout, function () { + if (self.req) { + self.req.abort() + var e = new Error("ESOCKETTIMEDOUT") + e.code = "ESOCKETTIMEDOUT" + self.emit("error", e) + } + }) + } + } + + self.req.on('error', self.clientErrorHandler) + self.req.on('drain', function() { + self.emit('drain') + }) + self.on('end', function() { + if ( self.req.connection ) self.req.connection.removeListener('error', self._parserErrorHandler) + }) + self.emit('request', self.req) +} +Request.prototype.onResponse = function (response) { + var self = this + debug('onResponse', self.uri.href, response.statusCode, response.headers) + response.on('end', function() { + debug('response end', self.uri.href, response.statusCode, response.headers) + }); + + if (response.connection.listeners('error').indexOf(self._parserErrorHandler) === -1) { + response.connection.once('error', self._parserErrorHandler) + } + if (self._aborted) { + debug('aborted', self.uri.href) + response.resume() + return + } + if (self._paused) response.pause() + else response.resume() + + self.response = response + response.request = self + response.toJSON = toJSON + + // XXX This is different on 0.10, because SSL is strict by default + if (self.httpModule === https && + self.strictSSL && + !response.client.authorized) { + debug('strict ssl error', self.uri.href) + var sslErr = response.client.authorizationError + self.emit('error', new Error('SSL Error: '+ sslErr)) + return + } + + if (self.setHost && self.hasHeader('host')) delete self.headers[self.hasHeader('host')] + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + + var addCookie = function (cookie) { + if (self._jar){ + if(self._jar.add){ + self._jar.add(new Cookie(cookie)) + } + else cookieJar.add(new Cookie(cookie)) + } + + } + + if (hasHeader('set-cookie', response.headers) && (!self._disableCookies)) { + var headerName = hasHeader('set-cookie', response.headers) + if (Array.isArray(response.headers[headerName])) response.headers[headerName].forEach(addCookie) + else addCookie(response.headers[headerName]) + } + + var redirectTo = null + if (response.statusCode >= 300 && response.statusCode < 400 && hasHeader('location', response.headers)) { + var location = response.headers[hasHeader('location', response.headers)] + debug('redirect', location) + + if (self.followAllRedirects) { + redirectTo = location + } else if (self.followRedirect) { + switch (self.method) { + case 'PATCH': + case 'PUT': + case 'POST': + case 'DELETE': + // Do not follow redirects + break + default: + redirectTo = location + break + } + } + } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) { + var authHeader = response.headers[hasHeader('www-authenticate', response.headers)] + var authVerb = authHeader && authHeader.split(' ')[0] + debug('reauth', authVerb) + + switch (authVerb) { + case 'Basic': + self.auth(self._user, self._pass, true) + redirectTo = self.uri + break + + case 'Digest': + // TODO: More complete implementation of RFC 2617. For reference: + // http://tools.ietf.org/html/rfc2617#section-3 + // https://github.com/bagder/curl/blob/master/lib/http_digest.c + + var matches = authHeader.match(/([a-z0-9_-]+)="([^"]+)"/gi) + var challenge = {} + + for (var i = 0; i < matches.length; i++) { + var eqPos = matches[i].indexOf('=') + var key = matches[i].substring(0, eqPos) + var quotedValue = matches[i].substring(eqPos + 1) + challenge[key] = quotedValue.substring(1, quotedValue.length - 1) + } + + var ha1 = md5(self._user + ':' + challenge.realm + ':' + self._pass) + var ha2 = md5(self.method + ':' + self.uri.path) + var digestResponse = md5(ha1 + ':' + challenge.nonce + ':1::auth:' + ha2) + var authValues = { + username: self._user, + realm: challenge.realm, + nonce: challenge.nonce, + uri: self.uri.path, + qop: challenge.qop, + response: digestResponse, + nc: 1, + cnonce: '' + } + + authHeader = [] + for (var k in authValues) { + authHeader.push(k + '="' + authValues[k] + '"') + } + authHeader = 'Digest ' + authHeader.join(', ') + self.setHeader('authorization', authHeader) + self._sentAuth = true + + redirectTo = self.uri + break + } + } + + if (redirectTo) { + debug('redirect to', redirectTo) + + // ignore any potential response body. it cannot possibly be useful + // to us at this point. + if (self._paused) response.resume() + + if (self._redirectsFollowed >= self.maxRedirects) { + self.emit('error', new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+self.uri.href)) + return + } + self._redirectsFollowed += 1 + + if (!isUrl.test(redirectTo)) { + redirectTo = url.resolve(self.uri.href, redirectTo) + } + + var uriPrev = self.uri + self.uri = url.parse(redirectTo) + + // handle the case where we change protocol from https to http or vice versa + if (self.uri.protocol !== uriPrev.protocol) { + self._updateProtocol() + } + + self.redirects.push( + { statusCode : response.statusCode + , redirectUri: redirectTo + } + ) + if (self.followAllRedirects && response.statusCode != 401) self.method = 'GET' + // self.method = 'GET' // Force all redirects to use GET || commented out fixes #215 + delete self.src + delete self.req + delete self.agent + delete self._started + if (response.statusCode != 401) { + // Remove parameters from the previous response, unless this is the second request + // for a server that requires digest authentication. + delete self.body + delete self._form + if (self.headers) { + if (self.hasHeader('host')) delete self.headers[self.hasHeader('host')] + if (self.hasHeader('content-type')) delete self.headers[self.hasHeader('content-type')] + if (self.hasHeader('content-length')) delete self.headers[self.hasHeader('content-length')] + } + } + + self.emit('redirect'); + + self.init() + return // Ignore the rest of the response + } else { + self._redirectsFollowed = self._redirectsFollowed || 0 + // Be a good stream and emit end when the response is finished. + // Hack to emit end on close because of a core bug that never fires end + response.on('close', function () { + if (!self._ended) self.response.emit('end') + }) + + if (self.encoding) { + if (self.dests.length !== 0) { + console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.") + } else { + response.setEncoding(self.encoding) + } + } + + self.emit('response', response) + + self.dests.forEach(function (dest) { + self.pipeDest(dest) + }) + + response.on("data", function (chunk) { + self._destdata = true + self.emit("data", chunk) + }) + response.on("end", function (chunk) { + self._ended = true + self.emit("end", chunk) + }) + response.on("close", function () {self.emit("close")}) + + if (self.callback) { + var buffer = [] + var bodyLen = 0 + self.on("data", function (chunk) { + buffer.push(chunk) + bodyLen += chunk.length + }) + self.on("end", function () { + debug('end event', self.uri.href) + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + + if (buffer.length && Buffer.isBuffer(buffer[0])) { + debug('has body', self.uri.href, bodyLen) + var body = new Buffer(bodyLen) + var i = 0 + buffer.forEach(function (chunk) { + chunk.copy(body, i, 0, chunk.length) + i += chunk.length + }) + if (self.encoding === null) { + response.body = body + } else { + response.body = body.toString(self.encoding) + } + } else if (buffer.length) { + // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. + // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). + if (self.encoding === 'utf8' && buffer[0].length > 0 && buffer[0][0] === "\uFEFF") { + buffer[0] = buffer[0].substring(1) + } + response.body = buffer.join('') + } + + if (self._json) { + try { + response.body = JSON.parse(response.body) + } catch (e) {} + } + debug('emitting complete', self.uri.href) + if(response.body == undefined && !self._json) { + response.body = ""; + } + self.emit('complete', response, response.body) + }) + } + //if no callback + else{ + self.on("end", function () { + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + self.emit('complete', response); + }); + } + } + debug('finish init function', self.uri.href) +} + +Request.prototype.abort = function () { + this._aborted = true + + if (this.req) { + this.req.abort() + } + else if (this.response) { + this.response.abort() + } + + this.emit("abort") +} + +Request.prototype.pipeDest = function (dest) { + var response = this.response + // Called after the response is received + if (dest.headers && !dest.headersSent) { + if (hasHeader('content-type', response.headers)) { + var ctname = hasHeader('content-type', response.headers) + if (dest.setHeader) dest.setHeader(ctname, response.headers[ctname]) + else dest.headers[ctname] = response.headers[ctname] + } + + if (hasHeader('content-length', response.headers)) { + var clname = hasHeader('content-length', response.headers) + if (dest.setHeader) dest.setHeader(clname, response.headers[clname]) + else dest.headers[clname] = response.headers[clname] + } + } + if (dest.setHeader && !dest.headersSent) { + for (var i in response.headers) { + dest.setHeader(i, response.headers[i]) + } + dest.statusCode = response.statusCode + } + if (this.pipefilter) this.pipefilter(response, dest) +} + +// Composable API +Request.prototype.setHeader = function (name, value, clobber) { + if (clobber === undefined) clobber = true + if (clobber || !this.hasHeader(name)) this.headers[name] = value + else this.headers[this.hasHeader(name)] += ',' + value + return this +} +Request.prototype.setHeaders = function (headers) { + for (var i in headers) {this.setHeader(i, headers[i])} + return this +} +Request.prototype.hasHeader = function (header, headers) { + var headers = Object.keys(headers || this.headers) + , lheaders = headers.map(function (h) {return h.toLowerCase()}) + ; + header = header.toLowerCase() + for (var i=0;i 0) { - if (state.decoder) - chunk = state.decoder.write(chunk); + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) { + state.buffer.unshift(chunk); + } else { + state.reading = false; + state.buffer.push(chunk); + } - if (state.needReadable) - emitReadable(stream); + if (state.needReadable) + emitReadable(stream); - maybeReadMore(stream, state); + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; } return needMoreData(state); @@ -171,6 +197,7 @@ if (!StringDecoder) StringDecoder = require('string_decoder').StringDecoder; this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; }; // Don't raise the hwm > 128MB @@ -238,7 +265,7 @@ // the 'readable' event and move on. if (n === 0 && state.needReadable && - state.length >= state.highWaterMark) { + (state.length >= state.highWaterMark || state.ended)) { emitReadable(this); return null; } @@ -345,14 +372,14 @@ function onEofChunk(stream, state) { - state.ended = true; - if (state.decoder && state.decoder.end) { + if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } + state.ended = true; // if we've ended and we have some data left, then emit // 'readable' now to make sure it gets picked up. @@ -381,7 +408,6 @@ } function emitReadable_(stream) { - var state = stream._readableState; stream.emit('readable'); } @@ -490,10 +516,20 @@ // however, don't suppress the throwing behavior for this. function onerror(er) { unpipe(); + dest.removeListener('error', onerror); if (EE.listenerCount(dest, 'error') === 0) dest.emit('error', er); } - dest.once('error', onerror); + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events.error) + dest.on('error', onerror); + else if (Array.isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + // Both close and finish should trigger unpipe, but only once. function onclose() { @@ -658,8 +694,19 @@ if (ev === 'data' && !this._readableState.flowing) emitDataEvents(this); - if (ev === 'readable' && !this._readableState.reading) - this.read(0); + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + this.read(0); + } else if (state.length) { + emitReadable(this, state); + } + } + } return res; }; @@ -736,8 +783,7 @@ var self = this; stream.on('end', function() { - state.ended = true; - if (state.decoder && state.decoder.end) { + if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) self.push(chunk); @@ -749,7 +795,7 @@ stream.on('data', function(chunk) { if (state.decoder) chunk = state.decoder.write(chunk); - if (!chunk || !chunk.length) + if (!chunk || !state.objectMode && !chunk.length) return; var ret = self.push(chunk); @@ -780,10 +826,12 @@ // underlying stream. self._read = function(n) { if (paused) { - stream.resume(); paused = false; + stream.resume(); } }; + + return self; }; @@ -867,10 +915,13 @@ if (!state.endEmitted && state.calledRead) { state.ended = true; - state.endEmitted = true; process.nextTick(function() { - stream.readable = false; - stream.emit('end'); + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } }); } } diff -Nru nodejs-0.10.17/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js nodejs-0.10.20/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js --- nodejs-0.10.17/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js 2013-09-30 20:52:48.000000000 +0000 @@ -70,8 +70,6 @@ function TransformState(options, stream) { - var ts = this; - this.afterTransform = function(er, data) { return afterTransform(stream, er, data); }; @@ -101,6 +99,7 @@ cb(er); var rs = stream._readableState; + rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { stream._read(rs.highWaterMark); } @@ -136,9 +135,9 @@ }); } -Transform.prototype.push = function(chunk) { +Transform.prototype.push = function(chunk, encoding) { this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk); + return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! @@ -151,7 +150,7 @@ // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, output, cb) { +Transform.prototype._transform = function(chunk, encoding, cb) { throw new Error('not implemented'); }; @@ -170,7 +169,7 @@ }; // Doesn't matter what the args are here. -// the output and callback functions passed to _transform do all the work. +// _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function(n) { var ts = this._transformState; diff -Nru nodejs-0.10.17/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js nodejs-0.10.20/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js --- nodejs-0.10.17/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js 2013-09-30 20:52:48.000000000 +0000 @@ -68,6 +68,11 @@ var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. @@ -160,8 +165,11 @@ cb = encoding; encoding = null; } - if (!encoding) - encoding = 'utf8'; + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = function() {}; @@ -240,7 +248,8 @@ if (er) onwriteError(stream, state, sync, er, cb); else { - var finished = finishMaybe(stream, state); + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(stream, state); if (!finished && !state.bufferProcessing && state.buffer.length) clearBuffer(stream, state); @@ -259,6 +268,8 @@ if (!finished) onwriteDrain(stream, state); cb(); + if (finished) + finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't @@ -326,12 +337,21 @@ endWritable(this, state, cb); }; + +function needFinish(stream, state) { + return (state.ending && + state.length === 0 && + !state.finished && + !state.writing); +} + function finishMaybe(stream, state) { - if (state.ending && state.length === 0 && !state.finished) { + var need = needFinish(stream, state); + if (need) { state.finished = true; stream.emit('finish'); } - return state.finished; + return need; } function endWritable(stream, state, cb) { diff -Nru nodejs-0.10.17/deps/npm/node_modules/sha/node_modules/readable-stream/package.json nodejs-0.10.20/deps/npm/node_modules/sha/node_modules/readable-stream/package.json --- nodejs-0.10.17/deps/npm/node_modules/sha/node_modules/readable-stream/package.json 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/sha/node_modules/readable-stream/package.json 2013-09-30 20:52:48.000000000 +0000 @@ -1,6 +1,6 @@ { "name": "readable-stream", - "version": "1.0.2", + "version": "1.0.17", "description": "An exploration of a new kind of readable streams for Node.js", "main": "readable.js", "dependencies": {}, @@ -30,6 +30,10 @@ "bugs": { "url": "https://github.com/isaacs/readable-stream/issues" }, - "_id": "readable-stream@1.0.2", - "_from": "readable-stream@1.0" + "_id": "readable-stream@1.0.17", + "dist": { + "shasum": "cbc295fdf394dfa1225d225d02e6b6d0f409fd4b" + }, + "_from": "readable-stream@1.0", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.17.tgz" } diff -Nru nodejs-0.10.17/deps/npm/node_modules/sha/package.json nodejs-0.10.20/deps/npm/node_modules/sha/package.json --- nodejs-0.10.17/deps/npm/node_modules/sha/package.json 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/sha/package.json 2013-09-30 20:52:48.000000000 +0000 @@ -1,6 +1,6 @@ { "name": "sha", - "version": "1.2.1", + "version": "1.2.3", "description": "Check and get file hashes", "scripts": { "test": "mocha -R spec" @@ -17,7 +17,7 @@ "devDependencies": { "mocha": "~1.9.0" }, - "readme": "# sha\n\nCheck and get file hashes (using any algorithm)\n\n[![Build Status](https://travis-ci.org/ForbesLindesay/sha.png?branch=master)](https://travis-ci.org/ForbesLindesay/sha)\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/sha.png)](https://gemnasium.com/ForbesLindesay/sha)\n[![NPM version](https://badge.fury.io/js/sha.png)](http://badge.fury.io/js/sha)\n\n## Installation\n\n $ npm install sha\n\n## API\n\n### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options])\n\nAsynchronously check that `fileName` has a \"hash\" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match).\n\nOptions:\n\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\n\n### get(fileName, [options,] cb) / getSync(filename, [options])\n\nAsynchronously get the \"hash\" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash.\n\nOptions:\n\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\n\n### stream(expected, [options])\n\nCheck the hash of a stream without ever buffering it. This is a pass through stream so you can do things like:\n\n```js\nfs.createReadStream('src')\n .pipe(sha.stream('expected'))\n .pipe(fs.createWriteStream('dest'))\n```\n\n`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`.\n\nOptions:\n\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\n\n## License\n\nYou may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request.", + "readme": "# sha\r\n\r\nCheck and get file hashes (using any algorithm)\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/sha.png?branch=master)](https://travis-ci.org/ForbesLindesay/sha)\r\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/sha.png)](https://gemnasium.com/ForbesLindesay/sha)\r\n[![NPM version](https://badge.fury.io/js/sha.png)](http://badge.fury.io/js/sha)\r\n\r\n## Installation\r\n\r\n $ npm install sha\r\n\r\n## API\r\n\r\n### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options])\r\n\r\nAsynchronously check that `fileName` has a \"hash\" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match).\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n### get(fileName, [options,] cb) / getSync(filename, [options])\r\n\r\nAsynchronously get the \"hash\" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash.\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n### stream(expected, [options])\r\n\r\nCheck the hash of a stream without ever buffering it. This is a pass through stream so you can do things like:\r\n\r\n```js\r\nfs.createReadStream('src')\r\n .pipe(sha.stream('expected'))\r\n .pipe(fs.createWriteStream('dest'))\r\n```\r\n\r\n`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`.\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n## License\r\n\r\nYou may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request.", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/ForbesLindesay/sha/issues" @@ -26,6 +26,6 @@ "graceful-fs": "2", "readable-stream": "1.0" }, - "_id": "sha@1.2.1", - "_from": "sha@~1.2.1" + "_id": "sha@1.2.3", + "_from": "sha@latest" } diff -Nru nodejs-0.10.17/deps/npm/node_modules/slide/LICENSE nodejs-0.10.20/deps/npm/node_modules/slide/LICENSE --- nodejs-0.10.17/deps/npm/node_modules/slide/LICENSE 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/slide/LICENSE 2013-09-30 20:52:48.000000000 +0000 @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC License -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +Copyright (c) Isaac Z. Schlueter -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff -Nru nodejs-0.10.17/deps/npm/node_modules/slide/package.json nodejs-0.10.20/deps/npm/node_modules/slide/package.json --- nodejs-0.10.17/deps/npm/node_modules/slide/package.json 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/node_modules/slide/package.json 2013-09-30 20:52:48.000000000 +0000 @@ -1,6 +1,6 @@ { "name": "slide", - "version": "1.1.4", + "version": "1.1.5", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -24,11 +24,12 @@ "type": "git", "url": "git://github.com/isaacs/slide-flow-control.git" }, + "license": "ISC", "readme": "# Controlling Flow: callbacks are easy\n\n## What's actually hard?\n\n- Doing a bunch of things in a specific order.\n- Knowing when stuff is done.\n- Handling failures.\n- Breaking up functionality into parts (avoid nested inline callbacks)\n\n\n## Common Mistakes\n\n- Abandoning convention and consistency.\n- Putting all callbacks inline.\n- Using libraries without grokking them.\n- Trying to make async code look sync.\n\n## Define Conventions\n\n- Two kinds of functions: *actors* take action, *callbacks* get results.\n- Essentially the continuation pattern. Resulting code *looks* similar\n to fibers, but is *much* simpler to implement.\n- Node works this way in the lowlevel APIs already, and it's very flexible.\n\n## Callbacks\n\n- Simple responders\n- Must always be prepared to handle errors, that's why it's the first argument.\n- Often inline anonymous, but not always.\n- Can trap and call other callbacks with modified data, or pass errors upwards.\n\n## Actors\n\n- Last argument is a callback.\n- If any error occurs, and can't be handled, pass it to the callback and return.\n- Must not throw. Return value ignored.\n- return x ==> return cb(null, x)\n- throw er ==> return cb(er)\n\n```javascript\n// return true if a path is either\n// a symlink or a directory.\nfunction isLinkOrDir (path, cb) {\n fs.lstat(path, function (er, s) {\n if (er) return cb(er)\n return cb(null, s.isDirectory() || s.isSymbolicLink())\n })\n}\n```\n\n# asyncMap\n\n## Usecases\n\n- I have a list of 10 files, and need to read all of them, and then continue when they're all done.\n- I have a dozen URLs, and need to fetch them all, and then continue when they're all done.\n- I have 4 connected users, and need to send a message to all of them, and then continue when that's done.\n- I have a list of n things, and I need to dosomething with all of them, in parallel, and get the results once they're all complete.\n\n\n## Solution\n\n```javascript\nvar asyncMap = require(\"slide\").asyncMap\nfunction writeFiles (files, what, cb) {\n asyncMap(files, function (f, cb) {\n fs.writeFile(f, what, cb)\n }, cb)\n}\nwriteFiles([my, file, list], \"foo\", cb)\n```\n\n# chain\n\n## Usecases\n\n- I have to do a bunch of things, in order. Get db credentials out of a file,\n read the data from the db, write that data to another file.\n- If anything fails, do not continue.\n- I still have to provide an array of functions, which is a lot of boilerplate,\n and a pita if your functions take args like\n\n```javascript\nfunction (cb) {\n blah(a, b, c, cb)\n}\n```\n\n- Results are discarded, which is a bit lame.\n- No way to branch.\n\n## Solution\n\n- reduces boilerplate by converting an array of [fn, args] to an actor\n that takes no arguments (except cb)\n- A bit like Function#bind, but tailored for our use-case.\n- bindActor(obj, \"method\", a, b, c)\n- bindActor(fn, a, b, c)\n- bindActor(obj, fn, a, b, c)\n- branching, skipping over falsey arguments\n\n```javascript\nchain([\n doThing && [thing, a, b, c]\n, isFoo && [doFoo, \"foo\"]\n, subChain && [chain, [one, two]]\n], cb)\n```\n\n- tracking results: results are stored in an optional array passed as argument,\n last result is always in results[results.length - 1].\n- treat chain.first and chain.last as placeholders for the first/last\n result up until that point.\n\n\n## Non-trivial example\n\n- Read number files in a directory\n- Add the results together\n- Ping a web service with the result\n- Write the response to a file\n- Delete the number files\n\n```javascript\nvar chain = require(\"slide\").chain\nfunction myProgram (cb) {\n var res = [], last = chain.last, first = chain.first\n chain([\n [fs, \"readdir\", \"the-directory\"]\n , [readFiles, \"the-directory\", last]\n , [sum, last]\n , [ping, \"POST\", \"example.com\", 80, \"/foo\", last]\n , [fs, \"writeFile\", \"result.txt\", last]\n , [rmFiles, \"./the-directory\", first]\n ], res, cb)\n}\n```\n\n# Conclusion: Convention Profits\n\n- Consistent API from top to bottom.\n- Sneak in at any point to inject functionality. Testable, reusable, ...\n- When ruby and python users whine, you can smile condescendingly.\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/slide-flow-control/issues" }, - "_id": "slide@1.1.4", - "_from": "slide@latest" + "_id": "slide@1.1.5", + "_from": "slide@~1.1.4" } diff -Nru nodejs-0.10.17/deps/npm/package.json nodejs-0.10.20/deps/npm/package.json --- nodejs-0.10.17/deps/npm/package.json 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/npm/package.json 2013-09-30 20:52:48.000000000 +0000 @@ -1,5 +1,5 @@ { - "version": "1.3.8", + "version": "1.3.11", "name": "npm", "publishConfig": { "proprietary-attribs": false @@ -36,21 +36,21 @@ "dependencies": { "semver": "~2.1.0", "ini": "~1.1.0", - "slide": "~1.1.4", + "slide": "~1.1.5", "abbrev": "~1.0.4", "graceful-fs": "~2.0.0", "minimatch": "~0.2.12", "nopt": "~2.1.2", "rimraf": "~2.2.0", - "request": "~2.25.0", + "request": "~2.27.0", "which": "1", "tar": "~0.1.18", "fstream": "~0.1.23", "block-stream": "0.0.7", "mkdirp": "~0.3.3", "read": "~1.0.4", - "lru-cache": "~2.3.0", - "node-gyp": "~0.10.9", + "lru-cache": "~2.3.1", + "node-gyp": "~0.10.10", "fstream-npm": "~0.1.3", "uid-number": "0", "archy": "0", @@ -58,7 +58,7 @@ "npmlog": "0.0.4", "ansi": "~0.1.2", "npm-registry-client": "~0.2.28", - "read-package-json": "~1.1.0", + "read-package-json": "~1.1.3", "read-installed": "~0.2.2", "glob": "~3.2.6", "init-package-json": "0.0.11", @@ -123,7 +123,7 @@ "devDependencies": { "ronn": "~0.3.6", "tap": "~0.4.0", - "npm-registry-mock": "~0.2.0" + "npm-registry-mock": "~0.3.0" }, "engines": { "node": ">=0.6", diff -Nru nodejs-0.10.17/deps/npm/test/tap/outdated/index.js nodejs-0.10.20/deps/npm/test/tap/outdated/index.js --- nodejs-0.10.17/deps/npm/test/tap/outdated/index.js 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/deps/npm/test/tap/outdated/index.js 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1 @@ +module.exports = true diff -Nru nodejs-0.10.17/deps/npm/test/tap/outdated/package.json nodejs-0.10.20/deps/npm/test/tap/outdated/package.json --- nodejs-0.10.17/deps/npm/test/tap/outdated/package.json 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/deps/npm/test/tap/outdated/package.json 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,8 @@ +{ + "name": "bla", + "version": "0.0.1", + "main": "index.js", + "dependencies": { + "underscore": "1.3.1" + } +} diff -Nru nodejs-0.10.17/deps/npm/test/tap/outdated.js nodejs-0.10.20/deps/npm/test/tap/outdated.js --- nodejs-0.10.17/deps/npm/test/tap/outdated.js 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/deps/npm/test/tap/outdated.js 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,32 @@ +var fs = require("fs") +var test = require("tap").test +var rimraf = require("rimraf") +var npm = require("../../") + +var mr = require("npm-registry-mock") +// config +var port = 1331 +var address = "http://localhost:" + port +var pkg = __dirname + '/outdated' + +test("it should not throw", function (t) { + rimraf.sync(pkg + "/node_modules") + process.chdir(pkg) + + mr(port, function (s) { + npm.load({registry: address}, function () { + npm.install(".", function (err) { + npm.outdated(function (er, d) { + console.log(d) + s.close() + t.end() + }) + }) + }) + }) +}) + +test("cleanup", function (t) { + rimraf.sync(pkg + "/node_modules") + t.end() +}) \ No newline at end of file diff -Nru nodejs-0.10.17/deps/uv/ChangeLog nodejs-0.10.20/deps/uv/ChangeLog --- nodejs-0.10.17/deps/uv/ChangeLog 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/ChangeLog 2013-09-30 20:52:48.000000000 +0000 @@ -1,4 +1,44 @@ -2013.08.22, Version 0.10.14 (Stable) +2013.09.25, Version 0.10.17 (Stable) + +Changes since version 0.10.16: + +* build: remove GCC_WARN_ABOUT_MISSING_NEWLINE (Ben Noordhuis) + +* darwin: fix 10.6 build error in fsevents.c (Ben Noordhuis) + + +2013.09.06, Version 0.10.16 (Stable), 2bce230d81f4853a23662cbeb26fe98010b1084b + +Changes since version 0.10.15: + +* windows: make uv_shutdown() for write-only pipes work (Bert Belder) + +* windows: make uv_fs_open() report EINVAL when invalid arguments are passed + (Bert Belder) + +* windows: make uv_fs_open() report _open_osfhandle() failure correctly (Bert + Belder) + +* windows: make uv_fs_chmod() report errors correctly (Bert Belder) + +* windows: wrap multi-statement macros in do..while block (Bert Belder) + + +2013.08.24, Version 0.10.15 (Stable), 221078a8fdd9b853c6b557b3d9a5dd744b4fdd6b + +Changes since version 0.10.14: + +* fsevents: create FSEvents thread on demand (Ben Noordhuis) + +* fsevents: use a single thread for interacting with FSEvents, because it's not + thread-safe. (Fedor Indutny) + +* fsevents: share FSEventStream between multiple FS watchers, which removes a + limit on the maximum number of file watchers that can be created on OS X. + (Fedor Indutny) + + +2013.08.22, Version 0.10.14 (Stable), 15d64132151c18b26346afa892444b95e2addad0 Changes since version 0.10.13: diff -Nru nodejs-0.10.17/deps/uv/common.gypi nodejs-0.10.20/deps/uv/common.gypi --- nodejs-0.10.17/deps/uv/common.gypi 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/common.gypi 2013-09-30 20:52:48.000000000 +0000 @@ -171,7 +171,6 @@ 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics - 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof 'PREBINDING': 'NO', # No -Wl,-prebind 'USE_HEADERMAP': 'NO', 'OTHER_CFLAGS': [ diff -Nru nodejs-0.10.17/deps/uv/include/uv-private/uv-darwin.h nodejs-0.10.20/deps/uv/include/uv-private/uv-darwin.h --- nodejs-0.10.17/deps/uv/include/uv-private/uv-darwin.h 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/include/uv-private/uv-darwin.h 2013-09-30 20:52:48.000000000 +0000 @@ -36,8 +36,8 @@ #define UV_PLATFORM_LOOP_FIELDS \ uv_thread_t cf_thread; \ - void* cf_cb; \ - void* cf_loop; \ + void* _cf_reserved; \ + void* cf_state; \ uv_mutex_t cf_mutex; \ uv_sem_t cf_sem; \ ngx_queue_t cf_signals; \ @@ -47,10 +47,10 @@ char* realpath; \ int realpath_len; \ int cf_flags; \ - void* cf_eventstream; \ + void* cf_event; \ uv_async_t* cf_cb; \ - ngx_queue_t cf_events; \ - uv_sem_t cf_sem; \ + ngx_queue_t cf_member; \ + uv_sem_t _cf_reserved; \ uv_mutex_t cf_mutex; \ #define UV_STREAM_PRIVATE_PLATFORM_FIELDS \ diff -Nru nodejs-0.10.17/deps/uv/src/unix/darwin.c nodejs-0.10.20/deps/uv/src/unix/darwin.c --- nodejs-0.10.17/deps/uv/src/unix/darwin.c 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/src/unix/darwin.c 2013-09-30 20:52:48.000000000 +0000 @@ -28,8 +28,6 @@ #include #include -#include - #include #include #include /* _NSGetExecutablePath */ @@ -37,144 +35,19 @@ #include #include /* sysconf */ -/* Forward declarations */ -static void uv__cf_loop_runner(void* arg); -static void uv__cf_loop_cb(void* arg); - -typedef struct uv__cf_loop_signal_s uv__cf_loop_signal_t; -struct uv__cf_loop_signal_s { - void* arg; - cf_loop_signal_cb cb; - ngx_queue_t member; -}; - int uv__platform_loop_init(uv_loop_t* loop, int default_loop) { - CFRunLoopSourceContext ctx; - int r; + loop->cf_state = NULL; if (uv__kqueue_init(loop)) return -1; - loop->cf_loop = NULL; - if ((r = uv_mutex_init(&loop->cf_mutex))) - return r; - if ((r = uv_sem_init(&loop->cf_sem, 0))) - return r; - ngx_queue_init(&loop->cf_signals); - - memset(&ctx, 0, sizeof(ctx)); - ctx.info = loop; - ctx.perform = uv__cf_loop_cb; - loop->cf_cb = CFRunLoopSourceCreate(NULL, 0, &ctx); - - if ((r = uv_thread_create(&loop->cf_thread, uv__cf_loop_runner, loop))) - return r; - - /* Synchronize threads */ - uv_sem_wait(&loop->cf_sem); - assert(ACCESS_ONCE(CFRunLoopRef, loop->cf_loop) != NULL); - return 0; } void uv__platform_loop_delete(uv_loop_t* loop) { - ngx_queue_t* item; - uv__cf_loop_signal_t* s; - - assert(loop->cf_loop != NULL); - uv__cf_loop_signal(loop, NULL, NULL); - uv_thread_join(&loop->cf_thread); - - uv_sem_destroy(&loop->cf_sem); - uv_mutex_destroy(&loop->cf_mutex); - - /* Free any remaining data */ - while (!ngx_queue_empty(&loop->cf_signals)) { - item = ngx_queue_head(&loop->cf_signals); - - s = ngx_queue_data(item, uv__cf_loop_signal_t, member); - - ngx_queue_remove(item); - free(s); - } -} - - -static void uv__cf_loop_runner(void* arg) { - uv_loop_t* loop; - - loop = arg; - - /* Get thread's loop */ - ACCESS_ONCE(CFRunLoopRef, loop->cf_loop) = CFRunLoopGetCurrent(); - - CFRunLoopAddSource(loop->cf_loop, - loop->cf_cb, - kCFRunLoopDefaultMode); - - uv_sem_post(&loop->cf_sem); - - CFRunLoopRun(); - - CFRunLoopRemoveSource(loop->cf_loop, - loop->cf_cb, - kCFRunLoopDefaultMode); -} - - -static void uv__cf_loop_cb(void* arg) { - uv_loop_t* loop; - ngx_queue_t* item; - ngx_queue_t split_head; - uv__cf_loop_signal_t* s; - - loop = arg; - - uv_mutex_lock(&loop->cf_mutex); - ngx_queue_init(&split_head); - if (!ngx_queue_empty(&loop->cf_signals)) { - ngx_queue_t* split_pos = ngx_queue_next(&loop->cf_signals); - ngx_queue_split(&loop->cf_signals, split_pos, &split_head); - } - uv_mutex_unlock(&loop->cf_mutex); - - while (!ngx_queue_empty(&split_head)) { - item = ngx_queue_head(&split_head); - - s = ngx_queue_data(item, uv__cf_loop_signal_t, member); - - /* This was a termination signal */ - if (s->cb == NULL) - CFRunLoopStop(loop->cf_loop); - else - s->cb(s->arg); - - ngx_queue_remove(item); - free(s); - } -} - - -void uv__cf_loop_signal(uv_loop_t* loop, cf_loop_signal_cb cb, void* arg) { - uv__cf_loop_signal_t* item; - - item = malloc(sizeof(*item)); - /* XXX: Fail */ - if (item == NULL) - abort(); - - item->arg = arg; - item->cb = cb; - - uv_mutex_lock(&loop->cf_mutex); - ngx_queue_insert_tail(&loop->cf_signals, &item->member); - uv_mutex_unlock(&loop->cf_mutex); - - assert(loop->cf_loop != NULL); - CFRunLoopSourceSignal(loop->cf_cb); - CFRunLoopWakeUp(loop->cf_loop); + uv__fsevents_loop_delete(loop); } diff -Nru nodejs-0.10.17/deps/uv/src/unix/fsevents.c nodejs-0.10.20/deps/uv/src/unix/fsevents.c --- nodejs-0.10.17/deps/uv/src/unix/fsevents.c 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/src/unix/fsevents.c 2013-09-30 20:52:48.000000000 +0000 @@ -34,112 +34,149 @@ return 0; } + +void uv__fsevents_loop_delete(uv_loop_t* loop) { + return 0; +} + #else /* TARGET_OS_IPHONE */ #include #include +#include #include +/* These are macros to avoid "initializer element is not constant" errors + * with old versions of gcc. + */ +#define kFSEventsModified (kFSEventStreamEventFlagItemFinderInfoMod | \ + kFSEventStreamEventFlagItemModified | \ + kFSEventStreamEventFlagItemInodeMetaMod | \ + kFSEventStreamEventFlagItemChangeOwner | \ + kFSEventStreamEventFlagItemXattrMod) + +#define kFSEventsRenamed (kFSEventStreamEventFlagItemCreated | \ + kFSEventStreamEventFlagItemRemoved | \ + kFSEventStreamEventFlagItemRenamed) + +#define kFSEventsSystem (kFSEventStreamEventFlagUserDropped | \ + kFSEventStreamEventFlagKernelDropped | \ + kFSEventStreamEventFlagEventIdsWrapped | \ + kFSEventStreamEventFlagHistoryDone | \ + kFSEventStreamEventFlagMount | \ + kFSEventStreamEventFlagUnmount | \ + kFSEventStreamEventFlagRootChanged) + typedef struct uv__fsevents_event_s uv__fsevents_event_t; +typedef struct uv__cf_loop_signal_s uv__cf_loop_signal_t; +typedef struct uv__cf_loop_state_s uv__cf_loop_state_t; + +struct uv__cf_loop_state_s { + CFRunLoopRef loop; + CFRunLoopSourceRef signal_source; + volatile int fsevent_need_reschedule; + FSEventStreamRef fsevent_stream; + uv_sem_t fsevent_sem; + uv_mutex_t fsevent_mutex; + ngx_queue_t fsevent_handles; + int fsevent_handle_count; +}; + +struct uv__cf_loop_signal_s { + ngx_queue_t member; + uv_fs_event_t* handle; +}; struct uv__fsevents_event_s { int events; - ngx_queue_t member; + void* next; char path[1]; }; +/* Forward declarations */ +static void uv__cf_loop_cb(void* arg); +static void* uv__cf_loop_runner(void* arg); +static int uv__cf_loop_signal(uv_loop_t* loop, uv_fs_event_t* handle); -#define UV__FSEVENTS_WALK(handle, block) \ - { \ - ngx_queue_t* curr; \ - ngx_queue_t split_head; \ +#define UV__FSEVENTS_PROCESS(handle, block) \ + do { \ uv__fsevents_event_t* event; \ + uv__fsevents_event_t* next; \ uv_mutex_lock(&(handle)->cf_mutex); \ - ngx_queue_init(&split_head); \ - if (!ngx_queue_empty(&(handle)->cf_events)) { \ - ngx_queue_t* split_pos = ngx_queue_next(&(handle)->cf_events); \ - ngx_queue_split(&(handle)->cf_events, split_pos, &split_head); \ - } \ + event = (handle)->cf_event; \ + (handle)->cf_event = NULL; \ uv_mutex_unlock(&(handle)->cf_mutex); \ - while (!ngx_queue_empty(&split_head)) { \ - curr = ngx_queue_head(&split_head); \ + while (event != NULL) { \ /* Invoke callback */ \ - event = ngx_queue_data(curr, uv__fsevents_event_t, member); \ - ngx_queue_remove(curr); \ /* Invoke block code, but only if handle wasn't closed */ \ - if (((handle)->flags & (UV_CLOSING | UV_CLOSED)) == 0) \ + if (!uv__is_closing((handle))) \ block \ /* Free allocated data */ \ + next = event->next; \ free(event); \ + event = next; \ } \ - } + } while (0) -void uv__fsevents_cb(uv_async_t* cb, int status) { +/* Runs in UV loop's thread, when there're events to report to handle */ +static void uv__fsevents_cb(uv_async_t* cb, int status) { uv_fs_event_t* handle; handle = cb->data; - UV__FSEVENTS_WALK(handle, { + UV__FSEVENTS_PROCESS(handle, { if (handle->event_watcher.fd != -1) handle->cb(handle, event->path[0] ? event->path : NULL, event->events, 0); }); - if ((handle->flags & (UV_CLOSING | UV_CLOSED)) == 0 && - handle->event_watcher.fd == -1) { + if (!uv__is_closing(handle) && handle->event_watcher.fd == -1) uv__fsevents_close(handle); - } } -void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef, - void* info, - size_t numEvents, - void* eventPaths, - const FSEventStreamEventFlags eventFlags[], - const FSEventStreamEventId eventIds[]) { +/* Runs in CF thread, when there're events in FSEventStream */ +static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef, + void* info, + size_t numEvents, + void* eventPaths, + const FSEventStreamEventFlags eventFlags[], + const FSEventStreamEventId eventIds[]) { size_t i; int len; char** paths; char* path; char* pos; uv_fs_event_t* handle; + ngx_queue_t* q; + uv_loop_t* loop; + uv__cf_loop_state_t* state; uv__fsevents_event_t* event; - ngx_queue_t add_list; - int kFSEventsModified; - int kFSEventsRenamed; - - kFSEventsModified = kFSEventStreamEventFlagItemFinderInfoMod | - kFSEventStreamEventFlagItemModified | - kFSEventStreamEventFlagItemInodeMetaMod | - kFSEventStreamEventFlagItemChangeOwner | - kFSEventStreamEventFlagItemXattrMod; - kFSEventsRenamed = kFSEventStreamEventFlagItemCreated | - kFSEventStreamEventFlagItemRemoved | - kFSEventStreamEventFlagItemRenamed; + uv__fsevents_event_t* tail; - handle = info; + loop = info; + state = loop->cf_state; + assert(state != NULL); paths = eventPaths; - ngx_queue_init(&add_list); - - for (i = 0; i < numEvents; i++) { - /* Ignore system events */ - if (eventFlags[i] & (kFSEventStreamEventFlagUserDropped | - kFSEventStreamEventFlagKernelDropped | - kFSEventStreamEventFlagEventIdsWrapped | - kFSEventStreamEventFlagHistoryDone | - kFSEventStreamEventFlagMount | - kFSEventStreamEventFlagUnmount | - kFSEventStreamEventFlagRootChanged)) { - continue; - } - /* TODO: Report errors */ - path = paths[i]; - len = strlen(path); + /* For each handle */ + ngx_queue_foreach(q, &state->fsevent_handles) { + handle = ngx_queue_data(q, uv_fs_event_t, cf_member); + tail = NULL; + + /* Process and filter out events */ + for (i = 0; i < numEvents; i++) { + /* Ignore system events */ + if (eventFlags[i] & kFSEventsSystem) + continue; + + path = paths[i]; + len = strlen(path); + + /* Filter out paths that are outside handle's request */ + if (strncmp(path, handle->realpath, handle->realpath_len) != 0) + continue; - /* Remove absolute path prefix */ - if (strstr(path, handle->realpath) == path) { path += handle->realpath_len; len -= handle->realpath_len; @@ -148,91 +185,81 @@ path++; len--; } - } #ifdef MAC_OS_X_VERSION_10_7 - /* Ignore events with path equal to directory itself */ - if (len == 0) - continue; + /* Ignore events with path equal to directory itself */ + if (len == 0) + continue; #endif /* MAC_OS_X_VERSION_10_7 */ - /* Do not emit events from subdirectories (without option set) */ - pos = strchr(path, '/'); - if ((handle->cf_flags & UV_FS_EVENT_RECURSIVE) == 0 && - pos != NULL && - pos != path + 1) - continue; + /* Do not emit events from subdirectories (without option set) */ + if ((handle->cf_flags & UV_FS_EVENT_RECURSIVE) == 0) { + pos = strchr(path, '/'); + if (pos != NULL && pos != path + 1) + continue; + } #ifndef MAC_OS_X_VERSION_10_7 - path = ""; - len = 0; + path = ""; + len = 0; #endif /* MAC_OS_X_VERSION_10_7 */ - event = malloc(sizeof(*event) + len); - if (event == NULL) - break; - - memcpy(event->path, path, len + 1); - - if ((eventFlags[i] & kFSEventsModified) != 0 && - (eventFlags[i] & kFSEventsRenamed) == 0) - event->events = UV_CHANGE; - else - event->events = UV_RENAME; - - ngx_queue_insert_tail(&add_list, &event->member); - } - uv_mutex_lock(&handle->cf_mutex); - ngx_queue_add(&handle->cf_events, &add_list); - uv_mutex_unlock(&handle->cf_mutex); - - uv_async_send(handle->cf_cb); -} - + event = malloc(sizeof(*event) + len); + if (event == NULL) + break; + + memset(event, 0, sizeof(*event)); + memcpy(event->path, path, len + 1); + + if ((eventFlags[i] & kFSEventsModified) != 0 && + (eventFlags[i] & kFSEventsRenamed) == 0) + event->events = UV_CHANGE; + else + event->events = UV_RENAME; + + if (tail != NULL) + tail->next = event; + tail = event; + } -void uv__fsevents_schedule(void* arg) { - uv_fs_event_t* handle; + if (tail != NULL) { + uv_mutex_lock(&handle->cf_mutex); + tail->next = handle->cf_event; + handle->cf_event = tail; + uv_mutex_unlock(&handle->cf_mutex); - handle = arg; - FSEventStreamScheduleWithRunLoop(handle->cf_eventstream, - handle->loop->cf_loop, - kCFRunLoopDefaultMode); - FSEventStreamStart(handle->cf_eventstream); - uv_sem_post(&handle->cf_sem); + uv_async_send(handle->cf_cb); + } + } } -int uv__fsevents_init(uv_fs_event_t* handle) { +/* Runs in CF thread */ +static void uv__fsevents_create_stream(uv_loop_t* loop, CFArrayRef paths) { + uv__cf_loop_state_t* state; FSEventStreamContext ctx; FSEventStreamRef ref; - CFStringRef path; - CFArrayRef paths; CFAbsoluteTime latency; FSEventStreamCreateFlags flags; /* Initialize context */ ctx.version = 0; - ctx.info = handle; + ctx.info = loop; ctx.retain = NULL; ctx.release = NULL; ctx.copyDescription = NULL; - /* Get absolute path to file */ - handle->realpath = realpath(handle->filename, NULL); - if (handle->realpath != NULL) - handle->realpath_len = strlen(handle->realpath); - - /* Initialize paths array */ - path = CFStringCreateWithCString(NULL, - handle->filename, - CFStringGetSystemEncoding()); - paths = CFArrayCreate(NULL, (const void**)&path, 1, NULL); - latency = 0.15; /* Set appropriate flags */ flags = kFSEventStreamCreateFlagFileEvents; + /* + * NOTE: It might sound like a good idea to remember last seen StreamEventId, + * but in reality one dir might have last StreamEventId less than, the other, + * that is being watched now. Which will cause FSEventStream API to report + * changes to files from the past. + */ ref = FSEventStreamCreate(NULL, &uv__fsevents_event_cb, &ctx, @@ -240,55 +267,419 @@ kFSEventStreamEventIdSinceNow, latency, flags); - handle->cf_eventstream = ref; + assert(ref != NULL); + + state = loop->cf_state; + FSEventStreamScheduleWithRunLoop(ref, + state->loop, + kCFRunLoopDefaultMode); + if (!FSEventStreamStart(ref)) + abort(); + + state->fsevent_stream = ref; +} + + +/* Runs in CF thread */ +static void uv__fsevents_destroy_stream(uv_loop_t* loop) { + uv__cf_loop_state_t* state; + + state = loop->cf_state; + + if (state->fsevent_stream == NULL) + return; + + /* Flush all accumulated events */ + FSEventStreamFlushSync(state->fsevent_stream); + + /* Stop emitting events */ + FSEventStreamStop(state->fsevent_stream); + + /* Release stream */ + FSEventStreamInvalidate(state->fsevent_stream); + FSEventStreamRelease(state->fsevent_stream); + state->fsevent_stream = NULL; +} + + +/* Runs in CF thread, when there're new fsevent handles to add to stream */ +static void uv__fsevents_reschedule(uv_fs_event_t* handle) { + uv__cf_loop_state_t* state; + ngx_queue_t* q; + uv_fs_event_t* curr; + CFArrayRef cf_paths; + CFStringRef* paths; + int i; + int path_count; + + state = handle->loop->cf_state; + + /* Optimization to prevent O(n^2) time spent when starting to watch + * many files simultaneously + */ + if (!state->fsevent_need_reschedule) + return; + state->fsevent_need_reschedule = 0; + + /* Destroy previous FSEventStream */ + uv__fsevents_destroy_stream(handle->loop); + + /* Create list of all watched paths */ + uv_mutex_lock(&state->fsevent_mutex); + path_count = state->fsevent_handle_count; + if (path_count != 0) { + paths = malloc(sizeof(*paths) * path_count); + if (paths == NULL) + abort(); + + q = &state->fsevent_handles; + for (i = 0; i < path_count; i++) { + q = ngx_queue_next(q); + assert(q != &state->fsevent_handles); + curr = ngx_queue_data(q, uv_fs_event_t, cf_member); + + assert(curr->realpath != NULL); + paths[i] = CFStringCreateWithCString(NULL, + curr->realpath, + CFStringGetSystemEncoding()); + if (paths[i] == NULL) + abort(); + } + } + uv_mutex_unlock(&state->fsevent_mutex); + + if (path_count != 0) { + /* Create new FSEventStream */ + cf_paths = CFArrayCreate(NULL, (const void**) paths, path_count, NULL); + if (cf_paths == NULL) + abort(); + uv__fsevents_create_stream(handle->loop, cf_paths); + } + + /* + * Main thread will block until the removal of handle from the list, + * we must tell it when we're ready. + * + * NOTE: This is coupled with `uv_sem_wait()` in `uv__fsevents_close` + */ + if (uv__is_closing(handle)) + uv_sem_post(&state->fsevent_sem); +} + + +/* Runs in UV loop */ +static int uv__fsevents_loop_init(uv_loop_t* loop) { + CFRunLoopSourceContext ctx; + uv__cf_loop_state_t* state; + pthread_attr_t attr_storage; + pthread_attr_t* attr; + int err; + + if (loop->cf_state != NULL) + return 0; + + state = calloc(1, sizeof(*state)); + if (state == NULL) + return -ENOMEM; + + err = uv_mutex_init(&loop->cf_mutex); + if (err) + return err; + + err = uv_sem_init(&loop->cf_sem, 0); + if (err) + goto fail_sem_init; + + ngx_queue_init(&loop->cf_signals); + + err = uv_sem_init(&state->fsevent_sem, 0); + if (err) + goto fail_fsevent_sem_init; + + err = uv_mutex_init(&state->fsevent_mutex); + if (err) + goto fail_fsevent_mutex_init; + + ngx_queue_init(&state->fsevent_handles); + state->fsevent_need_reschedule = 0; + state->fsevent_handle_count = 0; + + memset(&ctx, 0, sizeof(ctx)); + ctx.info = loop; + ctx.perform = uv__cf_loop_cb; + state->signal_source = CFRunLoopSourceCreate(NULL, 0, &ctx); + if (state->signal_source == NULL) { + err = -ENOMEM; + goto fail_signal_source_create; + } + + /* In the unlikely event that pthread_attr_init() fails, create the thread + * with the default stack size. We'll use a little more address space but + * that in itself is not a fatal error. + */ + attr = &attr_storage; + if (pthread_attr_init(attr)) + attr = NULL; + + if (attr != NULL) + if (pthread_attr_setstacksize(attr, 3 * PTHREAD_STACK_MIN)) + abort(); + + loop->cf_state = state; + + /* uv_thread_t is an alias for pthread_t. */ + err = -pthread_create(&loop->cf_thread, attr, uv__cf_loop_runner, loop); + + if (attr != NULL) + pthread_attr_destroy(attr); + + if (err) + goto fail_thread_create; + + /* Synchronize threads */ + uv_sem_wait(&loop->cf_sem); + return 0; + +fail_thread_create: + loop->cf_state = NULL; + +fail_signal_source_create: + uv_mutex_destroy(&state->fsevent_mutex); + +fail_fsevent_mutex_init: + uv_sem_destroy(&state->fsevent_sem); + +fail_fsevent_sem_init: + uv_sem_destroy(&loop->cf_sem); + +fail_sem_init: + uv_mutex_destroy(&loop->cf_mutex); + free(state); + return err; +} + + +/* Runs in UV loop */ +void uv__fsevents_loop_delete(uv_loop_t* loop) { + uv__cf_loop_signal_t* s; + uv__cf_loop_state_t* state; + ngx_queue_t* q; + + if (loop->cf_state == NULL) + return; + + if (uv__cf_loop_signal(loop, NULL) != 0) + abort(); + + uv_thread_join(&loop->cf_thread); + uv_sem_destroy(&loop->cf_sem); + uv_mutex_destroy(&loop->cf_mutex); + + /* Free any remaining data */ + while (!ngx_queue_empty(&loop->cf_signals)) { + q = ngx_queue_head(&loop->cf_signals); + s = ngx_queue_data(q, uv__cf_loop_signal_t, member); + ngx_queue_remove(q); + free(s); + } + + /* Destroy state */ + state = loop->cf_state; + uv_sem_destroy(&state->fsevent_sem); + uv_mutex_destroy(&state->fsevent_mutex); + CFRelease(state->signal_source); + free(state); + loop->cf_state = NULL; +} + + +/* Runs in CF thread. This is the CF loop's body */ +static void* uv__cf_loop_runner(void* arg) { + uv_loop_t* loop; + uv__cf_loop_state_t* state; + + loop = arg; + state = loop->cf_state; + state->loop = CFRunLoopGetCurrent(); + + CFRunLoopAddSource(state->loop, + state->signal_source, + kCFRunLoopDefaultMode); + + uv_sem_post(&loop->cf_sem); + + CFRunLoopRun(); + CFRunLoopRemoveSource(state->loop, + state->signal_source, + kCFRunLoopDefaultMode); + + return NULL; +} + + +/* Runs in CF thread, executed after `uv__cf_loop_signal()` */ +static void uv__cf_loop_cb(void* arg) { + uv_loop_t* loop; + uv__cf_loop_state_t* state; + ngx_queue_t* item; + ngx_queue_t split_head; + uv__cf_loop_signal_t* s; + + loop = arg; + state = loop->cf_state; + ngx_queue_init(&split_head); + + uv_mutex_lock(&loop->cf_mutex); + if (!ngx_queue_empty(&loop->cf_signals)) { + ngx_queue_t* split_pos = ngx_queue_head(&loop->cf_signals); + ngx_queue_split(&loop->cf_signals, split_pos, &split_head); + } + uv_mutex_unlock(&loop->cf_mutex); + + while (!ngx_queue_empty(&split_head)) { + item = ngx_queue_head(&split_head); + + s = ngx_queue_data(item, uv__cf_loop_signal_t, member); + + /* This was a termination signal */ + if (s->handle == NULL) + CFRunLoopStop(state->loop); + else + uv__fsevents_reschedule(s->handle); + + ngx_queue_remove(item); + free(s); + } +} + + +/* Runs in UV loop to notify CF thread */ +int uv__cf_loop_signal(uv_loop_t* loop, uv_fs_event_t* handle) { + uv__cf_loop_signal_t* item; + uv__cf_loop_state_t* state; + + item = malloc(sizeof(*item)); + if (item == NULL) + return -ENOMEM; + + item->handle = handle; + + uv_mutex_lock(&loop->cf_mutex); + ngx_queue_insert_tail(&loop->cf_signals, &item->member); + uv_mutex_unlock(&loop->cf_mutex); + + state = loop->cf_state; + assert(state != NULL); + CFRunLoopSourceSignal(state->signal_source); + CFRunLoopWakeUp(state->loop); + + return 0; +} + + +/* Runs in UV loop to initialize handle */ +int uv__fsevents_init(uv_fs_event_t* handle) { + int err; + uv__cf_loop_state_t* state; + + err = uv__fsevents_loop_init(handle->loop); + if (err) + return err; + + /* Get absolute path to file */ + handle->realpath = realpath(handle->filename, NULL); + if (handle->realpath == NULL) + return -errno; + handle->realpath_len = strlen(handle->realpath); + + /* Initialize singly-linked list */ + handle->cf_event = NULL; /* * Events will occur in other thread. * Initialize callback for getting them back into event loop's thread */ handle->cf_cb = malloc(sizeof(*handle->cf_cb)); - if (handle->cf_cb == NULL) - return uv__set_sys_error(handle->loop, ENOMEM); + if (handle->cf_cb == NULL) { + err = uv__set_sys_error(handle->loop, ENOMEM); + goto fail_cf_cb_malloc; + } handle->cf_cb->data = handle; uv_async_init(handle->loop, handle->cf_cb, uv__fsevents_cb); handle->cf_cb->flags |= UV__HANDLE_INTERNAL; uv_unref((uv_handle_t*) handle->cf_cb); - uv_mutex_init(&handle->cf_mutex); - uv_sem_init(&handle->cf_sem, 0); - ngx_queue_init(&handle->cf_events); - - uv__cf_loop_signal(handle->loop, uv__fsevents_schedule, handle); + err = uv_mutex_init(&handle->cf_mutex); + if (err) + goto fail_cf_mutex_init; + + /* Insert handle into the list */ + state = handle->loop->cf_state; + uv_mutex_lock(&state->fsevent_mutex); + ngx_queue_insert_tail(&state->fsevent_handles, &handle->cf_member); + state->fsevent_handle_count++; + state->fsevent_need_reschedule = 1; + uv_mutex_unlock(&state->fsevent_mutex); + + /* Reschedule FSEventStream */ + assert(handle != NULL); + err = uv__cf_loop_signal(handle->loop, handle); + if (err) + goto fail_loop_signal; return 0; + +fail_loop_signal: + uv_mutex_destroy(&handle->cf_mutex); + +fail_cf_mutex_init: + free(handle->cf_cb); + handle->cf_cb = NULL; + +fail_cf_cb_malloc: + free(handle->realpath); + handle->realpath = NULL; + handle->realpath_len = 0; + + return err; } +/* Runs in UV loop to de-initialize handle */ int uv__fsevents_close(uv_fs_event_t* handle) { - if (handle->cf_eventstream == NULL) - return -1; + int err; + uv__cf_loop_state_t* state; - /* Ensure that event stream was scheduled */ - uv_sem_wait(&handle->cf_sem); + if (handle->cf_cb == NULL) + return -EINVAL; - /* Stop emitting events */ - FSEventStreamStop(handle->cf_eventstream); + /* Remove handle from the list */ + state = handle->loop->cf_state; + uv_mutex_lock(&state->fsevent_mutex); + ngx_queue_remove(&handle->cf_member); + state->fsevent_handle_count--; + state->fsevent_need_reschedule = 1; + uv_mutex_unlock(&state->fsevent_mutex); + + /* Reschedule FSEventStream */ + assert(handle != NULL); + err = uv__cf_loop_signal(handle->loop, handle); + if (err) + return -err; - /* Release stream */ - FSEventStreamInvalidate(handle->cf_eventstream); - FSEventStreamRelease(handle->cf_eventstream); - handle->cf_eventstream = NULL; + /* Wait for deinitialization */ + uv_sem_wait(&state->fsevent_sem); uv_close((uv_handle_t*) handle->cf_cb, (uv_close_cb) free); + handle->cf_cb = NULL; /* Free data in queue */ - UV__FSEVENTS_WALK(handle, { + UV__FSEVENTS_PROCESS(handle, { /* NOP */ - }) + }); uv_mutex_destroy(&handle->cf_mutex); - uv_sem_destroy(&handle->cf_sem); free(handle->realpath); handle->realpath = NULL; handle->realpath_len = 0; diff -Nru nodejs-0.10.17/deps/uv/src/unix/internal.h nodejs-0.10.20/deps/uv/src/unix/internal.h --- nodejs-0.10.17/deps/uv/src/unix/internal.h 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/src/unix/internal.h 2013-09-30 20:52:48.000000000 +0000 @@ -216,12 +216,10 @@ int uv__make_pipe(int fds[2], int flags); #if defined(__APPLE__) -typedef void (*cf_loop_signal_cb)(void*); - -void uv__cf_loop_signal(uv_loop_t* loop, cf_loop_signal_cb cb, void* arg); int uv__fsevents_init(uv_fs_event_t* handle); int uv__fsevents_close(uv_fs_event_t* handle); +void uv__fsevents_loop_delete(uv_loop_t* loop); /* OSX < 10.7 has no file events, polyfill them */ #ifndef MAC_OS_X_VERSION_10_7 diff -Nru nodejs-0.10.17/deps/uv/src/unix/kqueue.c nodejs-0.10.20/deps/uv/src/unix/kqueue.c --- nodejs-0.10.17/deps/uv/src/unix/kqueue.c 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/src/unix/kqueue.c 2013-09-30 20:52:48.000000000 +0000 @@ -307,7 +307,7 @@ #if defined(__APPLE__) /* Nullify field to perform checks later */ - handle->cf_eventstream = NULL; + handle->cf_cb = NULL; handle->realpath = NULL; handle->realpath_len = 0; handle->cf_flags = flags; diff -Nru nodejs-0.10.17/deps/uv/src/version.c nodejs-0.10.20/deps/uv/src/version.c --- nodejs-0.10.17/deps/uv/src/version.c 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/src/version.c 2013-09-30 20:52:48.000000000 +0000 @@ -34,7 +34,7 @@ #define UV_VERSION_MAJOR 0 #define UV_VERSION_MINOR 10 -#define UV_VERSION_PATCH 14 +#define UV_VERSION_PATCH 17 #define UV_VERSION_IS_RELEASE 1 diff -Nru nodejs-0.10.17/deps/uv/src/win/fs.c nodejs-0.10.20/deps/uv/src/win/fs.c --- nodejs-0.10.17/deps/uv/src/win/fs.c 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/src/win/fs.c 2013-09-30 20:52:48.000000000 +0000 @@ -41,33 +41,41 @@ #define QUEUE_FS_TP_JOB(loop, req) \ - if (!QueueUserWorkItem(&uv_fs_thread_proc, \ - req, \ - WT_EXECUTEDEFAULT)) { \ - uv__set_sys_error((loop), GetLastError()); \ - return -1; \ - } \ - uv__req_register(loop, req); + do { \ + if (!QueueUserWorkItem(&uv_fs_thread_proc, \ + req, \ + WT_EXECUTEDEFAULT)) { \ + uv__set_sys_error((loop), GetLastError()); \ + return -1; \ + } \ + uv__req_register(loop, req); \ + } while (0) #define SET_UV_LAST_ERROR_FROM_REQ(req) \ - uv__set_error(req->loop, req->errorno, req->sys_errno_); + uv__set_error(req->loop, req->errorno, req->sys_errno_) #define SET_REQ_RESULT(req, result_value) \ - req->result = (result_value); \ - if (req->result == -1) { \ - req->sys_errno_ = _doserrno; \ - req->errorno = uv_translate_sys_error(req->sys_errno_); \ - } + do { \ + req->result = (result_value); \ + if (req->result == -1) { \ + req->sys_errno_ = _doserrno; \ + req->errorno = uv_translate_sys_error(req->sys_errno_); \ + } \ + } while (0) #define SET_REQ_WIN32_ERROR(req, sys_errno) \ - req->result = -1; \ - req->sys_errno_ = (sys_errno); \ - req->errorno = uv_translate_sys_error(req->sys_errno_); + do { \ + req->result = -1; \ + req->sys_errno_ = (sys_errno); \ + req->errorno = uv_translate_sys_error(req->sys_errno_); \ + } while (0) #define SET_REQ_UV_ERROR(req, uv_errno, sys_errno) \ - req->result = -1; \ - req->sys_errno_ = (sys_errno); \ - req->errorno = (uv_errno); + do { \ + req->result = -1; \ + req->sys_errno_ = (sys_errno); \ + req->errorno = (uv_errno); \ + } while (0) #define VERIFY_FD(fd, req) \ if (fd == -1) { \ @@ -78,7 +86,7 @@ } #define FILETIME_TO_TIME_T(filetime) \ - ((*((uint64_t*) &(filetime)) - 116444736000000000ULL) / 10000000ULL); + ((*((uint64_t*) &(filetime)) - 116444736000000000ULL) / 10000000ULL) #define TIME_T_TO_FILETIME(time, filetime_ptr) \ do { \ @@ -392,7 +400,7 @@ DWORD disposition; DWORD attributes = 0; HANDLE file; - int result, current_umask; + int fd, current_umask; int flags = req->file_flags; /* Obtain the active umask. umask() never fails and returns the previous */ @@ -413,8 +421,7 @@ access = FILE_GENERIC_READ | FILE_GENERIC_WRITE; break; default: - result = -1; - goto end; + goto einval; } if (flags & _O_APPEND) { @@ -451,8 +458,7 @@ disposition = CREATE_ALWAYS; break; default: - result = -1; - goto end; + goto einval; } attributes |= FILE_ATTRIBUTE_NORMAL; @@ -481,8 +487,7 @@ attributes |= FILE_FLAG_RANDOM_ACCESS; break; default: - result = -1; - goto end; + goto einval; } /* Setting this flag makes it possible to open a directory. */ @@ -507,11 +512,30 @@ } return; } - result = _open_osfhandle((intptr_t) file, flags); -end: - SET_REQ_RESULT(req, result); + + fd = _open_osfhandle((intptr_t) file, flags); + if (fd < 0) { + /* The only known failure mode for _open_osfhandle() is EMFILE, in which + * case GetLastError() will return zero. However we'll try to handle other + * errors as well, should they ever occur. + */ + if (errno == EMFILE) + SET_REQ_UV_ERROR(req, UV_EMFILE, ERROR_TOO_MANY_OPEN_FILES); + else if (GetLastError() != ERROR_SUCCESS) + SET_REQ_WIN32_ERROR(req, GetLastError()); + else + SET_REQ_WIN32_ERROR(req, UV_UNKNOWN); + return; + } + + SET_REQ_RESULT(req, fd); + return; + + einval: + SET_REQ_UV_ERROR(req, UV_EINVAL, ERROR_INVALID_PARAMETER); } + void fs__close(uv_fs_t* req) { int fd = req->fd; int result; @@ -1062,7 +1086,6 @@ static void fs__fchmod(uv_fs_t* req) { int fd = req->fd; - int result; HANDLE handle; NTSTATUS nt_status; IO_STATUS_BLOCK io_status; @@ -1070,7 +1093,7 @@ VERIFY_FD(fd, req); - handle = (HANDLE)_get_osfhandle(fd); + handle = (HANDLE) _get_osfhandle(fd); nt_status = pNtQueryInformationFile(handle, &io_status, @@ -1078,9 +1101,9 @@ sizeof file_info, FileBasicInformation); - if (nt_status != STATUS_SUCCESS) { - result = -1; - goto done; + if (!NT_SUCCESS(nt_status)) { + SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(nt_status)); + return; } if (req->mode & _S_IWRITE) { @@ -1095,15 +1118,12 @@ sizeof file_info, FileBasicInformation); - if (nt_status != STATUS_SUCCESS) { - result = -1; - goto done; + if (!NT_SUCCESS(nt_status)) { + SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(nt_status)); + return; } - result = 0; - -done: - SET_REQ_RESULT(req, result); + SET_REQ_SUCCESS(req); } diff -Nru nodejs-0.10.17/deps/uv/src/win/pipe.c nodejs-0.10.20/deps/uv/src/win/pipe.c --- nodejs-0.10.17/deps/uv/src/win/pipe.c 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/src/win/pipe.c 2013-09-30 20:52:48.000000000 +0000 @@ -1528,9 +1528,9 @@ UNREGISTER_HANDLE_REQ(loop, handle, req); - /* Initialize and optionally start the eof timer. */ - /* This makes no sense if we've already seen EOF. */ if (handle->flags & UV_HANDLE_READABLE) { + /* Initialize and optionally start the eof timer. Only do this if the */ + /* pipe is readable and we haven't seen EOF come in ourselves. */ eof_timer_init(handle); /* If reading start the timer right now. */ @@ -1538,6 +1538,12 @@ if (handle->flags & UV_HANDLE_READ_PENDING) { eof_timer_start(handle); } + + } else { + /* This pipe is not readable. We can just close it to let the other end */ + /* know that we're done writing. */ + CloseHandle(handle->handle); + handle->handle = INVALID_HANDLE_VALUE; } if (req->cb) { diff -Nru nodejs-0.10.17/deps/uv/src/win/process-stdio.c nodejs-0.10.20/deps/uv/src/win/process-stdio.c --- nodejs-0.10.17/deps/uv/src/win/process-stdio.c 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/deps/uv/src/win/process-stdio.c 2013-09-30 20:52:48.000000000 +0000 @@ -104,12 +104,16 @@ uv_err_t err; if (flags & UV_READABLE_PIPE) { - server_access |= PIPE_ACCESS_OUTBOUND; + /* The server needs inbound access too, otherwise CreateNamedPipe() */ + /* won't give us the FILE_READ_ATTRIBUTES permission. We need that to */ + /* probe the state of the write buffer when we're trying to shutdown */ + /* the pipe. */ + server_access |= PIPE_ACCESS_OUTBOUND | PIPE_ACCESS_INBOUND; client_access |= GENERIC_READ | FILE_WRITE_ATTRIBUTES; } if (flags & UV_WRITABLE_PIPE) { server_access |= PIPE_ACCESS_INBOUND; - client_access |= GENERIC_WRITE; + client_access |= GENERIC_WRITE | FILE_READ_ATTRIBUTES; } /* Create server pipe handle. */ @@ -163,8 +167,11 @@ } } - /* The server end is now readable and writable. */ - server_pipe->flags |= UV_HANDLE_READABLE | UV_HANDLE_WRITABLE; + /* The server end is now readable and/or writable. */ + if (flags & UV_READABLE_PIPE) + server_pipe->flags |= UV_HANDLE_WRITABLE; + if (flags & UV_WRITABLE_PIPE) + server_pipe->flags |= UV_HANDLE_READABLE; *child_pipe_ptr = child_pipe; return uv_ok_; diff -Nru nodejs-0.10.17/doc/api/_toc.html nodejs-0.10.20/doc/api/_toc.html --- nodejs-0.10.17/doc/api/_toc.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/_toc.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Node.js v0.10.17 Manual & Documentation + Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
-

Node.js v0.10.17 Manual & Documentation

+

Node.js v0.10.20 Manual & Documentation

Index | @@ -105,7 +105,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/addons.html nodejs-0.10.20/doc/api/addons.html --- nodejs-0.10.17/doc/api/addons.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/addons.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Addons Node.js v0.10.17 Manual & Documentation + Addons Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -715,7 +715,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/all.html nodejs-0.10.20/doc/api/all.html --- nodejs-0.10.17/doc/api/all.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/all.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - About this Documentation Node.js v0.10.17 Manual & Documentation + About this Documentation Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -2645,10 +2645,10 @@

    Signal Events#

    - +

    Emitted when the processes receives a signal. See sigaction(2) for a list of -standard POSIX signal names such as SIGINT, SIGUSR1, etc. +standard POSIX signal names such as SIGINT, SIGHUP, etc.

    Example of listening for SIGINT: @@ -2663,6 +2663,9 @@

    An easy way to send the SIGINT signal is with Control-C in most terminal programs. +

    +

    Note: SIGUSR1 is reserved by node.js to kickstart the debugger. It's possible +to install a listener but that won't stop the debugger from starting.

    process.stdout#

    @@ -2969,7 +2972,7 @@

    process.kill(pid, [signal])#

    Send a signal to a process. pid is the process id and signal is the string describing the signal to send. Signal names are strings like -'SIGINT' or 'SIGUSR1'. If omitted, the signal will be 'SIGTERM'. +'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'. See kill(2) for more information.

    @@ -2991,6 +2994,10 @@ }, 100); process.kill(process.pid, 'SIGHUP'); +

    Note: SIGUSR1 is reserved by node.js. It can be used to kickstart the +debugger. + +

    process.pid#

    The PID of the process. @@ -3168,7 +3175,7 @@ // benchmark took 1000000527 nanoseconds }, 1000);

    util#

    -
    Stability: 5 - Locked

    These functions are in the module 'util'. Use require('util') to access +

    Stability: 4 - API Frozen

    These functions are in the module 'util'. Use require('util') to access them. @@ -5218,7 +5225,7 @@

    Event: 'drain'#

    -

    If a [writable.write(chunk)][] call returns false, then the drain +

    If a writable.write(chunk) call returns false, then the drain event will indicate when it is appropriate to begin writing more data to the stream. @@ -6215,8 +6222,6 @@

    -

    [writable.write(chunk)] -

    Crypto#

    Stability: 2 - Unstable; API changes are being discussed for
     future versions.  Breaking changes will be minimized.  See below.

    Use require('crypto') to access this module. @@ -6885,9 +6890,9 @@

  • cert: A string or Buffer containing the certificate key of the server in PEM format. (Required)

  • -
  • ca: An array of strings or Buffers of trusted certificates. If this is -omitted several well known "root" CAs will be used, like VeriSign. -These are used to authorize connections.

    +
  • ca: An array of strings or Buffers of trusted certificates in PEM +format. If this is omitted several well known "root" CAs will be used, +like VeriSign. These are used to authorize connections.

  • crl : Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List)

    @@ -7041,16 +7046,16 @@
  • cert: A string or Buffer containing the certificate key of the client in PEM format.

  • -
  • ca: An array of strings or Buffers of trusted certificates. If this is -omitted several well known "root" CAs will be used, like VeriSign. -These are used to authorize connections.

    +
  • ca: An array of strings or Buffers of trusted certificates in PEM +format. If this is omitted several well known "root" CAs will be used, +like VeriSign. These are used to authorize connections.

  • rejectUnauthorized: If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Default: true.

  • -
  • NPNProtocols: An array of string or Buffer containing supported NPN -protocols. Buffer should have following format: 0x05hello0x05world, +

  • NPNProtocols: An array of strings or Buffers containing supported NPN +protocols. Buffers should have following format: 0x05hello0x05world, where first byte is next protocol name's length. (Passing array should usually be much simpler: ['hello', 'world'].)

  • @@ -13468,7 +13473,7 @@
  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/all.json nodejs-0.10.20/doc/api/all.json --- nodejs-0.10.17/doc/api/all.json 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/all.json 2013-09-30 21:56:36.000000000 +0000 @@ -257,9 +257,9 @@ }, { "textRaw": "Signal Events", - "name": "SIGINT, SIGUSR1, etc.", + "name": "SIGINT, SIGHUP, etc.", "type": "event", - "desc": "

    Emitted when the processes receives a signal. See sigaction(2) for a list of\nstandard POSIX signal names such as SIGINT, SIGUSR1, etc.\n\n

    \n

    Example of listening for SIGINT:\n\n

    \n
    // Start reading from stdin so we don't exit.\nprocess.stdin.resume();\n\nprocess.on('SIGINT', function() {\n  console.log('Got SIGINT.  Press Control-D to exit.');\n});
    \n

    An easy way to send the SIGINT signal is with Control-C in most terminal\nprograms.\n\n\n

    \n", + "desc": "

    Emitted when the processes receives a signal. See sigaction(2) for a list of\nstandard POSIX signal names such as SIGINT, SIGHUP, etc.\n\n

    \n

    Example of listening for SIGINT:\n\n

    \n
    // Start reading from stdin so we don't exit.\nprocess.stdin.resume();\n\nprocess.on('SIGINT', function() {\n  console.log('Got SIGINT.  Press Control-D to exit.');\n});
    \n

    An easy way to send the SIGINT signal is with Control-C in most terminal\nprograms.\n\n

    \n

    Note: SIGUSR1 is reserved by node.js to kickstart the debugger. It's possible\nto install a listener but that won't stop the debugger from starting.\n\n

    \n", "params": [] } ], @@ -495,7 +495,7 @@ "textRaw": "process.kill(pid, [signal])", "type": "method", "name": "kill", - "desc": "

    Send a signal to a process. pid is the process id and signal is the\nstring describing the signal to send. Signal names are strings like\n'SIGINT' or 'SIGUSR1'. If omitted, the signal will be 'SIGTERM'.\nSee kill(2) for more information.\n\n

    \n

    Note that just because the name of this function is process.kill, it is\nreally just a signal sender, like the kill system call. The signal sent\nmay do something other than kill the target process.\n\n

    \n

    Example of sending a signal to yourself:\n\n

    \n
    process.on('SIGHUP', function() {\n  console.log('Got SIGHUP signal.');\n});\n\nsetTimeout(function() {\n  console.log('Exiting.');\n  process.exit(0);\n}, 100);\n\nprocess.kill(process.pid, 'SIGHUP');
    \n", + "desc": "

    Send a signal to a process. pid is the process id and signal is the\nstring describing the signal to send. Signal names are strings like\n'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'.\nSee kill(2) for more information.\n\n

    \n

    Note that just because the name of this function is process.kill, it is\nreally just a signal sender, like the kill system call. The signal sent\nmay do something other than kill the target process.\n\n

    \n

    Example of sending a signal to yourself:\n\n

    \n
    process.on('SIGHUP', function() {\n  console.log('Got SIGHUP signal.');\n});\n\nsetTimeout(function() {\n  console.log('Exiting.');\n  process.exit(0);\n}, 100);\n\nprocess.kill(process.pid, 'SIGHUP');
    \n

    Note: SIGUSR1 is reserved by node.js. It can be used to kickstart the\ndebugger.\n\n

    \n", "signatures": [ { "params": [ @@ -971,9 +971,9 @@ }, { "textRaw": "Signal Events", - "name": "SIGINT, SIGUSR1, etc.", + "name": "SIGINT, SIGHUP, etc.", "type": "event", - "desc": "

    Emitted when the processes receives a signal. See sigaction(2) for a list of\nstandard POSIX signal names such as SIGINT, SIGUSR1, etc.\n\n

    \n

    Example of listening for SIGINT:\n\n

    \n
    // Start reading from stdin so we don't exit.\nprocess.stdin.resume();\n\nprocess.on('SIGINT', function() {\n  console.log('Got SIGINT.  Press Control-D to exit.');\n});
    \n

    An easy way to send the SIGINT signal is with Control-C in most terminal\nprograms.\n\n\n

    \n", + "desc": "

    Emitted when the processes receives a signal. See sigaction(2) for a list of\nstandard POSIX signal names such as SIGINT, SIGHUP, etc.\n\n

    \n

    Example of listening for SIGINT:\n\n

    \n
    // Start reading from stdin so we don't exit.\nprocess.stdin.resume();\n\nprocess.on('SIGINT', function() {\n  console.log('Got SIGINT.  Press Control-D to exit.');\n});
    \n

    An easy way to send the SIGINT signal is with Control-C in most terminal\nprograms.\n\n

    \n

    Note: SIGUSR1 is reserved by node.js to kickstart the debugger. It's possible\nto install a listener but that won't stop the debugger from starting.\n\n

    \n", "params": [] } ], @@ -1209,7 +1209,7 @@ "textRaw": "process.kill(pid, [signal])", "type": "method", "name": "kill", - "desc": "

    Send a signal to a process. pid is the process id and signal is the\nstring describing the signal to send. Signal names are strings like\n'SIGINT' or 'SIGUSR1'. If omitted, the signal will be 'SIGTERM'.\nSee kill(2) for more information.\n\n

    \n

    Note that just because the name of this function is process.kill, it is\nreally just a signal sender, like the kill system call. The signal sent\nmay do something other than kill the target process.\n\n

    \n

    Example of sending a signal to yourself:\n\n

    \n
    process.on('SIGHUP', function() {\n  console.log('Got SIGHUP signal.');\n});\n\nsetTimeout(function() {\n  console.log('Exiting.');\n  process.exit(0);\n}, 100);\n\nprocess.kill(process.pid, 'SIGHUP');
    \n", + "desc": "

    Send a signal to a process. pid is the process id and signal is the\nstring describing the signal to send. Signal names are strings like\n'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'.\nSee kill(2) for more information.\n\n

    \n

    Note that just because the name of this function is process.kill, it is\nreally just a signal sender, like the kill system call. The signal sent\nmay do something other than kill the target process.\n\n

    \n

    Example of sending a signal to yourself:\n\n

    \n
    process.on('SIGHUP', function() {\n  console.log('Got SIGHUP signal.');\n});\n\nsetTimeout(function() {\n  console.log('Exiting.');\n  process.exit(0);\n}, 100);\n\nprocess.kill(process.pid, 'SIGHUP');
    \n

    Note: SIGUSR1 is reserved by node.js. It can be used to kickstart the\ndebugger.\n\n

    \n", "signatures": [ { "params": [ @@ -1785,8 +1785,8 @@ { "textRaw": "util", "name": "util", - "stability": 5, - "stabilityText": "Locked", + "stability": 4, + "stabilityText": "API Frozen", "desc": "

    These functions are in the module 'util'. Use require('util') to access\nthem.\n\n\n

    \n", "methods": [ { @@ -5465,7 +5465,7 @@ { "textRaw": "State Objects", "name": "state_objects", - "desc": "

    [Readable][] streams have a member object called _readableState.\n[Writable][] streams have a member object called _writableState.\n[Duplex][] streams have both.\n\n

    \n

    These objects should generally not be modified in child classes.\nHowever, if you have a Duplex or Transform stream that should be in\nobjectMode on the readable side, and not in objectMode on the\nwritable side, then you may do this in the constructor by setting the\nflag explicitly on the appropriate state object.\n\n

    \n
    var util = require('util');\nvar StringDecoder = require('string_decoder').StringDecoder;\nvar Transform = require('stream').Transform;\nutil.inherits(JSONParseStream, Transform);\n\n// Gets \\n-delimited JSON string data, and emits the parsed objects\nfunction JSONParseStream(options) {\n  if (!(this instanceof JSONParseStream))\n    return new JSONParseStream(options);\n\n  Transform.call(this, options);\n  this._writableState.objectMode = false;\n  this._readableState.objectMode = true;\n  this._buffer = '';\n  this._decoder = new StringDecoder('utf8');\n}\n\nJSONParseStream.prototype._transform = function(chunk, encoding, cb) {\n  this._buffer += this._decoder.write(chunk);\n  // split on newlines\n  var lines = this._buffer.split(/\\r?\\n/);\n  // keep the last partial line buffered\n  this._buffer = lines.pop();\n  for (var l = 0; l < lines.length; l++) {\n    var line = lines[l];\n    try {\n      var obj = JSON.parse(line);\n    } catch (er) {\n      this.emit('error', er);\n      return;\n    }\n    // push the parsed object out to the readable consumer\n    this.push(obj);\n  }\n  cb();\n};\n\nJSONParseStream.prototype._flush = function(cb) {\n  // Just handle any leftover\n  var rem = this._buffer.trim();\n  if (rem) {\n    try {\n      var obj = JSON.parse(rem);\n    } catch (er) {\n      this.emit('error', er);\n      return;\n    }\n    // push the parsed object out to the readable consumer\n    this.push(obj);\n  }\n  cb();\n};
    \n

    The state objects contain other useful information for debugging the\nstate of streams in your programs. It is safe to look at them, but\nbeyond setting option flags in the constructor, it is not safe to\nmodify them.\n\n\n

    \n

    [writable.write(chunk)]\n

    \n", + "desc": "

    [Readable][] streams have a member object called _readableState.\n[Writable][] streams have a member object called _writableState.\n[Duplex][] streams have both.\n\n

    \n

    These objects should generally not be modified in child classes.\nHowever, if you have a Duplex or Transform stream that should be in\nobjectMode on the readable side, and not in objectMode on the\nwritable side, then you may do this in the constructor by setting the\nflag explicitly on the appropriate state object.\n\n

    \n
    var util = require('util');\nvar StringDecoder = require('string_decoder').StringDecoder;\nvar Transform = require('stream').Transform;\nutil.inherits(JSONParseStream, Transform);\n\n// Gets \\n-delimited JSON string data, and emits the parsed objects\nfunction JSONParseStream(options) {\n  if (!(this instanceof JSONParseStream))\n    return new JSONParseStream(options);\n\n  Transform.call(this, options);\n  this._writableState.objectMode = false;\n  this._readableState.objectMode = true;\n  this._buffer = '';\n  this._decoder = new StringDecoder('utf8');\n}\n\nJSONParseStream.prototype._transform = function(chunk, encoding, cb) {\n  this._buffer += this._decoder.write(chunk);\n  // split on newlines\n  var lines = this._buffer.split(/\\r?\\n/);\n  // keep the last partial line buffered\n  this._buffer = lines.pop();\n  for (var l = 0; l < lines.length; l++) {\n    var line = lines[l];\n    try {\n      var obj = JSON.parse(line);\n    } catch (er) {\n      this.emit('error', er);\n      return;\n    }\n    // push the parsed object out to the readable consumer\n    this.push(obj);\n  }\n  cb();\n};\n\nJSONParseStream.prototype._flush = function(cb) {\n  // Just handle any leftover\n  var rem = this._buffer.trim();\n  if (rem) {\n    try {\n      var obj = JSON.parse(rem);\n    } catch (er) {\n      this.emit('error', er);\n      return;\n    }\n    // push the parsed object out to the readable consumer\n    this.push(obj);\n  }\n  cb();\n};
    \n

    The state objects contain other useful information for debugging the\nstate of streams in your programs. It is safe to look at them, but\nbeyond setting option flags in the constructor, it is not safe to\nmodify them.\n\n\n

    \n", "type": "misc", "displayName": "State Objects" } @@ -6421,7 +6421,7 @@ "textRaw": "tls.createServer(options, [secureConnectionListener])", "type": "method", "name": "createServer", - "desc": "

    Creates a new [tls.Server][]. The connectionListener argument is\nautomatically set as a listener for the [secureConnection][] event. The\noptions object has these possibilities:\n\n

    \n
      \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\nthe key, cert and ca options.)

      \n
    • \n
    • key: A string or Buffer containing the private key of the server in\nPEM format. (Required)

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the server in\nPEM format. (Required)

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates. If this is\nomitted several well known "root" CAs will be used, like VeriSign.\nThese are used to authorize connections.

      \n
    • \n
    • crl : Either a string or list of strings of PEM encoded CRLs (Certificate\nRevocation List)

      \n
    • \n
    • ciphers: A string describing the ciphers to use or exclude.

      \n

      To mitigate [BEAST attacks] it is recommended that you use this option in\nconjunction with the honorCipherOrder option described below to\nprioritize the non-CBC cipher.

      \n

      Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.\nConsult the [OpenSSL cipher list format documentation] for details on the\nformat. ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.

      \n
    • \n
    \n
    `AES128-GCM-SHA256` is used when node.js is linked against OpenSSL 1.0.1\nor newer and the client speaks TLS 1.2, RC4 is used as a secure fallback.\n\n**NOTE**: Previous revisions of this section suggested `AES256-SHA` as an\nacceptable cipher. Unfortunately, `AES256-SHA` is a CBC cipher and therefore\nsusceptible to BEAST attacks. Do *not* use it.
    \n
      \n
    • handshakeTimeout: Abort the connection if the SSL/TLS handshake does not\nfinish in this many milliseconds. The default is 120 seconds.

      \n

      A 'clientError' is emitted on the tls.Server object whenever a handshake\ntimes out.

      \n
    • \n
    • honorCipherOrder : When choosing a cipher, use the server's preferences\ninstead of the client preferences.

      \n

      Note that if SSLv2 is used, the server will send its list of preferences\nto the client, and the client chooses the cipher.

      \n

      Although, this option is disabled by default, it is recommended that you\nuse this option in conjunction with the ciphers option to mitigate\nBEAST attacks.

      \n
    • \n
    • requestCert: If true the server will request a certificate from\nclients that connect and attempt to verify that certificate. Default:\nfalse.

      \n
    • \n
    • rejectUnauthorized: If true the server will reject any connection\nwhich is not authorized with the list of supplied CAs. This option only\nhas an effect if requestCert is true. Default: false.

      \n
    • \n
    • NPNProtocols: An array or Buffer of possible NPN protocols. (Protocols\nshould be ordered by their priority).

      \n
    • \n
    • SNICallback: A function that will be called if client supports SNI TLS\nextension. Only one argument will be passed to it: servername. And\nSNICallback should return SecureContext instance.\n(You can use crypto.createCredentials(...).context to get proper\nSecureContext). If SNICallback wasn't provided - default callback with\nhigh-level API will be used (see below).

      \n
    • \n
    • sessionIdContext: A string containing a opaque identifier for session\nresumption. If requestCert is true, the default is MD5 hash value\ngenerated from command-line. Otherwise, the default is not provided.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    Here is a simple example echo server:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  key: fs.readFileSync('server-key.pem'),\n  cert: fs.readFileSync('server-cert.pem'),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n  // This is necessary only if the client uses the self-signed certificate.\n  ca: [ fs.readFileSync('client-cert.pem') ]\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n  console.log('server connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  cleartextStream.write("welcome!\\n");\n  cleartextStream.setEncoding('utf8');\n  cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n  console.log('server bound');\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('server.pfx'),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n  console.log('server connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  cleartextStream.write("welcome!\\n");\n  cleartextStream.setEncoding('utf8');\n  cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n  console.log('server bound');\n});
    \n

    You can test this server by connecting to it with openssl s_client:\n\n\n

    \n
    openssl s_client -connect 127.0.0.1:8000
    \n", + "desc": "

    Creates a new [tls.Server][]. The connectionListener argument is\nautomatically set as a listener for the [secureConnection][] event. The\noptions object has these possibilities:\n\n

    \n
      \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\nthe key, cert and ca options.)

      \n
    • \n
    • key: A string or Buffer containing the private key of the server in\nPEM format. (Required)

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the server in\nPEM format. (Required)

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates in PEM\nformat. If this is omitted several well known "root" CAs will be used,\nlike VeriSign. These are used to authorize connections.

      \n
    • \n
    • crl : Either a string or list of strings of PEM encoded CRLs (Certificate\nRevocation List)

      \n
    • \n
    • ciphers: A string describing the ciphers to use or exclude.

      \n

      To mitigate [BEAST attacks] it is recommended that you use this option in\nconjunction with the honorCipherOrder option described below to\nprioritize the non-CBC cipher.

      \n

      Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.\nConsult the [OpenSSL cipher list format documentation] for details on the\nformat. ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.

      \n
    • \n
    \n
    `AES128-GCM-SHA256` is used when node.js is linked against OpenSSL 1.0.1\nor newer and the client speaks TLS 1.2, RC4 is used as a secure fallback.\n\n**NOTE**: Previous revisions of this section suggested `AES256-SHA` as an\nacceptable cipher. Unfortunately, `AES256-SHA` is a CBC cipher and therefore\nsusceptible to BEAST attacks. Do *not* use it.
    \n
      \n
    • handshakeTimeout: Abort the connection if the SSL/TLS handshake does not\nfinish in this many milliseconds. The default is 120 seconds.

      \n

      A 'clientError' is emitted on the tls.Server object whenever a handshake\ntimes out.

      \n
    • \n
    • honorCipherOrder : When choosing a cipher, use the server's preferences\ninstead of the client preferences.

      \n

      Note that if SSLv2 is used, the server will send its list of preferences\nto the client, and the client chooses the cipher.

      \n

      Although, this option is disabled by default, it is recommended that you\nuse this option in conjunction with the ciphers option to mitigate\nBEAST attacks.

      \n
    • \n
    • requestCert: If true the server will request a certificate from\nclients that connect and attempt to verify that certificate. Default:\nfalse.

      \n
    • \n
    • rejectUnauthorized: If true the server will reject any connection\nwhich is not authorized with the list of supplied CAs. This option only\nhas an effect if requestCert is true. Default: false.

      \n
    • \n
    • NPNProtocols: An array or Buffer of possible NPN protocols. (Protocols\nshould be ordered by their priority).

      \n
    • \n
    • SNICallback: A function that will be called if client supports SNI TLS\nextension. Only one argument will be passed to it: servername. And\nSNICallback should return SecureContext instance.\n(You can use crypto.createCredentials(...).context to get proper\nSecureContext). If SNICallback wasn't provided - default callback with\nhigh-level API will be used (see below).

      \n
    • \n
    • sessionIdContext: A string containing a opaque identifier for session\nresumption. If requestCert is true, the default is MD5 hash value\ngenerated from command-line. Otherwise, the default is not provided.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    Here is a simple example echo server:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  key: fs.readFileSync('server-key.pem'),\n  cert: fs.readFileSync('server-cert.pem'),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n  // This is necessary only if the client uses the self-signed certificate.\n  ca: [ fs.readFileSync('client-cert.pem') ]\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n  console.log('server connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  cleartextStream.write("welcome!\\n");\n  cleartextStream.setEncoding('utf8');\n  cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n  console.log('server bound');\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('server.pfx'),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n  console.log('server connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  cleartextStream.write("welcome!\\n");\n  cleartextStream.setEncoding('utf8');\n  cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n  console.log('server bound');\n});
    \n

    You can test this server by connecting to it with openssl s_client:\n\n\n

    \n
    openssl s_client -connect 127.0.0.1:8000
    \n", "signatures": [ { "params": [ @@ -6440,7 +6440,7 @@ "textRaw": "tls.connect(options, [callback])", "type": "method", "name": "connect", - "desc": "

    Creates a new client connection to the given port and host (old API) or\noptions.port and options.host. (If host is omitted, it defaults to\nlocalhost.) options should be an object which specifies:\n\n

    \n
      \n
    • host: Host the client should connect to

      \n
    • \n
    • port: Port the client should connect to

      \n
    • \n
    • socket: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, host and port\nare ignored.

      \n
    • \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.

      \n
    • \n
    • key: A string or Buffer containing the private key of the client in\nPEM format.

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the client in\nPEM format.

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates. If this is\nomitted several well known "root" CAs will be used, like VeriSign.\nThese are used to authorize connections.

      \n
    • \n
    • rejectUnauthorized: If true, the server certificate is verified against\nthe list of supplied CAs. An 'error' event is emitted if verification\nfails. Default: true.

      \n
    • \n
    • NPNProtocols: An array of string or Buffer containing supported NPN\nprotocols. Buffer should have following format: 0x05hello0x05world,\nwhere first byte is next protocol name's length. (Passing array should\nusually be much simpler: ['hello', 'world'].)

      \n
    • \n
    • servername: Servername for SNI (Server Name Indication) TLS extension.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    The callback parameter will be added as a listener for the\n['secureConnect'][] event.\n\n

    \n

    tls.connect() returns a [CleartextStream][] object.\n\n

    \n

    Here is an example of a client of echo server as described previously:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync('server-cert.pem') ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('client.pfx')\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n", + "desc": "

    Creates a new client connection to the given port and host (old API) or\noptions.port and options.host. (If host is omitted, it defaults to\nlocalhost.) options should be an object which specifies:\n\n

    \n
      \n
    • host: Host the client should connect to

      \n
    • \n
    • port: Port the client should connect to

      \n
    • \n
    • socket: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, host and port\nare ignored.

      \n
    • \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.

      \n
    • \n
    • key: A string or Buffer containing the private key of the client in\nPEM format.

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the client in\nPEM format.

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates in PEM\nformat. If this is omitted several well known "root" CAs will be used,\nlike VeriSign. These are used to authorize connections.

      \n
    • \n
    • rejectUnauthorized: If true, the server certificate is verified against\nthe list of supplied CAs. An 'error' event is emitted if verification\nfails. Default: true.

      \n
    • \n
    • NPNProtocols: An array of strings or Buffers containing supported NPN\nprotocols. Buffers should have following format: 0x05hello0x05world,\nwhere first byte is next protocol name's length. (Passing array should\nusually be much simpler: ['hello', 'world'].)

      \n
    • \n
    • servername: Servername for SNI (Server Name Indication) TLS extension.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    The callback parameter will be added as a listener for the\n['secureConnect'][] event.\n\n

    \n

    tls.connect() returns a [CleartextStream][] object.\n\n

    \n

    Here is an example of a client of echo server as described previously:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync('server-cert.pem') ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('client.pfx')\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n", "signatures": [ { "params": [ @@ -6478,7 +6478,7 @@ "textRaw": "tls.connect(port, [host], [options], [callback])", "type": "method", "name": "connect", - "desc": "

    Creates a new client connection to the given port and host (old API) or\noptions.port and options.host. (If host is omitted, it defaults to\nlocalhost.) options should be an object which specifies:\n\n

    \n
      \n
    • host: Host the client should connect to

      \n
    • \n
    • port: Port the client should connect to

      \n
    • \n
    • socket: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, host and port\nare ignored.

      \n
    • \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.

      \n
    • \n
    • key: A string or Buffer containing the private key of the client in\nPEM format.

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the client in\nPEM format.

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates. If this is\nomitted several well known "root" CAs will be used, like VeriSign.\nThese are used to authorize connections.

      \n
    • \n
    • rejectUnauthorized: If true, the server certificate is verified against\nthe list of supplied CAs. An 'error' event is emitted if verification\nfails. Default: true.

      \n
    • \n
    • NPNProtocols: An array of string or Buffer containing supported NPN\nprotocols. Buffer should have following format: 0x05hello0x05world,\nwhere first byte is next protocol name's length. (Passing array should\nusually be much simpler: ['hello', 'world'].)

      \n
    • \n
    • servername: Servername for SNI (Server Name Indication) TLS extension.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    The callback parameter will be added as a listener for the\n['secureConnect'][] event.\n\n

    \n

    tls.connect() returns a [CleartextStream][] object.\n\n

    \n

    Here is an example of a client of echo server as described previously:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync('server-cert.pem') ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('client.pfx')\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n", + "desc": "

    Creates a new client connection to the given port and host (old API) or\noptions.port and options.host. (If host is omitted, it defaults to\nlocalhost.) options should be an object which specifies:\n\n

    \n
      \n
    • host: Host the client should connect to

      \n
    • \n
    • port: Port the client should connect to

      \n
    • \n
    • socket: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, host and port\nare ignored.

      \n
    • \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.

      \n
    • \n
    • key: A string or Buffer containing the private key of the client in\nPEM format.

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the client in\nPEM format.

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates in PEM\nformat. If this is omitted several well known "root" CAs will be used,\nlike VeriSign. These are used to authorize connections.

      \n
    • \n
    • rejectUnauthorized: If true, the server certificate is verified against\nthe list of supplied CAs. An 'error' event is emitted if verification\nfails. Default: true.

      \n
    • \n
    • NPNProtocols: An array of strings or Buffers containing supported NPN\nprotocols. Buffers should have following format: 0x05hello0x05world,\nwhere first byte is next protocol name's length. (Passing array should\nusually be much simpler: ['hello', 'world'].)

      \n
    • \n
    • servername: Servername for SNI (Server Name Indication) TLS extension.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    The callback parameter will be added as a listener for the\n['secureConnect'][] event.\n\n

    \n

    tls.connect() returns a [CleartextStream][] object.\n\n

    \n

    Here is an example of a client of echo server as described previously:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync('server-cert.pem') ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('client.pfx')\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n", "signatures": [ { "params": [ diff -Nru nodejs-0.10.17/doc/api/assert.html nodejs-0.10.20/doc/api/assert.html --- nodejs-0.10.17/doc/api/assert.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/assert.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Assert Node.js v0.10.17 Manual & Documentation + Assert Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -165,7 +165,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/buffer.html nodejs-0.10.20/doc/api/buffer.html --- nodejs-0.10.17/doc/api/buffer.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/buffer.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Buffer Node.js v0.10.17 Manual & Documentation + Buffer Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -892,7 +892,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/child_process.html nodejs-0.10.20/doc/api/child_process.html --- nodejs-0.10.17/doc/api/child_process.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/child_process.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Child Process Node.js v0.10.17 Manual & Documentation + Child Process Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -717,7 +717,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/cluster.html nodejs-0.10.20/doc/api/cluster.html --- nodejs-0.10.17/doc/api/cluster.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/cluster.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Cluster Node.js v0.10.17 Manual & Documentation + Cluster Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -647,7 +647,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/console.html nodejs-0.10.20/doc/api/console.html --- nodejs-0.10.17/doc/api/console.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/console.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - console Node.js v0.10.17 Manual & Documentation + console Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -154,7 +154,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/crypto.html nodejs-0.10.20/doc/api/crypto.html --- nodejs-0.10.17/doc/api/crypto.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/crypto.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Crypto Node.js v0.10.17 Manual & Documentation + Crypto Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -691,7 +691,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/debugger.html nodejs-0.10.20/doc/api/debugger.html --- nodejs-0.10.17/doc/api/debugger.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/debugger.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Debugger Node.js v0.10.17 Manual & Documentation + Debugger Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -252,7 +252,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/dgram.html nodejs-0.10.20/doc/api/dgram.html --- nodejs-0.10.17/doc/api/dgram.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/dgram.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - UDP / Datagram Sockets Node.js v0.10.17 Manual & Documentation + UDP / Datagram Sockets Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -365,7 +365,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/dns.html nodejs-0.10.20/doc/api/dns.html --- nodejs-0.10.17/doc/api/dns.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/dns.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - DNS Node.js v0.10.17 Manual & Documentation + DNS Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -237,7 +237,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/documentation.html nodejs-0.10.20/doc/api/documentation.html --- nodejs-0.10.17/doc/api/documentation.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/documentation.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - About this Documentation Node.js v0.10.17 Manual & Documentation + About this Documentation Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -135,7 +135,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/domain.html nodejs-0.10.20/doc/api/domain.html --- nodejs-0.10.17/doc/api/domain.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/domain.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Domain Node.js v0.10.17 Manual & Documentation + Domain Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -552,7 +552,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/events.html nodejs-0.10.20/doc/api/events.html --- nodejs-0.10.17/doc/api/events.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/events.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Events Node.js v0.10.17 Manual & Documentation + Events Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -211,7 +211,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/fs.html nodejs-0.10.20/doc/api/fs.html --- nodejs-0.10.17/doc/api/fs.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/fs.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - File System Node.js v0.10.17 Manual & Documentation + File System Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -933,7 +933,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/globals.html nodejs-0.10.20/doc/api/globals.html --- nodejs-0.10.17/doc/api/globals.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/globals.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Global Objects Node.js v0.10.17 Manual & Documentation + Global Objects Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -292,7 +292,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/http.html nodejs-0.10.20/doc/api/http.html --- nodejs-0.10.17/doc/api/http.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/http.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - HTTP Node.js v0.10.17 Manual & Documentation + HTTP Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -1092,7 +1092,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/https.html nodejs-0.10.20/doc/api/https.html --- nodejs-0.10.17/doc/api/https.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/https.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - HTTPS Node.js v0.10.17 Manual & Documentation + HTTPS Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -293,7 +293,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/index.html nodejs-0.10.20/doc/api/index.html --- nodejs-0.10.17/doc/api/index.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/index.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Node.js v0.10.17 Manual & Documentation + Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -105,7 +105,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/modules.html nodejs-0.10.20/doc/api/modules.html --- nodejs-0.10.17/doc/api/modules.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/modules.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Modules Node.js v0.10.17 Manual & Documentation + Modules Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -612,7 +612,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/net.html nodejs-0.10.20/doc/api/net.html --- nodejs-0.10.17/doc/api/net.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/net.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - net Node.js v0.10.17 Manual & Documentation + net Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -696,7 +696,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/os.html nodejs-0.10.20/doc/api/os.html --- nodejs-0.10.17/doc/api/os.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/os.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - os Node.js v0.10.17 Manual & Documentation + os Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -228,7 +228,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/path.html nodejs-0.10.20/doc/api/path.html --- nodejs-0.10.17/doc/api/path.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/path.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Path Node.js v0.10.17 Manual & Documentation + Path Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -264,7 +264,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/process.html nodejs-0.10.20/doc/api/process.html --- nodejs-0.10.17/doc/api/process.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/process.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - process Node.js v0.10.17 Manual & Documentation + process Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -154,10 +154,10 @@

    Signal Events#

    - +

    Emitted when the processes receives a signal. See sigaction(2) for a list of -standard POSIX signal names such as SIGINT, SIGUSR1, etc. +standard POSIX signal names such as SIGINT, SIGHUP, etc.

    Example of listening for SIGINT: @@ -172,6 +172,9 @@

    An easy way to send the SIGINT signal is with Control-C in most terminal programs. +

    +

    Note: SIGUSR1 is reserved by node.js to kickstart the debugger. It's possible +to install a listener but that won't stop the debugger from starting.

    process.stdout#

    @@ -478,7 +481,7 @@

    process.kill(pid, [signal])#

    Send a signal to a process. pid is the process id and signal is the string describing the signal to send. Signal names are strings like -'SIGINT' or 'SIGUSR1'. If omitted, the signal will be 'SIGTERM'. +'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'. See kill(2) for more information.

    @@ -500,6 +503,10 @@ }, 100); process.kill(process.pid, 'SIGHUP'); +

    Note: SIGUSR1 is reserved by node.js. It can be used to kickstart the +debugger. + +

    process.pid#

    The PID of the process. @@ -695,7 +702,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/process.json nodejs-0.10.20/doc/api/process.json --- nodejs-0.10.17/doc/api/process.json 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/process.json 2013-09-30 21:56:36.000000000 +0000 @@ -23,9 +23,9 @@ }, { "textRaw": "Signal Events", - "name": "SIGINT, SIGUSR1, etc.", + "name": "SIGINT, SIGHUP, etc.", "type": "event", - "desc": "

    Emitted when the processes receives a signal. See sigaction(2) for a list of\nstandard POSIX signal names such as SIGINT, SIGUSR1, etc.\n\n

    \n

    Example of listening for SIGINT:\n\n

    \n
    // Start reading from stdin so we don't exit.\nprocess.stdin.resume();\n\nprocess.on('SIGINT', function() {\n  console.log('Got SIGINT.  Press Control-D to exit.');\n});
    \n

    An easy way to send the SIGINT signal is with Control-C in most terminal\nprograms.\n\n\n

    \n", + "desc": "

    Emitted when the processes receives a signal. See sigaction(2) for a list of\nstandard POSIX signal names such as SIGINT, SIGHUP, etc.\n\n

    \n

    Example of listening for SIGINT:\n\n

    \n
    // Start reading from stdin so we don't exit.\nprocess.stdin.resume();\n\nprocess.on('SIGINT', function() {\n  console.log('Got SIGINT.  Press Control-D to exit.');\n});
    \n

    An easy way to send the SIGINT signal is with Control-C in most terminal\nprograms.\n\n

    \n

    Note: SIGUSR1 is reserved by node.js to kickstart the debugger. It's possible\nto install a listener but that won't stop the debugger from starting.\n\n

    \n", "params": [] } ], @@ -261,7 +261,7 @@ "textRaw": "process.kill(pid, [signal])", "type": "method", "name": "kill", - "desc": "

    Send a signal to a process. pid is the process id and signal is the\nstring describing the signal to send. Signal names are strings like\n'SIGINT' or 'SIGUSR1'. If omitted, the signal will be 'SIGTERM'.\nSee kill(2) for more information.\n\n

    \n

    Note that just because the name of this function is process.kill, it is\nreally just a signal sender, like the kill system call. The signal sent\nmay do something other than kill the target process.\n\n

    \n

    Example of sending a signal to yourself:\n\n

    \n
    process.on('SIGHUP', function() {\n  console.log('Got SIGHUP signal.');\n});\n\nsetTimeout(function() {\n  console.log('Exiting.');\n  process.exit(0);\n}, 100);\n\nprocess.kill(process.pid, 'SIGHUP');
    \n", + "desc": "

    Send a signal to a process. pid is the process id and signal is the\nstring describing the signal to send. Signal names are strings like\n'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'.\nSee kill(2) for more information.\n\n

    \n

    Note that just because the name of this function is process.kill, it is\nreally just a signal sender, like the kill system call. The signal sent\nmay do something other than kill the target process.\n\n

    \n

    Example of sending a signal to yourself:\n\n

    \n
    process.on('SIGHUP', function() {\n  console.log('Got SIGHUP signal.');\n});\n\nsetTimeout(function() {\n  console.log('Exiting.');\n  process.exit(0);\n}, 100);\n\nprocess.kill(process.pid, 'SIGHUP');
    \n

    Note: SIGUSR1 is reserved by node.js. It can be used to kickstart the\ndebugger.\n\n

    \n", "signatures": [ { "params": [ diff -Nru nodejs-0.10.17/doc/api/process.markdown nodejs-0.10.20/doc/api/process.markdown --- nodejs-0.10.17/doc/api/process.markdown 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/doc/api/process.markdown 2013-09-30 20:52:48.000000000 +0000 @@ -60,10 +60,10 @@ ## Signal Events - + Emitted when the processes receives a signal. See sigaction(2) for a list of -standard POSIX signal names such as SIGINT, SIGUSR1, etc. +standard POSIX signal names such as SIGINT, SIGHUP, etc. Example of listening for `SIGINT`: @@ -77,6 +77,8 @@ An easy way to send the `SIGINT` signal is with `Control-C` in most terminal programs. +Note: SIGUSR1 is reserved by node.js to kickstart the debugger. It's possible +to install a listener but that won't stop the debugger from starting. ## process.stdout @@ -391,7 +393,7 @@ Send a signal to a process. `pid` is the process id and `signal` is the string describing the signal to send. Signal names are strings like -'SIGINT' or 'SIGUSR1'. If omitted, the signal will be 'SIGTERM'. +'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'. See kill(2) for more information. Note that just because the name of this function is `process.kill`, it is @@ -411,6 +413,8 @@ process.kill(process.pid, 'SIGHUP'); +Note: SIGUSR1 is reserved by node.js. It can be used to kickstart the +debugger. ## process.pid diff -Nru nodejs-0.10.17/doc/api/punycode.html nodejs-0.10.20/doc/api/punycode.html --- nodejs-0.10.17/doc/api/punycode.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/punycode.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - punycode Node.js v0.10.17 Manual & Documentation + punycode Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -143,7 +143,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/querystring.html nodejs-0.10.20/doc/api/querystring.html --- nodejs-0.10.17/doc/api/querystring.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/querystring.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Query String Node.js v0.10.17 Manual & Documentation + Query String Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -124,7 +124,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/readline.html nodejs-0.10.20/doc/api/readline.html --- nodejs-0.10.17/doc/api/readline.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/readline.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Readline Node.js v0.10.17 Manual & Documentation + Readline Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -397,7 +397,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/repl.html nodejs-0.10.20/doc/api/repl.html --- nodejs-0.10.17/doc/api/repl.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/repl.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - REPL Node.js v0.10.17 Manual & Documentation + REPL Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -280,7 +280,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/stream.html nodejs-0.10.20/doc/api/stream.html --- nodejs-0.10.17/doc/api/stream.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/stream.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Stream Node.js v0.10.17 Manual & Documentation + Stream Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -595,7 +595,7 @@

    Event: 'drain'#

    -

    If a [writable.write(chunk)][] call returns false, then the drain +

    If a writable.write(chunk) call returns false, then the drain event will indicate when it is appropriate to begin writing more data to the stream. @@ -1592,8 +1592,6 @@

    -

    [writable.write(chunk)] -

    @@ -1613,7 +1611,7 @@
  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/stream.json nodejs-0.10.20/doc/api/stream.json --- nodejs-0.10.17/doc/api/stream.json 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/stream.json 2013-09-30 21:56:36.000000000 +0000 @@ -1224,7 +1224,7 @@ { "textRaw": "State Objects", "name": "state_objects", - "desc": "

    [Readable][] streams have a member object called _readableState.\n[Writable][] streams have a member object called _writableState.\n[Duplex][] streams have both.\n\n

    \n

    These objects should generally not be modified in child classes.\nHowever, if you have a Duplex or Transform stream that should be in\nobjectMode on the readable side, and not in objectMode on the\nwritable side, then you may do this in the constructor by setting the\nflag explicitly on the appropriate state object.\n\n

    \n
    var util = require('util');\nvar StringDecoder = require('string_decoder').StringDecoder;\nvar Transform = require('stream').Transform;\nutil.inherits(JSONParseStream, Transform);\n\n// Gets \\n-delimited JSON string data, and emits the parsed objects\nfunction JSONParseStream(options) {\n  if (!(this instanceof JSONParseStream))\n    return new JSONParseStream(options);\n\n  Transform.call(this, options);\n  this._writableState.objectMode = false;\n  this._readableState.objectMode = true;\n  this._buffer = '';\n  this._decoder = new StringDecoder('utf8');\n}\n\nJSONParseStream.prototype._transform = function(chunk, encoding, cb) {\n  this._buffer += this._decoder.write(chunk);\n  // split on newlines\n  var lines = this._buffer.split(/\\r?\\n/);\n  // keep the last partial line buffered\n  this._buffer = lines.pop();\n  for (var l = 0; l < lines.length; l++) {\n    var line = lines[l];\n    try {\n      var obj = JSON.parse(line);\n    } catch (er) {\n      this.emit('error', er);\n      return;\n    }\n    // push the parsed object out to the readable consumer\n    this.push(obj);\n  }\n  cb();\n};\n\nJSONParseStream.prototype._flush = function(cb) {\n  // Just handle any leftover\n  var rem = this._buffer.trim();\n  if (rem) {\n    try {\n      var obj = JSON.parse(rem);\n    } catch (er) {\n      this.emit('error', er);\n      return;\n    }\n    // push the parsed object out to the readable consumer\n    this.push(obj);\n  }\n  cb();\n};
    \n

    The state objects contain other useful information for debugging the\nstate of streams in your programs. It is safe to look at them, but\nbeyond setting option flags in the constructor, it is not safe to\nmodify them.\n\n\n

    \n

    [writable.write(chunk)]\n

    \n", + "desc": "

    [Readable][] streams have a member object called _readableState.\n[Writable][] streams have a member object called _writableState.\n[Duplex][] streams have both.\n\n

    \n

    These objects should generally not be modified in child classes.\nHowever, if you have a Duplex or Transform stream that should be in\nobjectMode on the readable side, and not in objectMode on the\nwritable side, then you may do this in the constructor by setting the\nflag explicitly on the appropriate state object.\n\n

    \n
    var util = require('util');\nvar StringDecoder = require('string_decoder').StringDecoder;\nvar Transform = require('stream').Transform;\nutil.inherits(JSONParseStream, Transform);\n\n// Gets \\n-delimited JSON string data, and emits the parsed objects\nfunction JSONParseStream(options) {\n  if (!(this instanceof JSONParseStream))\n    return new JSONParseStream(options);\n\n  Transform.call(this, options);\n  this._writableState.objectMode = false;\n  this._readableState.objectMode = true;\n  this._buffer = '';\n  this._decoder = new StringDecoder('utf8');\n}\n\nJSONParseStream.prototype._transform = function(chunk, encoding, cb) {\n  this._buffer += this._decoder.write(chunk);\n  // split on newlines\n  var lines = this._buffer.split(/\\r?\\n/);\n  // keep the last partial line buffered\n  this._buffer = lines.pop();\n  for (var l = 0; l < lines.length; l++) {\n    var line = lines[l];\n    try {\n      var obj = JSON.parse(line);\n    } catch (er) {\n      this.emit('error', er);\n      return;\n    }\n    // push the parsed object out to the readable consumer\n    this.push(obj);\n  }\n  cb();\n};\n\nJSONParseStream.prototype._flush = function(cb) {\n  // Just handle any leftover\n  var rem = this._buffer.trim();\n  if (rem) {\n    try {\n      var obj = JSON.parse(rem);\n    } catch (er) {\n      this.emit('error', er);\n      return;\n    }\n    // push the parsed object out to the readable consumer\n    this.push(obj);\n  }\n  cb();\n};
    \n

    The state objects contain other useful information for debugging the\nstate of streams in your programs. It is safe to look at them, but\nbeyond setting option flags in the constructor, it is not safe to\nmodify them.\n\n\n

    \n", "type": "misc", "displayName": "State Objects" } diff -Nru nodejs-0.10.17/doc/api/stream.markdown nodejs-0.10.20/doc/api/stream.markdown --- nodejs-0.10.17/doc/api/stream.markdown 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/doc/api/stream.markdown 2013-09-30 20:52:48.000000000 +0000 @@ -1460,7 +1460,7 @@ [`_read(size)`]: #stream_readable_read_size_1 [`_read()`]: #stream_readable_read_size_1 [_read]: #stream_readable_read_size_1 -[`writable.write(chunk)`] +[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback [`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback [`write()`]: #stream_writable_write_chunk_encoding_callback [`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback diff -Nru nodejs-0.10.17/doc/api/string_decoder.html nodejs-0.10.20/doc/api/string_decoder.html --- nodejs-0.10.17/doc/api/string_decoder.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/string_decoder.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - StringDecoder Node.js v0.10.17 Manual & Documentation + StringDecoder Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -102,7 +102,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/synopsis.html nodejs-0.10.20/doc/api/synopsis.html --- nodejs-0.10.17/doc/api/synopsis.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/synopsis.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Synopsis Node.js v0.10.17 Manual & Documentation + Synopsis Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -93,7 +93,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/timers.html nodejs-0.10.20/doc/api/timers.html --- nodejs-0.10.17/doc/api/timers.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/timers.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Timers Node.js v0.10.17 Manual & Documentation + Timers Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -147,7 +147,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/tls.html nodejs-0.10.20/doc/api/tls.html --- nodejs-0.10.17/doc/api/tls.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/tls.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - TLS (SSL) Node.js v0.10.17 Manual & Documentation + TLS (SSL) Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -205,9 +205,9 @@

  • cert: A string or Buffer containing the certificate key of the server in PEM format. (Required)

  • -
  • ca: An array of strings or Buffers of trusted certificates. If this is -omitted several well known "root" CAs will be used, like VeriSign. -These are used to authorize connections.

    +
  • ca: An array of strings or Buffers of trusted certificates in PEM +format. If this is omitted several well known "root" CAs will be used, +like VeriSign. These are used to authorize connections.

  • crl : Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List)

    @@ -361,16 +361,16 @@
  • cert: A string or Buffer containing the certificate key of the client in PEM format.

  • -
  • ca: An array of strings or Buffers of trusted certificates. If this is -omitted several well known "root" CAs will be used, like VeriSign. -These are used to authorize connections.

    +
  • ca: An array of strings or Buffers of trusted certificates in PEM +format. If this is omitted several well known "root" CAs will be used, +like VeriSign. These are used to authorize connections.

  • rejectUnauthorized: If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Default: true.

  • -
  • NPNProtocols: An array of string or Buffer containing supported NPN -protocols. Buffer should have following format: 0x05hello0x05world, +

  • NPNProtocols: An array of strings or Buffers containing supported NPN +protocols. Buffers should have following format: 0x05hello0x05world, where first byte is next protocol name's length. (Passing array should usually be much simpler: ['hello', 'world'].)

  • @@ -699,7 +699,7 @@
  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/tls.json nodejs-0.10.20/doc/api/tls.json --- nodejs-0.10.17/doc/api/tls.json 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/tls.json 2013-09-30 21:56:36.000000000 +0000 @@ -37,7 +37,7 @@ "textRaw": "tls.createServer(options, [secureConnectionListener])", "type": "method", "name": "createServer", - "desc": "

    Creates a new [tls.Server][]. The connectionListener argument is\nautomatically set as a listener for the [secureConnection][] event. The\noptions object has these possibilities:\n\n

    \n
      \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\nthe key, cert and ca options.)

      \n
    • \n
    • key: A string or Buffer containing the private key of the server in\nPEM format. (Required)

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the server in\nPEM format. (Required)

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates. If this is\nomitted several well known "root" CAs will be used, like VeriSign.\nThese are used to authorize connections.

      \n
    • \n
    • crl : Either a string or list of strings of PEM encoded CRLs (Certificate\nRevocation List)

      \n
    • \n
    • ciphers: A string describing the ciphers to use or exclude.

      \n

      To mitigate [BEAST attacks] it is recommended that you use this option in\nconjunction with the honorCipherOrder option described below to\nprioritize the non-CBC cipher.

      \n

      Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.\nConsult the [OpenSSL cipher list format documentation] for details on the\nformat. ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.

      \n
    • \n
    \n
    `AES128-GCM-SHA256` is used when node.js is linked against OpenSSL 1.0.1\nor newer and the client speaks TLS 1.2, RC4 is used as a secure fallback.\n\n**NOTE**: Previous revisions of this section suggested `AES256-SHA` as an\nacceptable cipher. Unfortunately, `AES256-SHA` is a CBC cipher and therefore\nsusceptible to BEAST attacks. Do *not* use it.
    \n
      \n
    • handshakeTimeout: Abort the connection if the SSL/TLS handshake does not\nfinish in this many milliseconds. The default is 120 seconds.

      \n

      A 'clientError' is emitted on the tls.Server object whenever a handshake\ntimes out.

      \n
    • \n
    • honorCipherOrder : When choosing a cipher, use the server's preferences\ninstead of the client preferences.

      \n

      Note that if SSLv2 is used, the server will send its list of preferences\nto the client, and the client chooses the cipher.

      \n

      Although, this option is disabled by default, it is recommended that you\nuse this option in conjunction with the ciphers option to mitigate\nBEAST attacks.

      \n
    • \n
    • requestCert: If true the server will request a certificate from\nclients that connect and attempt to verify that certificate. Default:\nfalse.

      \n
    • \n
    • rejectUnauthorized: If true the server will reject any connection\nwhich is not authorized with the list of supplied CAs. This option only\nhas an effect if requestCert is true. Default: false.

      \n
    • \n
    • NPNProtocols: An array or Buffer of possible NPN protocols. (Protocols\nshould be ordered by their priority).

      \n
    • \n
    • SNICallback: A function that will be called if client supports SNI TLS\nextension. Only one argument will be passed to it: servername. And\nSNICallback should return SecureContext instance.\n(You can use crypto.createCredentials(...).context to get proper\nSecureContext). If SNICallback wasn't provided - default callback with\nhigh-level API will be used (see below).

      \n
    • \n
    • sessionIdContext: A string containing a opaque identifier for session\nresumption. If requestCert is true, the default is MD5 hash value\ngenerated from command-line. Otherwise, the default is not provided.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    Here is a simple example echo server:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  key: fs.readFileSync('server-key.pem'),\n  cert: fs.readFileSync('server-cert.pem'),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n  // This is necessary only if the client uses the self-signed certificate.\n  ca: [ fs.readFileSync('client-cert.pem') ]\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n  console.log('server connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  cleartextStream.write("welcome!\\n");\n  cleartextStream.setEncoding('utf8');\n  cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n  console.log('server bound');\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('server.pfx'),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n  console.log('server connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  cleartextStream.write("welcome!\\n");\n  cleartextStream.setEncoding('utf8');\n  cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n  console.log('server bound');\n});
    \n

    You can test this server by connecting to it with openssl s_client:\n\n\n

    \n
    openssl s_client -connect 127.0.0.1:8000
    \n", + "desc": "

    Creates a new [tls.Server][]. The connectionListener argument is\nautomatically set as a listener for the [secureConnection][] event. The\noptions object has these possibilities:\n\n

    \n
      \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\nthe key, cert and ca options.)

      \n
    • \n
    • key: A string or Buffer containing the private key of the server in\nPEM format. (Required)

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the server in\nPEM format. (Required)

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates in PEM\nformat. If this is omitted several well known "root" CAs will be used,\nlike VeriSign. These are used to authorize connections.

      \n
    • \n
    • crl : Either a string or list of strings of PEM encoded CRLs (Certificate\nRevocation List)

      \n
    • \n
    • ciphers: A string describing the ciphers to use or exclude.

      \n

      To mitigate [BEAST attacks] it is recommended that you use this option in\nconjunction with the honorCipherOrder option described below to\nprioritize the non-CBC cipher.

      \n

      Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.\nConsult the [OpenSSL cipher list format documentation] for details on the\nformat. ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.

      \n
    • \n
    \n
    `AES128-GCM-SHA256` is used when node.js is linked against OpenSSL 1.0.1\nor newer and the client speaks TLS 1.2, RC4 is used as a secure fallback.\n\n**NOTE**: Previous revisions of this section suggested `AES256-SHA` as an\nacceptable cipher. Unfortunately, `AES256-SHA` is a CBC cipher and therefore\nsusceptible to BEAST attacks. Do *not* use it.
    \n
      \n
    • handshakeTimeout: Abort the connection if the SSL/TLS handshake does not\nfinish in this many milliseconds. The default is 120 seconds.

      \n

      A 'clientError' is emitted on the tls.Server object whenever a handshake\ntimes out.

      \n
    • \n
    • honorCipherOrder : When choosing a cipher, use the server's preferences\ninstead of the client preferences.

      \n

      Note that if SSLv2 is used, the server will send its list of preferences\nto the client, and the client chooses the cipher.

      \n

      Although, this option is disabled by default, it is recommended that you\nuse this option in conjunction with the ciphers option to mitigate\nBEAST attacks.

      \n
    • \n
    • requestCert: If true the server will request a certificate from\nclients that connect and attempt to verify that certificate. Default:\nfalse.

      \n
    • \n
    • rejectUnauthorized: If true the server will reject any connection\nwhich is not authorized with the list of supplied CAs. This option only\nhas an effect if requestCert is true. Default: false.

      \n
    • \n
    • NPNProtocols: An array or Buffer of possible NPN protocols. (Protocols\nshould be ordered by their priority).

      \n
    • \n
    • SNICallback: A function that will be called if client supports SNI TLS\nextension. Only one argument will be passed to it: servername. And\nSNICallback should return SecureContext instance.\n(You can use crypto.createCredentials(...).context to get proper\nSecureContext). If SNICallback wasn't provided - default callback with\nhigh-level API will be used (see below).

      \n
    • \n
    • sessionIdContext: A string containing a opaque identifier for session\nresumption. If requestCert is true, the default is MD5 hash value\ngenerated from command-line. Otherwise, the default is not provided.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    Here is a simple example echo server:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  key: fs.readFileSync('server-key.pem'),\n  cert: fs.readFileSync('server-cert.pem'),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n  // This is necessary only if the client uses the self-signed certificate.\n  ca: [ fs.readFileSync('client-cert.pem') ]\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n  console.log('server connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  cleartextStream.write("welcome!\\n");\n  cleartextStream.setEncoding('utf8');\n  cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n  console.log('server bound');\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('server.pfx'),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n  console.log('server connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  cleartextStream.write("welcome!\\n");\n  cleartextStream.setEncoding('utf8');\n  cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n  console.log('server bound');\n});
    \n

    You can test this server by connecting to it with openssl s_client:\n\n\n

    \n
    openssl s_client -connect 127.0.0.1:8000
    \n", "signatures": [ { "params": [ @@ -56,7 +56,7 @@ "textRaw": "tls.connect(options, [callback])", "type": "method", "name": "connect", - "desc": "

    Creates a new client connection to the given port and host (old API) or\noptions.port and options.host. (If host is omitted, it defaults to\nlocalhost.) options should be an object which specifies:\n\n

    \n
      \n
    • host: Host the client should connect to

      \n
    • \n
    • port: Port the client should connect to

      \n
    • \n
    • socket: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, host and port\nare ignored.

      \n
    • \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.

      \n
    • \n
    • key: A string or Buffer containing the private key of the client in\nPEM format.

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the client in\nPEM format.

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates. If this is\nomitted several well known "root" CAs will be used, like VeriSign.\nThese are used to authorize connections.

      \n
    • \n
    • rejectUnauthorized: If true, the server certificate is verified against\nthe list of supplied CAs. An 'error' event is emitted if verification\nfails. Default: true.

      \n
    • \n
    • NPNProtocols: An array of string or Buffer containing supported NPN\nprotocols. Buffer should have following format: 0x05hello0x05world,\nwhere first byte is next protocol name's length. (Passing array should\nusually be much simpler: ['hello', 'world'].)

      \n
    • \n
    • servername: Servername for SNI (Server Name Indication) TLS extension.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    The callback parameter will be added as a listener for the\n['secureConnect'][] event.\n\n

    \n

    tls.connect() returns a [CleartextStream][] object.\n\n

    \n

    Here is an example of a client of echo server as described previously:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync('server-cert.pem') ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('client.pfx')\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n", + "desc": "

    Creates a new client connection to the given port and host (old API) or\noptions.port and options.host. (If host is omitted, it defaults to\nlocalhost.) options should be an object which specifies:\n\n

    \n
      \n
    • host: Host the client should connect to

      \n
    • \n
    • port: Port the client should connect to

      \n
    • \n
    • socket: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, host and port\nare ignored.

      \n
    • \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.

      \n
    • \n
    • key: A string or Buffer containing the private key of the client in\nPEM format.

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the client in\nPEM format.

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates in PEM\nformat. If this is omitted several well known "root" CAs will be used,\nlike VeriSign. These are used to authorize connections.

      \n
    • \n
    • rejectUnauthorized: If true, the server certificate is verified against\nthe list of supplied CAs. An 'error' event is emitted if verification\nfails. Default: true.

      \n
    • \n
    • NPNProtocols: An array of strings or Buffers containing supported NPN\nprotocols. Buffers should have following format: 0x05hello0x05world,\nwhere first byte is next protocol name's length. (Passing array should\nusually be much simpler: ['hello', 'world'].)

      \n
    • \n
    • servername: Servername for SNI (Server Name Indication) TLS extension.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    The callback parameter will be added as a listener for the\n['secureConnect'][] event.\n\n

    \n

    tls.connect() returns a [CleartextStream][] object.\n\n

    \n

    Here is an example of a client of echo server as described previously:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync('server-cert.pem') ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('client.pfx')\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n", "signatures": [ { "params": [ @@ -94,7 +94,7 @@ "textRaw": "tls.connect(port, [host], [options], [callback])", "type": "method", "name": "connect", - "desc": "

    Creates a new client connection to the given port and host (old API) or\noptions.port and options.host. (If host is omitted, it defaults to\nlocalhost.) options should be an object which specifies:\n\n

    \n
      \n
    • host: Host the client should connect to

      \n
    • \n
    • port: Port the client should connect to

      \n
    • \n
    • socket: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, host and port\nare ignored.

      \n
    • \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.

      \n
    • \n
    • key: A string or Buffer containing the private key of the client in\nPEM format.

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the client in\nPEM format.

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates. If this is\nomitted several well known "root" CAs will be used, like VeriSign.\nThese are used to authorize connections.

      \n
    • \n
    • rejectUnauthorized: If true, the server certificate is verified against\nthe list of supplied CAs. An 'error' event is emitted if verification\nfails. Default: true.

      \n
    • \n
    • NPNProtocols: An array of string or Buffer containing supported NPN\nprotocols. Buffer should have following format: 0x05hello0x05world,\nwhere first byte is next protocol name's length. (Passing array should\nusually be much simpler: ['hello', 'world'].)

      \n
    • \n
    • servername: Servername for SNI (Server Name Indication) TLS extension.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    The callback parameter will be added as a listener for the\n['secureConnect'][] event.\n\n

    \n

    tls.connect() returns a [CleartextStream][] object.\n\n

    \n

    Here is an example of a client of echo server as described previously:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync('server-cert.pem') ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('client.pfx')\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n", + "desc": "

    Creates a new client connection to the given port and host (old API) or\noptions.port and options.host. (If host is omitted, it defaults to\nlocalhost.) options should be an object which specifies:\n\n

    \n
      \n
    • host: Host the client should connect to

      \n
    • \n
    • port: Port the client should connect to

      \n
    • \n
    • socket: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, host and port\nare ignored.

      \n
    • \n
    • pfx: A string or Buffer containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.

      \n
    • \n
    • key: A string or Buffer containing the private key of the client in\nPEM format.

      \n
    • \n
    • passphrase: A string of passphrase for the private key or pfx.

      \n
    • \n
    • cert: A string or Buffer containing the certificate key of the client in\nPEM format.

      \n
    • \n
    • ca: An array of strings or Buffers of trusted certificates in PEM\nformat. If this is omitted several well known "root" CAs will be used,\nlike VeriSign. These are used to authorize connections.

      \n
    • \n
    • rejectUnauthorized: If true, the server certificate is verified against\nthe list of supplied CAs. An 'error' event is emitted if verification\nfails. Default: true.

      \n
    • \n
    • NPNProtocols: An array of strings or Buffers containing supported NPN\nprotocols. Buffers should have following format: 0x05hello0x05world,\nwhere first byte is next protocol name's length. (Passing array should\nusually be much simpler: ['hello', 'world'].)

      \n
    • \n
    • servername: Servername for SNI (Server Name Indication) TLS extension.

      \n
    • \n
    • secureProtocol: The SSL method to use, e.g. SSLv3_method to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].

      \n
    • \n
    \n

    The callback parameter will be added as a listener for the\n['secureConnect'][] event.\n\n

    \n

    tls.connect() returns a [CleartextStream][] object.\n\n

    \n

    Here is an example of a client of echo server as described previously:\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync('client-key.pem'),\n  cert: fs.readFileSync('client-cert.pem'),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync('server-cert.pem') ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n

    Or\n\n

    \n
    var tls = require('tls');\nvar fs = require('fs');\n\nvar options = {\n  pfx: fs.readFileSync('client.pfx')\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n  console.log('client connected',\n              cleartextStream.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(cleartextStream);\n  process.stdin.resume();\n});\ncleartextStream.setEncoding('utf8');\ncleartextStream.on('data', function(data) {\n  console.log(data);\n});\ncleartextStream.on('end', function() {\n  server.close();\n});
    \n", "signatures": [ { "params": [ diff -Nru nodejs-0.10.17/doc/api/tls.markdown nodejs-0.10.20/doc/api/tls.markdown --- nodejs-0.10.17/doc/api/tls.markdown 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/doc/api/tls.markdown 2013-09-30 20:52:48.000000000 +0000 @@ -104,9 +104,9 @@ - `cert`: A string or `Buffer` containing the certificate key of the server in PEM format. (Required) - - `ca`: An array of strings or `Buffer`s of trusted certificates. If this is - omitted several well known "root" CAs will be used, like VeriSign. - These are used to authorize connections. + - `ca`: An array of strings or `Buffer`s of trusted certificates in PEM + format. If this is omitted several well known "root" CAs will be used, + like VeriSign. These are used to authorize connections. - `crl` : Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List) @@ -262,16 +262,16 @@ - `cert`: A string or `Buffer` containing the certificate key of the client in PEM format. - - `ca`: An array of strings or `Buffer`s of trusted certificates. If this is - omitted several well known "root" CAs will be used, like VeriSign. - These are used to authorize connections. + - `ca`: An array of strings or `Buffer`s of trusted certificates in PEM + format. If this is omitted several well known "root" CAs will be used, + like VeriSign. These are used to authorize connections. - `rejectUnauthorized`: If `true`, the server certificate is verified against the list of supplied CAs. An `'error'` event is emitted if verification fails. Default: `true`. - - `NPNProtocols`: An array of string or `Buffer` containing supported NPN - protocols. `Buffer` should have following format: `0x05hello0x05world`, + - `NPNProtocols`: An array of strings or `Buffer`s containing supported NPN + protocols. `Buffer`s should have following format: `0x05hello0x05world`, where first byte is next protocol name's length. (Passing array should usually be much simpler: `['hello', 'world']`.) diff -Nru nodejs-0.10.17/doc/api/tty.html nodejs-0.10.20/doc/api/tty.html --- nodejs-0.10.17/doc/api/tty.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/tty.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - TTY Node.js v0.10.17 Manual & Documentation + TTY Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -158,7 +158,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/url.html nodejs-0.10.20/doc/api/url.html --- nodejs-0.10.17/doc/api/url.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/url.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - URL Node.js v0.10.17 Manual & Documentation + URL Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -175,7 +175,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/util.html nodejs-0.10.20/doc/api/util.html --- nodejs-0.10.17/doc/api/util.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/util.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - util Node.js v0.10.17 Manual & Documentation + util Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -70,7 +70,7 @@

    util#

    -
    Stability: 5 - Locked

    These functions are in the module 'util'. Use require('util') to access +

    Stability: 4 - API Frozen

    These functions are in the module 'util'. Use require('util') to access them. @@ -308,7 +308,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/util.json nodejs-0.10.20/doc/api/util.json --- nodejs-0.10.17/doc/api/util.json 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/util.json 2013-09-30 21:56:36.000000000 +0000 @@ -4,8 +4,8 @@ { "textRaw": "util", "name": "util", - "stability": 5, - "stabilityText": "Locked", + "stability": 4, + "stabilityText": "API Frozen", "desc": "

    These functions are in the module 'util'. Use require('util') to access\nthem.\n\n\n

    \n", "methods": [ { diff -Nru nodejs-0.10.17/doc/api/util.markdown nodejs-0.10.20/doc/api/util.markdown --- nodejs-0.10.17/doc/api/util.markdown 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/doc/api/util.markdown 2013-09-30 20:52:48.000000000 +0000 @@ -1,6 +1,6 @@ # util - Stability: 5 - Locked + Stability: 4 - API Frozen These functions are in the module `'util'`. Use `require('util')` to access them. diff -Nru nodejs-0.10.17/doc/api/vm.html nodejs-0.10.20/doc/api/vm.html --- nodejs-0.10.17/doc/api/vm.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/vm.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Executing JavaScript Node.js v0.10.17 Manual & Documentation + Executing JavaScript Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -316,7 +316,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/api/zlib.html nodejs-0.10.20/doc/api/zlib.html --- nodejs-0.10.17/doc/api/zlib.html 2013-08-21 22:15:07.000000000 +0000 +++ nodejs-0.10.20/doc/api/zlib.html 2013-09-30 21:56:36.000000000 +0000 @@ -2,7 +2,7 @@ - Zlib Node.js v0.10.17 Manual & Documentation + Zlib Node.js v0.10.20 Manual & Documentation @@ -31,7 +31,7 @@
    -

    Node.js v0.10.17 Manual & Documentation

    +

    Node.js v0.10.20 Manual & Documentation

    Index | @@ -476,7 +476,7 @@

  • -

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    +

    Copyright Joyent, Inc, Node.js is a trademark of Joyent, Inc. View license.

    diff -Nru nodejs-0.10.17/doc/blog/Uncategorized/an-easy-way-to-build-scalable-network-programs.md nodejs-0.10.20/doc/blog/Uncategorized/an-easy-way-to-build-scalable-network-programs.md --- nodejs-0.10.17/doc/blog/Uncategorized/an-easy-way-to-build-scalable-network-programs.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/doc/blog/Uncategorized/an-easy-way-to-build-scalable-network-programs.md 2013-09-30 20:52:48.000000000 +0000 @@ -13,4 +13,4 @@ Node has a clear purpose: provide an easy way to build scalable network programs. It is not a tool for every problem. Do not write a ray tracer with Node. Do not write a web browser with Node. Do however reach for Node if tasked with writing a DNS server, DHCP server, or even a video encoding server. -By relying on the kernel to schedule and preempt computationally expensive tasks and to load balance incoming connections, Node appears less magical than server platforms that employ userland scheduling. So far, our focus on simplicity and transparency has paid off: the number of success stories from developers and corporations who are adopting the technology continues to grow. +By relying on the kernel to schedule and preempt computationally expensive tasks and to load balance incoming connections, Node appears less magical than server platforms that employ userland scheduling. So far, our focus on simplicity and transparency has paid off: the number of success stories from developers and corporations who are adopting the technology continues to grow. diff -Nru nodejs-0.10.17/doc/blog/Uncategorized/the-videos-from-node-meetup.md nodejs-0.10.20/doc/blog/Uncategorized/the-videos-from-node-meetup.md --- nodejs-0.10.17/doc/blog/Uncategorized/the-videos-from-node-meetup.md 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/doc/blog/Uncategorized/the-videos-from-node-meetup.md 2013-09-30 20:52:48.000000000 +0000 @@ -7,4 +7,4 @@ Uber, Voxer, and Joyent described how they use Node in production -http://joyeur.com/2011/08/11/node-js-meetup-distributed-web-architectures/ +http://www.joyent.com/blog/node-js-meetup-distributed-web-architectures/ diff -Nru nodejs-0.10.17/doc/blog/release/v0.10.17.md nodejs-0.10.20/doc/blog/release/v0.10.17.md --- nodejs-0.10.17/doc/blog/release/v0.10.17.md 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/doc/blog/release/v0.10.17.md 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,92 @@ +date: Wed Aug 21 16:37:31 PDT 2013 +version: 0.10.17 +category: release +title: Node v0.10.17 (Stable) +slug: node-v0-10-17-stable + +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) + + +Source Code: http://nodejs.org/dist/v0.10.17/node-v0.10.17.tar.gz + +Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.17/node-v0.10.17.pkg + +Windows Installer: http://nodejs.org/dist/v0.10.17/node-v0.10.17-x86.msi + +Windows x64 Installer: http://nodejs.org/dist/v0.10.17/x64/node-v0.10.17-x64.msi + +Windows x64 Files: http://nodejs.org/dist/v0.10.17/x64/ + +Linux 32-bit Binary: http://nodejs.org/dist/v0.10.17/node-v0.10.17-linux-x86.tar.gz + +Linux 64-bit Binary: http://nodejs.org/dist/v0.10.17/node-v0.10.17-linux-x64.tar.gz + +Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.17/node-v0.10.17-sunos-x86.tar.gz + +Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.17/node-v0.10.17-sunos-x64.tar.gz + +Other release files: http://nodejs.org/dist/v0.10.17/ + +Website: http://nodejs.org/docs/v0.10.17/ + +Documentation: http://nodejs.org/docs/v0.10.17/api/ + +Shasums: +``` +8502c5ec4878154b5896fca6a14ff6c83c3774a1 node-v0.10.17-darwin-x64.tar.gz +6d785ae86ea050159dfd85841a4faac830be8a2a node-v0.10.17-darwin-x86.tar.gz +244dc1a25dcd2cc252ae9315bb2da07b41381c5c node-v0.10.17-linux-x64.tar.gz +109c32b514fab374b73972dda4f4d27a33e20d5d node-v0.10.17-linux-x86.tar.gz +2e046a6e05520c7be941365830517db90b791999 node-v0.10.17-sunos-x64.tar.gz +907d73aa0e84717c342327265f0b665d09b50154 node-v0.10.17-sunos-x86.tar.gz +ac8f653545b58d009e19522e3ead8886d151b59d node-v0.10.17-x86.msi +32f160364990489e1f79593e1cdcea9dfde28125 node-v0.10.17.pkg +c9d31d5415d2cf7a09fd7abebf9f01259e9dd93b node-v0.10.17.tar.gz +33a5e3a86c391fc30080e796c46a74cefbd9104c node.exe +004ebfa938b3f14984b964dcaba061d10c32f12c node.exp +3dd092b26c742f20006fc2085b329a3e32d8e3d9 node.lib +a8d997936e240626c56df8c6c8d55b659003a644 node.pdb +165fecaab04a09a4df6b731f0e4b264bdb281644 pkgsrc/nodejs-ia32-0.10.17.tgz +0c813098a93090823b513147de7f41f920dd8569 pkgsrc/nodejs-x64-0.10.17.tgz +3cf665ad6c8f7d3040c2bfea8791f77c40c8f2a0 x64/node-v0.10.17-x64.msi +95baf773a34f85014eb67d026b7b9cd0396f96f5 x64/node.exe +ebdbcea161d44368c224fce448bf3d85e5a54f21 x64/node.exp +49d12cb3d5be6f6707b7f5c89952f81bddb69a68 x64/node.lib +0c0ef15eb6705c81137187c597cb0105bd2bc352 x64/node.pdb +``` + +Shasums: +``` +8502c5ec4878154b5896fca6a14ff6c83c3774a1 node-v0.10.17-darwin-x64.tar.gz +6d785ae86ea050159dfd85841a4faac830be8a2a node-v0.10.17-darwin-x86.tar.gz +244dc1a25dcd2cc252ae9315bb2da07b41381c5c node-v0.10.17-linux-x64.tar.gz +109c32b514fab374b73972dda4f4d27a33e20d5d node-v0.10.17-linux-x86.tar.gz +2e046a6e05520c7be941365830517db90b791999 node-v0.10.17-sunos-x64.tar.gz +907d73aa0e84717c342327265f0b665d09b50154 node-v0.10.17-sunos-x86.tar.gz +ac8f653545b58d009e19522e3ead8886d151b59d node-v0.10.17-x86.msi +32f160364990489e1f79593e1cdcea9dfde28125 node-v0.10.17.pkg +c9d31d5415d2cf7a09fd7abebf9f01259e9dd93b node-v0.10.17.tar.gz +33a5e3a86c391fc30080e796c46a74cefbd9104c node.exe +004ebfa938b3f14984b964dcaba061d10c32f12c node.exp +3dd092b26c742f20006fc2085b329a3e32d8e3d9 node.lib +a8d997936e240626c56df8c6c8d55b659003a644 node.pdb +165fecaab04a09a4df6b731f0e4b264bdb281644 pkgsrc/nodejs-ia32-0.10.17.tgz +0c813098a93090823b513147de7f41f920dd8569 pkgsrc/nodejs-x64-0.10.17.tgz +3cf665ad6c8f7d3040c2bfea8791f77c40c8f2a0 x64/node-v0.10.17-x64.msi +95baf773a34f85014eb67d026b7b9cd0396f96f5 x64/node.exe +ebdbcea161d44368c224fce448bf3d85e5a54f21 x64/node.exp +49d12cb3d5be6f6707b7f5c89952f81bddb69a68 x64/node.lib +0c0ef15eb6705c81137187c597cb0105bd2bc352 x64/node.pdb +``` diff -Nru nodejs-0.10.17/doc/blog/release/v0.10.18.md nodejs-0.10.20/doc/blog/release/v0.10.18.md --- nodejs-0.10.17/doc/blog/release/v0.10.18.md 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/doc/blog/release/v0.10.18.md 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,62 @@ +date: Wed Sep 4 11:24:48 PDT 2013 +version: 0.10.18 +category: release +title: Node v0.10.18 (Stable) +slug: node-v0-10-18-stable + +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) + + +Source Code: http://nodejs.org/dist/v0.10.18/node-v0.10.18.tar.gz + +Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.18/node-v0.10.18.pkg + +Windows Installer: http://nodejs.org/dist/v0.10.18/node-v0.10.18-x86.msi + +Windows x64 Installer: http://nodejs.org/dist/v0.10.18/x64/node-v0.10.18-x64.msi + +Windows x64 Files: http://nodejs.org/dist/v0.10.18/x64/ + +Linux 32-bit Binary: http://nodejs.org/dist/v0.10.18/node-v0.10.18-linux-x86.tar.gz + +Linux 64-bit Binary: http://nodejs.org/dist/v0.10.18/node-v0.10.18-linux-x64.tar.gz + +Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.18/node-v0.10.18-sunos-x86.tar.gz + +Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.18/node-v0.10.18-sunos-x64.tar.gz + +Other release files: http://nodejs.org/dist/v0.10.18/ + +Website: http://nodejs.org/docs/v0.10.18/ + +Documentation: http://nodejs.org/docs/v0.10.18/api/ + +Shasums: +``` +c0219a68aa25369f4c83c5bdbb5ccc0db2cb8230 node-v0.10.18-darwin-x64.tar.gz +32261191c3b9f0988d4f132e442969714da3281f node-v0.10.18-darwin-x86.tar.gz +07923fa9613b2976b3be3a1bbe36d21b9f69f3c9 node-v0.10.18-linux-x64.tar.gz +4d4c6f485a110bf28e273020c20987c6045d2c57 node-v0.10.18-linux-x86.tar.gz +7b61c0c12fa99f8d0ab6ed0153359ed1c914e224 node-v0.10.18-sunos-x64.tar.gz +9f57be4b041058ea941b7f4c6f0a2ad9f431d46f node-v0.10.18-sunos-x86.tar.gz +fd50e0563e1ccf3efc903a33df40f86b6bfe2e62 node-v0.10.18-x86.msi +ff71d0e8003fc1b4674f98ceb912fba2161c8224 node-v0.10.18.pkg +0bc3c544ca1707ea4b8bd601706304e9c0609fe5 node-v0.10.18.tar.gz +ed35cc393d930fa05f4e1fbcadfa53e2837d59cb node.exe +5bb6f7af79fefa21ce936bdd60355d8d097c6cb6 node.exp +3581c8563d475642d07657fd639f48e595d2693d node.lib +7eb7f20b9e4dfb7d866b6d84916931630159230c node.pdb +192d7996c413e72a7f525039eca75ebdf0d5bc1f pkgsrc/nodejs-ia32-0.10.18.tgz +6c508f63bd76627ece633d04957a29bce52521c7 pkgsrc/nodejs-x64-0.10.18.tgz +8b845fe8723480f740d2efbfac3da11cb712ce66 x64/node-v0.10.18-x64.msi +dab63ee4c72612392cfa26c48808d45859cf6b4a x64/node.exe +90e37b4c9c7ea0e96a7035aa6473405da245006c x64/node.exp +1c19d9d5c6e7ced70742875a43085306b91d402d x64/node.lib +4e90849c7c96c4d2caffb64f062d91d14d152261 x64/node.pdb +``` diff -Nru nodejs-0.10.17/doc/blog/release/v0.10.19.md nodejs-0.10.20/doc/blog/release/v0.10.19.md --- nodejs-0.10.17/doc/blog/release/v0.10.19.md 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/doc/blog/release/v0.10.19.md 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,70 @@ +date: Tue Sep 24 15:09:23 PDT 2013 +version: 0.10.19 +category: release +title: Node v0.10.19 (Stable) +slug: node-v0-10-19-stable + +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) + + +Source Code: http://nodejs.org/dist/v0.10.19/node-v0.10.19.tar.gz + +Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.19/node-v0.10.19.pkg + +Windows Installer: http://nodejs.org/dist/v0.10.19/node-v0.10.19-x86.msi + +Windows x64 Installer: http://nodejs.org/dist/v0.10.19/x64/node-v0.10.19-x64.msi + +Windows x64 Files: http://nodejs.org/dist/v0.10.19/x64/ + +Linux 32-bit Binary: http://nodejs.org/dist/v0.10.19/node-v0.10.19-linux-x86.tar.gz + +Linux 64-bit Binary: http://nodejs.org/dist/v0.10.19/node-v0.10.19-linux-x64.tar.gz + +Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.19/node-v0.10.19-sunos-x86.tar.gz + +Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.19/node-v0.10.19-sunos-x64.tar.gz + +Other release files: http://nodejs.org/dist/v0.10.19/ + +Website: http://nodejs.org/docs/v0.10.19/ + +Documentation: http://nodejs.org/docs/v0.10.19/api/ + +Shasums: +``` +74f1db96742fcc0128d1c14d3cb808ef5c847749 node-v0.10.19-darwin-x64.tar.gz +71ef9bd63d3926a2b78a43a5d077838c43e7e2ea node-v0.10.19-darwin-x86.tar.gz +ebc6dc67276f7461dbd45496924b36949c75e7e0 node-v0.10.19-linux-x64.tar.gz +226b507f554fa5cc07296c30f08db76f5eaeb157 node-v0.10.19-linux-x86.tar.gz +3b324613b79d1c4ab3b9414b0644a3a559c2aec9 node-v0.10.19-sunos-x64.tar.gz +83cb3e58e9ac925ea22c8533cabc712625faa3f7 node-v0.10.19-sunos-x86.tar.gz +dcbe7db6d0c93f83f539f38807cd3c1923969721 node-v0.10.19-x86.msi +e6397e1df4e74864e3f0e5fc7bd24178828497f4 node-v0.10.19.pkg +39478caf7024af6d992007457540f8941104c5d9 node-v0.10.19.tar.gz +0fe9364b443e76f7364f8694751da15479417bdf node.exe +63555cdb67c2fd63411726dc691b08af520b27f6 node.exp +c4d33b56cff97c47b12df3ad237977a57d4c798d node.lib +19a603db8f8c30b1736124740a6a1c856f2d21d8 node.pdb +ca32da0335ecb09ab7316b6e18f23461e298768e pkgsrc/nodejs-ia32-0.10.19.tgz +b0b05a7f74d980720677a3232e82e23df211c122 pkgsrc/nodejs-x64-0.10.19.tgz +45aed04478346035e8dc7933d120ab636d56eac4 x64/node-v0.10.19-x64.msi +b81788c17fec167b77883dcbaf8c629ad7560c4d x64/node.exe +086761bf6ff4622714d24d7979548a37aaaea57e x64/node.exp +cc554a431039952207adfcb3997a7366ad7182e8 x64/node.lib +02d18f042f3d25663ea4d979dff8120435982079 x64/node.pdb +``` diff -Nru nodejs-0.10.17/doc/blog/release/v0.11.7.md nodejs-0.10.20/doc/blog/release/v0.11.7.md --- nodejs-0.10.17/doc/blog/release/v0.11.7.md 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/doc/blog/release/v0.11.7.md 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,92 @@ +date: Wed Sep 4 15:18:08 PDT 2013 +version: 0.11.7 +category: release +title: Node v0.11.7 (Unstable) +slug: node-v0-11-7-unstable + +2013.08.21, Version 0.11.7 (Unstable) + +* uv: upgrade to v0.11.13 + +* v8: upgrade to 3.20.17 + +* buffer: adhere to INSPECT_MAX_BYTES (Timothy J Fontaine) + +* buffer: fix regression for large buffer creation (Trevor Norris) + +* buffer: don't throw if slice length too long (Trevor Norris) + +* buffer: Buffer(buf) constructor copies into the proper buffer (Ben Noordhuis) + +* cli: remove --max-stack-size (Ben Noordhuis) + +* cli: unknown command line options are errors (Ben Noordhuis) + +* child_process: exec accept buffer as an encoding (Seth Fitzsimmons) + +* crypto: make randomBytes/pbkdf2 callbacks domain aware (Ben Noordhuis) + +* domain: deprecate domain.dispose(). (Forrest L Norvell) + +* fs: Expose birthtime on stat objects (isaacs) + +* http: Only send connection:keep-alive if necessary (isaacs) + +* repl: Catch syntax errors better (isaacs, Nathan Rajlich) + +* stream: change default highWaterMark for objectMode to 16 (Mathias Buus) + +* stream: make setEncoding/pause/resume chainable (Julian Gruber, isaacs) + +* util: pass opts to custom inspect functions (Timothy J Fontaine) + +* vm: rewritten to behave like Contextify (Domenic Denicola) + + +Source Code: http://nodejs.org/dist/v0.11.7/node-v0.11.7.tar.gz + +Macintosh Installer (Universal): http://nodejs.org/dist/v0.11.7/node-v0.11.7.pkg + +Windows Installer: http://nodejs.org/dist/v0.11.7/node-v0.11.7-x86.msi + +Windows x64 Installer: http://nodejs.org/dist/v0.11.7/x64/node-v0.11.7-x64.msi + +Windows x64 Files: http://nodejs.org/dist/v0.11.7/x64/ + +Linux 32-bit Binary: http://nodejs.org/dist/v0.11.7/node-v0.11.7-linux-x86.tar.gz + +Linux 64-bit Binary: http://nodejs.org/dist/v0.11.7/node-v0.11.7-linux-x64.tar.gz + +Solaris 32-bit Binary: http://nodejs.org/dist/v0.11.7/node-v0.11.7-sunos-x86.tar.gz + +Solaris 64-bit Binary: http://nodejs.org/dist/v0.11.7/node-v0.11.7-sunos-x64.tar.gz + +Other release files: http://nodejs.org/dist/v0.11.7/ + +Website: http://nodejs.org/docs/v0.11.7/ + +Documentation: http://nodejs.org/docs/v0.11.7/api/ + +Shasums: +``` +7ce3cf1297b6a8cda2aa134424890dcc6eaacc12 node-v0.11.7-darwin-x64.tar.gz +183b4a29eb65dabb5de732f2ab15cdac8c5e5c94 node-v0.11.7-darwin-x86.tar.gz +7d39c046388e7ec6bb2d53a575a0c9ed1d4a9bcc node-v0.11.7-linux-x64.tar.gz +4cf9a367b614b76722324ec6a3beb3295412100c node-v0.11.7-linux-x86.tar.gz +1d98fa4117f3ac7c7f081eea22a016c8549b27c1 node-v0.11.7-sunos-x64.tar.gz +9c04eb5ca9485370d757b0be94b223b5a0180b7a node-v0.11.7-sunos-x86.tar.gz +f131bca701ad9dac61d8929362a3c8cde41845de node-v0.11.7-x86.msi +95c1ab2d08f3ba1bb514469ad8786af6ecb18f57 node-v0.11.7.pkg +a3b0d7fb818754ad55f06a02745d7ec53986de64 node-v0.11.7.tar.gz +33371cadab85e7c3864d5eafae4041a9ca0f3ca2 node.exe +823487bfaa44f10770ecc9c8deec1bbe63bc955e node.exp +194c286bf8ef6608a891dc2c27cd38471da780a3 node.lib +0491c4e8d45fe420cc065be4de05dbcff0d4223a node.pdb +d8b2d7e034d6031c083fb3c88c251f179b18b4ca pkgsrc/nodejs-ia32-0.11.7.tgz +a9e7822718212a22b5630057efcba174041db9ff pkgsrc/nodejs-x64-0.11.7.tgz +44e7eeafb0982f81778a15ece00c8f25cc4d00f5 x64/node-v0.11.7-x64.msi +88067c4d19af87f5645a3f8bc81ec7d1610580de x64/node.exe +d150573f7567a0da4418d5086410fecabcc1fae8 x64/node.exp +e0482e1cca25faacaa1111e2de647025bca5e7f5 x64/node.lib +e9a87b9b7aa1ff220ce4b4b5cb0758c9071c8ce2 x64/node.pdb +``` diff -Nru nodejs-0.10.17/lib/_stream_readable.js nodejs-0.10.20/lib/_stream_readable.js --- nodejs-0.10.17/lib/_stream_readable.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/lib/_stream_readable.js 2013-09-30 20:52:48.000000000 +0000 @@ -519,7 +519,7 @@ } // This is a brutally ugly hack to make sure that our error handler // is attached before any userland ones. NEVER DO THIS. - if (!dest._events.error) + if (!dest._events || !dest._events.error) dest.on('error', onerror); else if (Array.isArray(dest._events.error)) dest._events.error.unshift(onerror); diff -Nru nodejs-0.10.17/lib/_stream_transform.js nodejs-0.10.20/lib/_stream_transform.js --- nodejs-0.10.17/lib/_stream_transform.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/lib/_stream_transform.js 2013-09-30 20:52:48.000000000 +0000 @@ -174,7 +174,7 @@ Transform.prototype._read = function(n) { var ts = this._transformState; - if (ts.writechunk && ts.writecb && !ts.transforming) { + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { diff -Nru nodejs-0.10.17/lib/_stream_writable.js nodejs-0.10.20/lib/_stream_writable.js --- nodejs-0.10.17/lib/_stream_writable.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/lib/_stream_writable.js 2013-09-30 20:52:48.000000000 +0000 @@ -196,6 +196,8 @@ // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, chunk, encoding, cb) { chunk = decodeChunk(state, chunk, encoding); + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; var len = state.objectMode ? 1 : chunk.length; state.length += len; diff -Nru nodejs-0.10.17/lib/readline.js nodejs-0.10.20/lib/readline.js --- nodejs-0.10.17/lib/readline.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/lib/readline.js 2013-09-30 20:52:48.000000000 +0000 @@ -941,7 +941,7 @@ key.name = 'space'; key.meta = (s.length === 2); - } else if (s <= '\x1a') { + } else if (s.length === 1 && s <= '\x1a') { // ctrl+letter key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1); key.ctrl = true; diff -Nru nodejs-0.10.17/lib/tls.js nodejs-0.10.20/lib/tls.js --- nodejs-0.10.17/lib/tls.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/lib/tls.js 2013-09-30 20:52:48.000000000 +0000 @@ -447,10 +447,9 @@ var bytesRead = 0, start = this._buffer.offset; do { - var read = this._buffer.use(this.pair.ssl, out, size); + var read = this._buffer.use(this.pair.ssl, out, size - bytesRead); if (read > 0) { bytesRead += read; - size -= read; } // Handle and report errors @@ -505,16 +504,15 @@ } else { // Give them requested data if (this.ondata) { - var self = this; this.ondata(pool, start, start + bytesRead); // Consume data automatically // simple/test-https-drain fails without it - process.nextTick(function() { - self.read(bytesRead); - }); + this.push(pool.slice(start, start + bytesRead)); + this.read(bytesRead); + } else { + this.push(pool.slice(start, start + bytesRead)); } - this.push(pool.slice(start, start + bytesRead)); } // Let users know that we've some internal data to read @@ -1321,12 +1319,13 @@ var sslcontext = crypto.createCredentials(options); - convertNPNProtocols(options.NPNProtocols, this); + var NPN = {}; + convertNPNProtocols(options.NPNProtocols, NPN); var hostname = options.servername || options.host || 'localhost', pair = new SecurePair(sslcontext, false, true, options.rejectUnauthorized === true ? true : false, { - NPNProtocols: this.NPNProtocols, + NPNProtocols: NPN.NPNProtocols, servername: hostname, cleartext: options.cleartext, encrypted: options.encrypted diff -Nru nodejs-0.10.17/src/node_version.h nodejs-0.10.20/src/node_version.h --- nodejs-0.10.17/src/node_version.h 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/src/node_version.h 2013-09-30 20:52:48.000000000 +0000 @@ -24,7 +24,7 @@ #define NODE_MAJOR_VERSION 0 #define NODE_MINOR_VERSION 10 -#define NODE_PATCH_VERSION 17 +#define NODE_PATCH_VERSION 20 #define NODE_VERSION_IS_RELEASE 1 diff -Nru nodejs-0.10.17/src/pipe_wrap.cc nodejs-0.10.20/src/pipe_wrap.cc --- nodejs-0.10.17/src/pipe_wrap.cc 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/src/pipe_wrap.cc 2013-09-30 20:52:48.000000000 +0000 @@ -269,9 +269,10 @@ UNWRAP(PipeWrap) - int fd = args[0]->IntegerValue(); - - uv_pipe_open(&wrap->handle_, fd); + if (uv_pipe_open(&wrap->handle_, args[0]->Int32Value())) { + uv_err_t err = uv_last_error(wrap->handle_.loop); + return ThrowException(UVException(err.code, "uv_pipe_open")); + } return scope.Close(v8::Null()); } diff -Nru nodejs-0.10.17/test/simple/test-readline-interface.js nodejs-0.10.20/test/simple/test-readline-interface.js --- nodejs-0.10.17/test/simple/test-readline-interface.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/test/simple/test-readline-interface.js 2013-09-30 20:52:48.000000000 +0000 @@ -155,6 +155,18 @@ assert.equal(callCount, expectedLines.length - 1); rli.close(); + // \r at start of input should output blank line + fi = new FakeInput(); + rli = new readline.Interface({ input: fi, output: fi, terminal: true }); + expectedLines = ['', 'foo' ]; + callCount = 0; + rli.on('line', function(line) { + assert.equal(line, expectedLines[callCount]); + callCount++; + }); + fi.emit('data', '\rfoo\r'); + assert.equal(callCount, expectedLines.length); + rli.close(); // sending a multi-byte utf8 char over multiple writes var buf = Buffer('☮', 'utf8'); diff -Nru nodejs-0.10.17/test/simple/test-stream-transform-objectmode-falsey-value.js nodejs-0.10.20/test/simple/test-stream-transform-objectmode-falsey-value.js --- nodejs-0.10.17/test/simple/test-stream-transform-objectmode-falsey-value.js 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/test/simple/test-stream-transform-objectmode-falsey-value.js 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,53 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var common = require('../common'); +var assert = require('assert'); + +var stream = require('stream'); +var PassThrough = stream.PassThrough; + +var src = new PassThrough({ objectMode: true }); +var tx = new PassThrough({ objectMode: true }); +var dest = new PassThrough({ objectMode: true }); + +var expect = [ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; +var results = []; +process.on('exit', function() { + assert.deepEqual(results, expect); + console.log('ok'); +}); + +dest.on('data', function(x) { + results.push(x); +}); + +src.pipe(tx).pipe(dest); + +var i = -1; +var int = setInterval(function() { + if (i > 10) { + src.end(); + clearInterval(int); + } else { + src.write(i++); + } +}); diff -Nru nodejs-0.10.17/test/simple/test-stream-writable-decoded-encoding.js nodejs-0.10.20/test/simple/test-stream-writable-decoded-encoding.js --- nodejs-0.10.17/test/simple/test-stream-writable-decoded-encoding.js 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/test/simple/test-stream-writable-decoded-encoding.js 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,60 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var common = require('../common'); +var assert = require('assert'); + +var stream = require('stream'); +var util = require('util'); + +function MyWritable(fn, options) { + stream.Writable.call(this, options); + this.fn = fn; +}; + +util.inherits(MyWritable, stream.Writable); + +MyWritable.prototype._write = function (chunk, encoding, callback) { + this.fn(Buffer.isBuffer(chunk), typeof chunk, encoding); + callback(); +}; + +;(function decodeStringsTrue() { + var m = new MyWritable(function(isBuffer, type, enc) { + assert(isBuffer); + assert.equal(type, 'object'); + assert.equal(enc, 'buffer'); + console.log('ok - decoded string is decoded'); + }, { decodeStrings: true }); + m.write('some-text', 'utf8'); + m.end(); +})(); + +;(function decodeStringsFalse() { + var m = new MyWritable(function(isBuffer, type, enc) { + assert(!isBuffer); + assert.equal(type, 'string'); + assert.equal(enc, 'utf8'); + console.log('ok - un-decoded string is not decoded'); + }, { decodeStrings: false }); + m.write('some-text', 'utf8'); + m.end(); +})(); diff -Nru nodejs-0.10.17/test/simple/test-tls-npn-server-client.js nodejs-0.10.20/test/simple/test-tls-npn-server-client.js --- nodejs-0.10.17/test/simple/test-tls-npn-server-client.js 2013-08-21 22:00:56.000000000 +0000 +++ nodejs-0.10.20/test/simple/test-tls-npn-server-client.js 2013-09-30 20:52:48.000000000 +0000 @@ -66,6 +66,12 @@ key: serverOptions.key, cert: serverOptions.cert, crl: serverOptions.crl, + rejectUnauthorized: false +},{ + port: serverPort, + key: serverOptions.key, + cert: serverOptions.cert, + crl: serverOptions.crl, NPNProtocols: ['first-priority-unsupported', 'x', 'y'], rejectUnauthorized: false }]; @@ -91,7 +97,9 @@ connectClient(clientsOptions[0], function() { connectClient(clientsOptions[1], function() { connectClient(clientsOptions[2], function() { - server.close(); + connectClient(clientsOptions[3], function() { + server.close(); + }); }); }); }); @@ -100,6 +108,8 @@ process.on('exit', function() { assert.equal(serverResults[0], clientsResults[0]); assert.equal(serverResults[1], clientsResults[1]); - assert.equal(serverResults[2], 'first-priority-unsupported'); + assert.equal(serverResults[2], 'http/1.1'); assert.equal(clientsResults[2], false); + assert.equal(serverResults[3], 'first-priority-unsupported'); + assert.equal(clientsResults[3], false); }); diff -Nru nodejs-0.10.17/test/simple/test-tls-ondata.js nodejs-0.10.20/test/simple/test-tls-ondata.js --- nodejs-0.10.17/test/simple/test-tls-ondata.js 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/test/simple/test-tls-ondata.js 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,54 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var common = require('../common'); +var assert = require('assert'); +var tls = require('tls'); +var fs = require('fs'); + +var options = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') +}; + +var server = tls.Server(options, function(socket) { + socket.end('hello world'); +}); + +server.listen(common.PORT, function() { + var client = tls.connect({ + port: common.PORT, + rejectUnauthorized: false + }); + // test that setting the `ondata` function *prevents* data from + // being pushed to the streams2 interface of the socket + client.ondata = function (buf, start, length) { + var b = buf.slice(start, length); + process.nextTick(function () { + var b2 = client.read(); + if (b2) { + assert.notEqual(b.toString(), b2.toString()); + } + client.destroy(); + server.close(); + }); + }; +}); diff -Nru nodejs-0.10.17/tools/getstability.py nodejs-0.10.20/tools/getstability.py --- nodejs-0.10.17/tools/getstability.py 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/tools/getstability.py 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,19 @@ +import os,re + +node_version_h = os.path.join(os.path.dirname(__file__), '..', 'src', + 'node_version.h') + +f = open(node_version_h) + +for line in f: + if re.match('#define NODE_MAJOR_VERSION', line): + major = line.split()[2] + if re.match('#define NODE_MINOR_VERSION', line): + minor = line.split()[2] + if re.match('#define NODE_PATCH_VERSION', line): + patch = line.split()[2] + +if int(minor) % 2 == 0: + print 'stable' +else: + print 'unstable' diff -Nru nodejs-0.10.17/tools/node-release-post-build.sh nodejs-0.10.20/tools/node-release-post-build.sh --- nodejs-0.10.17/tools/node-release-post-build.sh 1970-01-01 00:00:00.000000000 +0000 +++ nodejs-0.10.20/tools/node-release-post-build.sh 2013-09-30 20:52:48.000000000 +0000 @@ -0,0 +1,79 @@ +#!/bin/bash + +## This is to be used once jenkins has finished building the release + +set -e + +stability="$(python tools/getstability.py)" +NODE_STABC="$(tr '[:lower:]' '[:upper:]' <<< ${stability:0:1})${stability:1}" +NODE_STABL="$stability" + +echo "Building for $stability" + +scp tj@nodejs.org:archive/node/tmp/v$(python tools/getnodeversion.py)/SHASUM* . +FILES="SHASUMS SHASUMS256" +for i in $FILES ; do gpg -s $i.txt; gpg --clearsign $i.txt; done +scp SHASUM* tj@nodejs.org:archive/node/tmp/v$(python tools/getnodeversion.py)/ + +ssh nodejs.org mkdir -p "dist/v$(python tools/getnodeversion.py)/{x64,docs}" +ssh nodejs.org ln -s ../dist/v$(python tools/getnodeversion.py)/docs docs/v$(python tools/getnodeversion.py) + +ssh root@nodejs.org mv /home/tj/archive/node/tmp/v$(python tools/getnodeversion.py)/* /home/node/dist/v$(python tools/getnodeversion.py)/ +ssh root@nodejs.org chown -R node:other /home/node/dist/v$(python tools/getnodeversion.py) + +# tag the release +# should be the same key used to sign the shasums +git tag -sm "$(bash tools/changelog-head.sh)" v$(python tools/getnodeversion.py) + +# push to github +git push git@github.com:joyent/node v$(python tools/getnodeversion.py)-release --tags + +# blog post and email +make email.md +( echo "" + echo "Shasums:" + echo '```' + cat SHASUMS.txt + echo '```' ) >> email.md +( echo -n "date: " + date + echo -n "version: " + python tools/getnodeversion.py + echo "category: release" + echo "title: Node v"$(python tools/getnodeversion.py)" ($NODE_STABC)" + echo "slug: node-v"$(python tools/getnodeversion.py | sed 's|\.|-|g')"-$NODE_STABL" + echo "" + cat email.md ) > doc/blog/release/v$(python tools/getnodeversion.py).md + +if [ "$stability" = "stable" ]; +then + ## this needs to happen here because the website depends on the current node + ## node version + make website-upload + make blog-upload + BRANCH="v$(python tools/getnodeversion.py | sed -E 's#\.[0-9]+$##')" +else + BRANCH="master" +fi + +echo "Merging back into $BRANCH" + +# merge back into mainline stable branch +git checkout $BRANCH +git merge --no-ff v$(python tools/getnodeversion.py)-release + +# change the version number, set isrelease = 0 +## TODO automagic. +vim src/node_version.h +git commit -am "Now working on "$(python tools/getnodeversion.py) + +if [ "$stability" = "stable" ]; +then + echo "Adding blog" + git add doc/blog + git commit -m "blog: Post for v$(python tools/getprevnodeversion.py)" +else + echo "copy blog to stable branch" +fi + +git push git@github.com:joyent/node $BRANCH