Skip to content

Commit bdc5881

Browse files
committed
Merge branch 'v0.10'
Conflicts: tools/test.py
2 parents 8db693a + 21bd456 commit bdc5881

19 files changed

+242
-90
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Resources for Newcomers
5151
- [nodejs.org](http://nodejs.org/)
5252
- [how to install node.js and npm (node package manager)](http://joyeur.com/2010/12/10/installing-node-and-npm/)
5353
- [list of modules](https://github.com/joyent/node/wiki/modules)
54-
- [searching the npm registry](http://search.npmjs.org/)
54+
- [searching the npm registry](http://npmjs.org/)
5555
- [list of companies and projects using node](https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node)
5656
- [node.js mailing list](http://groups.google.com/group/nodejs)
5757
- irc chatroom, [#node.js on freenode.net](http://webchat.freenode.net?channels=node.js&uio=d4)

doc/about/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<li><a href="/" class="home">Home</a></li>
2525
<li><a href="/download/" class="download">Download</a></li>
2626
<li><a href="/about/" class="about current">About</a></li>
27-
<li><a href="http://search.npmjs.org/" class="npm">npm Registry</a></li>
27+
<li><a href="http://npmjs.org/" class="npm">npm Registry</a></li>
2828
<li><a href="http://nodejs.org/api/" class="docs">Docs</a></li>
2929
<li><a href="http://blog.nodejs.org" class="blog">Blog</a></li>
3030
<li><a href="/community/" class="community">Community</a></li>
@@ -116,7 +116,7 @@ <h1>Node's goal is to provide an easy way to build scalable
116116
<li><a href="/">Node.js</a></li>
117117
<li><a href="/#download">Download</a></li>
118118
<li><a href="/about/">About</a></li>
119-
<li><a href="http://search.npmjs.org/">npm Registry</a></li>
119+
<li><a href="http://npmjs.org/">npm Registry</a></li>
120120
<li><a href="http://nodejs.org/api/">Docs</a></li>
121121
<li><a href="http://blog.nodejs.org">Blog</a></li>
122122
<li><a href="/community/">Community</a></li>

doc/api/child_process.markdown

-8
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,6 @@ See also: `child_process.exec()` and `child_process.fork()`
466466
* `command` {String} The command to run, with space-separated arguments
467467
* `options` {Object}
468468
* `cwd` {String} Current working directory of the child process
469-
* `stdio` {Array|String} Child's stdio configuration. (See above)
470-
Only stdin is configurable, anything else will lead to unpredictable
471-
results.
472-
* `customFds` {Array} **Deprecated** File descriptors for the child to use
473-
for stdio. (See above)
474469
* `env` {Object} Environment key-value pairs
475470
* `encoding` {String} (Default: 'utf8')
476471
* `timeout` {Number} (Default: 0)
@@ -524,9 +519,6 @@ the child process is killed.
524519
* `args` {Array} List of string arguments
525520
* `options` {Object}
526521
* `cwd` {String} Current working directory of the child process
527-
* `stdio` {Array|String} Child's stdio configuration. (See above)
528-
* `customFds` {Array} **Deprecated** File descriptors for the child to use
529-
for stdio. (See above)
530522
* `env` {Object} Environment key-value pairs
531523
* `encoding` {String} (Default: 'utf8')
532524
* `timeout` {Number} (Default: 0)

doc/api/stream.markdown

+4
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,10 @@ Emitted when the stream's write queue empties and it's safe to write
549549
without buffering again. Listen for it when `stream.write()` returns
550550
`false`.
551551
552+
### Event: 'error'
553+
554+
Emitted if there was an error receiving data.
555+
552556
### Event: 'close'
553557
554558
Emitted when the underlying resource (for example, the backing file

doc/blog.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
<li><a href="http://nodejs.org/about/" class="about">About</a></li>
8888

89-
<li><a href="http://search.npmjs.org/" class="npm">npm
89+
<li><a href="http://npmjs.org/" class="npm">npm
9090
Registry</a></li>
9191

9292
<li><a href="http://nodejs.org/api/" class="docs">Docs</a></li>
@@ -213,7 +213,7 @@ <h1><a href="<%=
213213
<li><a href="http://nodejs.org/">Node.js</a></li>
214214
<li><a href="http://nodejs.org/download/">Download</a></li>
215215
<li><a href="http://nodejs.org/about/">About</a></li>
216-
<li><a href="http://search.npmjs.org/">npm Registry</a></li>
216+
<li><a href="http://npmjs.org/">npm Registry</a></li>
217217
<li><a href="http://nodejs.org/api/">Docs</a></li>
218218
<li><a href="http://blog.nodejs.org">Blog</a></li>
219219
<li><a href="http://nodejs.org/community/">Community</a></li>

doc/blog/Uncategorized/version-0-6.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,19 @@ status: publish
55
category: Uncategorized
66
slug: version-0-6
77

8-
Version 0.6.0 will be released next week. Please spend some time this week upgrading your code to v0.5.10. Report any API differences at <a href="https://github.com/joyent/node/wiki/API-changes-between-v0.4-and-v0.6">https://github.com/joyent/node/wiki/API-changes-between-v0.4-and-v0.6</a> or report a bug to us at <a href="http://github.com/joyent/node/issues">http://github.com/joyent/node/issues</a> if you hit problems.
8+
Version 0.6.0 will be released next week. Please spend some time this
9+
week upgrading your code to v0.5.10. Report any API differences at <a
10+
href="https://github.com/joyent/node/wiki/API-changes-between-v0.4-and-v0.6">https://github.com/joyent/node/wiki/API-changes-between-v0.4-and-v0.6</a>
11+
or report a bug to us at <a
12+
href="http://github.com/joyent/node/issues">http://github.com/joyent/node/issues</a>
13+
if you hit problems.
914

10-
The API changes between v0.4.12 and v0.5.10 are 99% cosmetic, minor, and easy to fix. Most people are able to migrate their code in 10 minutes. Don't fear.
15+
The API changes between v0.4.12 and v0.5.10 are 99% cosmetic, minor,
16+
and easy to fix. Most people are able to migrate their code in 10
17+
minutes. Don't fear.
1118

12-
Once you've ported your code to v0.5.10 please help out by testing third party modules. Make bug reports. Encourage authors to publish new versions of their modules. Go through the list of modules at <a href="http://search.npmjs.org/">http://search.npmjs.org/</a> and try out random ones. This is especially encouraged of Windows users!
19+
Once you've ported your code to v0.5.10 please help out by testing
20+
third party modules. Make bug reports. Encourage authors to publish
21+
new versions of their modules. Go through the list of modules at <a
22+
href="http://npmjs.org/">http://npmjs.org/</a> and try out random
23+
ones. This is especially encouraged of Windows users!

doc/changelog-foot.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<li><a href="/">Node.js</a></li>
88
<li><a href="/download/">Download</a></li>
99
<li><a href="/about/">About</a></li>
10-
<li><a href="http://search.npmjs.org/">npm Registry</a></li>
10+
<li><a href="http://npmjs.org/">npm Registry</a></li>
1111
<li><a href="http://nodejs.org/api/">Docs</a></li>
1212
<li><a href="http://blog.nodejs.org">Blog</a></li>
1313
<li><a href="/community/">Community</a></li>

doc/changelog-head.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<li><a href="/" class="home">Home</a></li>
2020
<li><a href="/download/" class="download">Download</a></li>
2121
<li><a href="/about/" class="about">About</a></li>
22-
<li><a href="http://search.npmjs.org/" class="npm">npm Registry</a></li>
22+
<li><a href="http://npmjs.org/" class="npm">npm Registry</a></li>
2323
<li><a href="http://nodejs.org/api/" class="docs current">Docs</a></li>
2424
<li><a href="http://blog.nodejs.org" class="blog">Blog</a></li>
2525
<li><a href="/community/" class="community">Community</a></li>

doc/community/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<li><a href="/" class="home">Home</a></li>
2929
<li><a href="/download/" class="download">Download</a></li>
3030
<li><a href="/about/" class="about">About</a></li>
31-
<li><a href="http://search.npmjs.org/" class="npm">npm Registry</a></li>
31+
<li><a href="http://npmjs.org/" class="npm">npm Registry</a></li>
3232
<li><a href="http://nodejs.org/api/" class="docs">Docs</a></li>
3333
<li><a href="http://blog.nodejs.org" class="blog">Blog</a></li>
3434
<li><a href="/community/" class="community current">Community</a></li>
@@ -93,7 +93,7 @@ <h2 class="github">GitHub</h2>
9393
Projects, Applications, and Companies Using Node</a> or the
9494
<a href="https://github.com/joyent/node/wiki/modules">very long
9595
list of Node modules</a>, many of which are published in the
96-
<a href="http://search.npmjs.org/">npm registry</a>.
96+
<a href="http://npmjs.org/">npm registry</a>.
9797
</p>
9898
</div>
9999
</div>
@@ -223,7 +223,7 @@ <h2 class="irc">IRC</h2>
223223
<li><a href="/">Node.js</a></li>
224224
<li><a href="/download/">Download</a></li>
225225
<li><a href="/about/">About</a></li>
226-
<li><a href="http://search.npmjs.org/">npm Registry</a></li>
226+
<li><a href="http://npmjs.org/">npm Registry</a></li>
227227
<li><a href="http://nodejs.org/api/">Docs</a></li>
228228
<li><a href="http://blog.nodejs.org">Blog</a></li>
229229
<li><a href="/community/">Community</a></li>

doc/download/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<li><a href="/" class="home">Home</a></li>
2525
<li><a href="/download/" class="download current">Download</a></li>
2626
<li><a href="/about/" class="about">About</a></li>
27-
<li><a href="http://search.npmjs.org/" class="npm">npm Registry</a></li>
27+
<li><a href="http://npmjs.org/" class="npm">npm Registry</a></li>
2828
<li><a href="http://nodejs.org/api/" class="docs">Docs</a></li>
2929
<li><a href="http://blog.nodejs.org" class="blog">Blog</a></li>
3030
<li><a href="/community/" class="community">Community</a></li>
@@ -162,7 +162,7 @@ <h2 id="license">License</h2>
162162
<li><a href="/">Node.js</a></li>
163163
<li><a href="/download/">Download</a></li>
164164
<li><a href="/about/">About</a></li>
165-
<li><a href="http://search.npmjs.org/">npm Registry</a></li>
165+
<li><a href="http://npmjs.org/">npm Registry</a></li>
166166
<li><a href="http://nodejs.org/api/">Docs</a></li>
167167
<li><a href="http://blog.nodejs.org">Blog</a></li>
168168
<li><a href="/community/">Community</a></li>

doc/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ <h2>Featured</h2>
118118
<h2>Explore Node.js</h2>
119119
<ul id="explore">
120120
<li><a href="about/" class="explore">About</a><br><span>Technical overview</span></li>
121-
<li><a href="http://search.npmjs.org/" class="explore">npm Registry</a><br><span>Modules, resources and more</span></li>
121+
<li><a href="http://npmjs.org/" class="explore">npm Registry</a><br><span>Modules, resources and more</span></li>
122122
<li><a href="http://nodejs.org/api/" class="explore">Documentation</a><br><span>API Specifications</span></li>
123123
<li><a href="http://blog.nodejs.org" class="explore">Node.js Blog</a><br><span>Insight, perspective and events</span></li>
124124
<li><a href="community/" class="explore">Community</a><br><span>Mailing lists, blogs, and more</span></li>
@@ -134,7 +134,7 @@ <h2>Explore Node.js</h2>
134134
<li><a href="/">Node.js</a></li>
135135
<li><a href="/download/">Download</a></li>
136136
<li><a href="/about/">About</a></li>
137-
<li><a href="http://search.npmjs.org/">npm Registry</a></li>
137+
<li><a href="http://npmjs.org/">npm Registry</a></li>
138138
<li><a href="http://nodejs.org/api/">Docs</a></li>
139139
<li><a href="http://blog.nodejs.org">Blog</a></li>
140140
<li><a href="/community/">Community</a></li>

doc/logos/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<li><a href="/" class="home">Home</a></li>
2525
<li><a href="/#download" class="download">Download</a></li>
2626
<li><a href="/about/" class="about">About</a></li>
27-
<li><a href="http://search.npmjs.org/" class="npm">npm Registry</a></li>
27+
<li><a href="http://npmjs.org/" class="npm">npm Registry</a></li>
2828
<li><a href="http://nodejs.org/api/" class="docs">Docs</a></li>
2929
<li><a href="http://blog.nodejs.org" class="blog">Blog</a></li>
3030
<li><a href="/community/" class="community">Community</a></li>
@@ -68,7 +68,7 @@ <h2>Desktop Background</h2>
6868
<li><a href="/">Node.js</a></li>
6969
<li><a href="/#download">Download</a></li>
7070
<li><a href="/about/">About</a></li>
71-
<li><a href="http://search.npmjs.org/">npm Registry</a></li>
71+
<li><a href="http://npmjs.org/">npm Registry</a></li>
7272
<li><a href="http://nodejs.org/api/">Docs</a></li>
7373
<li><a href="http://blog.nodejs.org">Blog</a></li>
7474
<li><a href="/community/">Community</a></li>

doc/template.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<li><a href="/" class="home">Home</a></li>
2020
<li><a href="/download/" class="download">Download</a></li>
2121
<li><a href="/about/" class="about">About</a></li>
22-
<li><a href="http://search.npmjs.org/" class="npm">npm Registry</a></li>
22+
<li><a href="http://npmjs.org/" class="npm">npm Registry</a></li>
2323
<li><a href="http://nodejs.org/api/" class="docs current">Docs</a></li>
2424
<li><a href="http://blog.nodejs.org" class="blog">Blog</a></li>
2525
<li><a href="/community/" class="community">Community</a></li>
@@ -58,7 +58,7 @@ <h2>Table of Contents</h2>
5858
<li><a href="/">Node.js</a></li>
5959
<li><a href="/download/">Download</a></li>
6060
<li><a href="/about/">About</a></li>
61-
<li><a href="http://search.npmjs.org/">npm Registry</a></li>
61+
<li><a href="http://npmjs.org/">npm Registry</a></li>
6262
<li><a href="http://nodejs.org/api/">Docs</a></li>
6363
<li><a href="http://blog.nodejs.org">Blog</a></li>
6464
<li><a href="/community/">Community</a></li>

lib/_stream_readable.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -759,15 +759,14 @@ Readable.prototype.wrap = function(stream) {
759759
if (chunk && chunk.length)
760760
self.push(chunk);
761761
}
762-
state.ended = true;
763762

764763
self.push(null);
765764
});
766765

767766
stream.on('data', function(chunk) {
768767
if (state.decoder)
769768
chunk = state.decoder.write(chunk);
770-
if (!chunk || !chunk.length)
769+
if (!chunk || !state.objectMode && !chunk.length)
771770
return;
772771

773772
var ret = self.push(chunk);

lib/child_process.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,13 @@ function setupChannel(target, channel) {
336336
var json = jsonBuffer.slice(start, i);
337337
var message = JSON.parse(json);
338338

339-
handleMessage(target, message, recvHandle);
340-
recvHandle = undefined;
339+
// There will be at most one NODE_HANDLE message in every chunk we
340+
// read because SCM_RIGHTS messages don't get coalesced. Make sure
341+
// that we deliver the handle with the right message however.
342+
if (message && message.cmd === 'NODE_HANDLE')
343+
handleMessage(target, message, recvHandle);
344+
else
345+
handleMessage(target, message, undefined);
341346

342347
start = i + 1;
343348
}

test/pummel/test-net-many-clients.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ for (var i = 0; i < bytes; i++) {
3737
}
3838

3939
var server = net.createServer(function(c) {
40-
c.on('connect', function() {
41-
total_connections++;
42-
common.print('#');
43-
c.write(body);
44-
c.end();
45-
});
40+
console.log('connected');
41+
total_connections++;
42+
common.print('#');
43+
c.write(body);
44+
c.end();
4645
});
4746

4847
function runClient(callback) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Copyright Joyent, Inc. and other Node contributors.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a
4+
// copy of this software and associated documentation files (the
5+
// "Software"), to deal in the Software without restriction, including
6+
// without limitation the rights to use, copy, modify, merge, publish,
7+
// distribute, sublicense, and/or sell copies of the Software, and to permit
8+
// persons to whom the Software is furnished to do so, subject to the
9+
// following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included
12+
// in all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
22+
// Test that a Linux specific quirk in the handle passing protocol is handled
23+
// correctly. See https://github.com/joyent/node/issues/5330 for details.
24+
25+
var common = require('../common');
26+
var assert = require('assert');
27+
var net = require('net');
28+
var spawn = require('child_process').spawn;
29+
30+
if (process.argv[2] === 'worker')
31+
worker();
32+
else
33+
master();
34+
35+
function master() {
36+
// spawn() can only create one IPC channel so we use stdin/stdout as an
37+
// ad-hoc command channel.
38+
var proc = spawn(process.execPath, [__filename, 'worker'], {
39+
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
40+
});
41+
var handle = null;
42+
proc.on('exit', function() {
43+
handle.close();
44+
});
45+
proc.stdout.on('data', function(data) {
46+
assert.equal(data, 'ok\r\n');
47+
net.createServer(assert.fail).listen(common.PORT, function() {
48+
handle = this._handle;
49+
proc.send('one');
50+
proc.send('two', handle);
51+
proc.send('three');
52+
proc.stdin.write('ok\r\n');
53+
});
54+
});
55+
proc.stderr.pipe(process.stderr);
56+
}
57+
58+
function worker() {
59+
process._channel.readStop(); // Make messages batch up.
60+
process.stdout.ref();
61+
process.stdout.write('ok\r\n');
62+
process.stdin.once('data', function(data) {
63+
assert.equal(data, 'ok\r\n');
64+
process._channel.readStart();
65+
});
66+
var n = 0;
67+
process.on('message', function(msg, handle) {
68+
n += 1;
69+
if (n === 1) {
70+
assert.equal(msg, 'one');
71+
assert.equal(handle, undefined);
72+
}
73+
else if (n === 2) {
74+
assert.equal(msg, 'two');
75+
assert.equal(typeof handle, 'object'); // Also matches null, therefore...
76+
assert.ok(handle); // also check that it's truthy.
77+
handle.close();
78+
}
79+
else if (n === 3) {
80+
assert.equal(msg, 'three');
81+
assert.equal(handle, undefined);
82+
process.exit();
83+
}
84+
});
85+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright Joyent, Inc. and other Node contributors.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a
4+
// copy of this software and associated documentation files (the
5+
// "Software"), to deal in the Software without restriction, including
6+
// without limitation the rights to use, copy, modify, merge, publish,
7+
// distribute, sublicense, and/or sell copies of the Software, and to permit
8+
// persons to whom the Software is furnished to do so, subject to the
9+
// following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included
12+
// in all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
22+
var common = require('../common');
23+
var assert = require('assert');
24+
25+
var Readable = require('_stream_readable');
26+
var EE = require('events').EventEmitter;
27+
28+
var oldStream = new EE();
29+
oldStream.pause = function(){};
30+
oldStream.resume = function(){};
31+
32+
var newStream = new Readable().wrap(oldStream);
33+
34+
var ended = false;
35+
newStream
36+
.on('readable', function(){})
37+
.on('end', function(){ ended = true; });
38+
39+
oldStream.emit('end');
40+
41+
process.on('exit', function(){
42+
assert.ok(ended);
43+
});

0 commit comments

Comments
 (0)