Skip to content

Commit cb87920

Browse files
committed
Merge remote-tracking branch 'origin/v0.8'
Conflicts: AUTHORS ChangeLog deps/uv/src/unix/pipe.c lib/http.js src/node_version.h
2 parents 0c1e7b5 + d879042 commit cb87920

File tree

10 files changed

+230
-23
lines changed

10 files changed

+230
-23
lines changed

Diff for: AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -415,3 +415,4 @@ Andy Burke <[email protected]>
415415
Sugendran Ganess <[email protected]>
416416
Jim Schubert <[email protected]>
417417
Victor Costan <[email protected]>
418+
Timothy J Fontaine <[email protected]>

Diff for: ChangeLog

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2013.02.25, Version 0.8.21 (Stable)
2+
3+
* http: Do not free the wrong parser on socket close (isaacs)
4+
5+
* http: Handle hangup writes more gently (isaacs)
6+
7+
* zlib: fix assert on bad input (Ben Noordhuis)
8+
9+
* test: add TAP output to the test runner (Timothy J Fontaine)
10+
11+
* unix: Handle EINPROGRESS from domain sockets (Ben Noordhuis)
12+
13+
114
2013.02.19, Version 0.9.10 (Unstable)
215

316
* V8: Upgrade to 3.15.11.15

Diff for: common.gypi

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
'WarningLevel': 3,
122122
'BufferSecurityCheck': 'true',
123123
'ExceptionHandling': 1, # /EHsc
124+
'ImageHasSafeExceptionHandlers': 0, # /SAFESEH:NO
124125
'SuppressStartupBanner': 'true',
125126
'WarnAsError': 'false',
126127
},

Diff for: doc/api/child_process.markdown

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Node provides a tri-directional `popen(3)` facility through the
66
`child_process` module.
77

88
It is possible to stream data through a child's `stdin`, `stdout`, and
9-
`stderr` in a fully non-blocking way.
9+
`stderr` in a fully non-blocking way. (Note that some programs use
10+
line-buffered I/O internally. That doesn't affect node.js but it means
11+
data you send to the child process is not immediately consumed.)
1012

1113
To create a child process use `require('child_process').spawn()` or
1214
`require('child_process').fork()`. The semantics of each are slightly

Diff for: doc/blog/release/v0.8.21.md

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
date: Mon Feb 25 13:48:51 PST 2013
2+
version: 0.8.21
3+
category: release
4+
title: Node v0.8.21 (Stable)
5+
slug: node-v0-8-21-stable
6+
7+
2013.02.25, Version 0.8.21 (Stable)
8+
9+
* http: Do not free the wrong parser on socket close (isaacs)
10+
11+
* http: Handle hangup writes more gently (isaacs)
12+
13+
* zlib: fix assert on bad input (Ben Noordhuis)
14+
15+
* test: add TAP output to the test runner (Timothy J Fontaine)
16+
17+
* unix: Handle EINPROGRESS from domain sockets (Ben Noordhuis)
18+
19+
20+
Source Code: http://nodejs.org/dist/v0.8.21/node-v0.8.21.tar.gz
21+
22+
Macintosh Installer (Universal): http://nodejs.org/dist/v0.8.21/node-v0.8.21.pkg
23+
24+
Windows Installer: http://nodejs.org/dist/v0.8.21/node-v0.8.21-x86.msi
25+
26+
Windows x64 Installer: http://nodejs.org/dist/v0.8.21/x64/node-v0.8.21-x64.msi
27+
28+
Windows x64 Files: http://nodejs.org/dist/v0.8.21/x64/
29+
30+
Linux 32-bit Binary: http://nodejs.org/dist/v0.8.21/node-v0.8.21-linux-x86.tar.gz
31+
32+
Linux 64-bit Binary: http://nodejs.org/dist/v0.8.21/node-v0.8.21-linux-x64.tar.gz
33+
34+
Solaris 32-bit Binary: http://nodejs.org/dist/v0.8.21/node-v0.8.21-sunos-x86.tar.gz
35+
36+
Solaris 64-bit Binary: http://nodejs.org/dist/v0.8.21/node-v0.8.21-sunos-x64.tar.gz
37+
38+
Other release files: http://nodejs.org/dist/v0.8.21/
39+
40+
Website: http://nodejs.org/docs/v0.8.21/
41+
42+
Documentation: http://nodejs.org/docs/v0.8.21/api/
43+
44+
Shasums:
45+
```
46+
383b9009a587b7390a5a00cef4ece441fb16dd82 node-v0.8.21-darwin-x64.tar.gz
47+
47654ca8ecc93c846e6f7493a19931b99d5e4b87 node-v0.8.21-darwin-x86.tar.gz
48+
46d66f3b95f447811e9253d66050859b4bb81ea0 node-v0.8.21-linux-x64.tar.gz
49+
1f16e50dacd5e942970c28be1e578e6260a116c4 node-v0.8.21-linux-x86.tar.gz
50+
b24b5e0acc53f004122c0cb2df775c4493b1e048 node-v0.8.21-sunos-x64.tar.gz
51+
54ca0c94dff35e941fe90d10755427a15d6519ae node-v0.8.21-sunos-x86.tar.gz
52+
38c5855c1ebd70fde111d50343a163a03cff9765 node-v0.8.21-x86.msi
53+
60cd1fb8f43943bd3ed7c07745df1b3e81bafc13 node-v0.8.21.pkg
54+
8b75377eafb5e77d6dff141c9533202d5a589ce4 node-v0.8.21.tar.gz
55+
c310779c80d21be7556ec0921d5afca8f64792eb node.exe
56+
61b98f9dfbe70184788b6f010ce7667c9cba0fdc node.exp
57+
78c37ac837bbb8fefd691e351b3c20f136b212ee node.lib
58+
40cc197db5c9fc4ded4509b5ae21bc53d178998e node.pdb
59+
ec29a824e51308349f7895c010469f8e59939094 x64/node-v0.8.21-x64.msi
60+
e4c5563c38a01dac1a97f6366175d1fef86da262 x64/node.exe
61+
8e51783d5e03148f01db8386102e4ffc4e30deda x64/node.exp
62+
a6017052052bb469a50327b4f40c990c25da0932 x64/node.lib
63+
fb8d24e5208b14d35997bc3b46e325316e6ad94d x64/node.pdb
64+
```
65+
66+
Shasums:
67+
```
68+
62cd69928ce2da9e8512b3efb96aba353ee54a91 node-v0.8.21-darwin-x64.tar.gz
69+
62cf9b990f8e424e7fdb1d50a46d779e4d508b23 node-v0.8.21-darwin-x86.tar.gz
70+
83e92aec4f4a0167e7c5b3ef04388fc33712d97b node-v0.8.21-linux-x64.tar.gz
71+
83a8aa10dafa196b372958d1052f61fe1c16c2a4 node-v0.8.21-linux-x86.tar.gz
72+
588830b0d095c0ef3583d9f7f574426f5b456e2e node-v0.8.21-sunos-x64.tar.gz
73+
e4eff5914432da3cf12a833aaa0444693671cca1 node-v0.8.21-sunos-x86.tar.gz
74+
8146b2254caa814157aa511075dcf7b42d0ecb59 node-v0.8.21-x86.msi
75+
60cd1fb8f43943bd3ed7c07745df1b3e81bafc13 node-v0.8.21.pkg
76+
65ab7307f1aee12be4c88e396e2510967a52b1c6 node-v0.8.21.tar.gz
77+
5d770ad554ee4a73278b2d90029e758e0a676074 node.exe
78+
17514f32c57c64bd0d367c71ed0e6dc399fc9e12 node.exp
79+
9404eff8562dfb0a6e0e72167278ac6131be5d3a node.lib
80+
94908174f715d2707d48e6d53a1f96f33059f56c node.pdb
81+
36750abf56120a63d9fa9b2b75bdc98dfac051f7 x64/node-v0.8.21-x64.msi
82+
b61b9620e936bc9c19043a02625aed9922aeb653 x64/node.exe
83+
21a0e855e652e7fbe84e7efc1f7a3542fa870372 x64/node.exp
84+
f9d017c07030599e3442a958020381a37402dc81 x64/node.lib
85+
3b35fbac0962aaff46bdd2f06412dcb1f80b9895 x64/node.pdb
86+
```

Diff for: doc/blog/release/v0.9.10.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
category: release
2+
date: Tue Feb 19 14:00:08 PST 2013
3+
slug: node-v0-9-10-unstable
4+
title: Node v0.9.10 (Unstable)
5+
version: 0.9.10
6+
7+
2013.02.19, Version 0.9.10 (Unstable)
8+
9+
* V8: Upgrade to 3.15.11.15
10+
11+
* npm: Upgrade to 1.2.12
12+
13+
* fs: Change default WriteStream config, increase perf (isaacs)
14+
15+
* process: streamlining tick callback logic (Trevor Norris)
16+
17+
* stream_wrap, udp_wrap: add read-only fd property (Ben Noordhuis)
18+
19+
* buffer: accept negative indices in Buffer#slice() (Ben Noordhuis)
20+
21+
* tls: Cycle data when underlying socket drains (isaacs)
22+
23+
* stream: read(0) should not always trigger _read(n,cb) (isaacs)
24+
25+
* stream: Empty strings/buffers do not signal EOF any longer (isaacs)
26+
27+
* crypto: improve cipher/decipher error messages (Ben Noordhuis)
28+
29+
* net: Respect the 'readable' flag on sockets (isaacs)
30+
31+
* net: don't suppress ECONNRESET (Ben Noordhuis)
32+
33+
* typed arrays: copy Buffer in typed array constructor (Ben Noordhuis)
34+
35+
* typed arrays: make DataView throw on non-ArrayBuffer (Ben Noordhuis)
36+
37+
* windows: MSI installer enhancements (Scott Blomquist, Jim Schubert)
38+
39+
40+
Source Code: http://nodejs.org/dist/v0.9.10/node-v0.9.10.tar.gz
41+
42+
Macintosh Installer (Universal): http://nodejs.org/dist/v0.9.10/node-v0.9.10.pkg
43+
44+
Windows Installer: http://nodejs.org/dist/v0.9.10/node-v0.9.10-x86.msi
45+
46+
Windows x64 Installer: http://nodejs.org/dist/v0.9.10/x64/node-v0.9.10-x64.msi
47+
48+
Windows x64 Files: http://nodejs.org/dist/v0.9.10/x64/
49+
50+
Linux 32-bit Binary: http://nodejs.org/dist/v0.9.10/node-v0.9.10-linux-x86.tar.gz
51+
52+
Linux 64-bit Binary: http://nodejs.org/dist/v0.9.10/node-v0.9.10-linux-x64.tar.gz
53+
54+
Solaris 32-bit Binary: http://nodejs.org/dist/v0.9.10/node-v0.9.10-sunos-x86.tar.gz
55+
56+
Solaris 64-bit Binary: http://nodejs.org/dist/v0.9.10/node-v0.9.10-sunos-x64.tar.gz
57+
58+
Other release files: http://nodejs.org/dist/v0.9.10/
59+
60+
Website: http://nodejs.org/docs/v0.9.10/
61+
62+
Documentation: http://nodejs.org/docs/v0.9.10/api/
63+
64+
Shasums:
65+
```
66+
813d5f42b156b7d64f00b86e13d26ada3ef352e5 node-v0.9.10-darwin-x64.tar.gz
67+
99dbe66fd0fc176fb3459ffcf62212dcb27bef10 node-v0.9.10-darwin-x86.tar.gz
68+
3a5a465238cbdbdac9786c204fd27be61ce7159a node-v0.9.10-linux-x64.tar.gz
69+
3340ac206ec1a1f827c954efdfa1351dcfe9f419 node-v0.9.10-linux-x86.tar.gz
70+
b920b2e57c6df1e080966fdeccbfd1b384b156d4 node-v0.9.10-sunos-x64.tar.gz
71+
9c1744352bb1bc71f48f8aea1aff6aeefe35a394 node-v0.9.10-sunos-x86.tar.gz
72+
f1daaafc330cc9993a3a6f7ca8b9cc870b49e75c node-v0.9.10-x86.msi
73+
2b6c70f57c1513e8f5151785b1ac263565983918 node-v0.9.10.pkg
74+
265542c15cf939b7c71a545758d835ed44d791d3 node-v0.9.10.tar.gz
75+
653f24d53f411217d57ed18d73921ff4721f00dd node.exe
76+
7d62da67a7b33628d7d90c9d5037cf564dfc5ce4 node.exp
77+
cfebbcd81db602b2f051328a9924e19ca2cb6235 node.lib
78+
a31694cb9e03d13a616f3cc634852d8dc98e69b8 node.pdb
79+
5f94c1cc9301a8b85082fee7549aa376aedd8ec5 x64/node-v0.9.10-x64.msi
80+
7716c01ce60f7c65100cc405726badf8476afebd x64/node.exe
81+
121d4a721968ba4631d29de07e5d6c326d259b4b x64/node.exp
82+
17f651000f6b0c840efe539ae5257cb894481c49 x64/node.lib
83+
d04242a5ec3a3104931ec8de6a846a8f7746b1fd x64/node.pdb
84+
```

Diff for: doc/index.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ <h2>An example: Webserver</h2>
8989
}).listen(1337, '127.0.0.1');
9090
console.log('Server running at http://127.0.0.1:1337/');</pre>
9191

92-
<p>To run the server, put the code into a file <code>example.js</code> and execute it with the <code>node</code> program:</p>
92+
<p>To run the server, put the code into a file
93+
<code>example.js</code> and execute it with the
94+
<code>node</code> program from the command line:</p>
9395
<pre class="sh_none">
9496
% node example.js
9597
Server running at http://127.0.0.1:1337/</pre>

Diff for: lib/http.js

+20-8
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ function OutgoingMessage() {
437437
this._trailer = '';
438438

439439
this.finished = false;
440+
this._hangupClose = false;
440441
}
441442
util.inherits(OutgoingMessage, Stream);
442443

@@ -491,14 +492,24 @@ OutgoingMessage.prototype._writeRaw = function(data, encoding) {
491492
return this.connection.write(data, encoding);
492493
} else if (this.connection && this.connection.destroyed) {
493494
// The socket was destroyed. If we're still trying to write to it,
494-
// then something bad happened.
495-
// If we've already raised an error on this message, then just ignore.
496-
// XXX This was necessary in v0.8, but in v0.10, we no longer ignore
497-
// ECONNRESET anyway. Is this still required?
498-
if (!this._hadError) {
499-
this.emit('error', createHangUpError());
500-
this._hadError = true;
495+
// then something bad happened, but it could be just that we haven't
496+
// gotten the 'close' event yet.
497+
//
498+
// In v0.10 and later, this isn't a problem, since ECONNRESET isn't
499+
// ignored in the first place. We'll probably emit 'close' on the
500+
// next tick, but just in case it's not coming, set a timeout that
501+
// will emit it for us.
502+
if (!this._hangupClose) {
503+
this._hangupClose = true;
504+
var socket = this.socket;
505+
var timer = setTimeout(function() {
506+
socket.emit('close');
507+
});
508+
socket.on('close', function() {
509+
clearTimeout(timer);
510+
});
501511
}
512+
return false;
502513
} else {
503514
// buffer, as long as we're not destroyed.
504515
this._buffer(data, encoding);
@@ -1810,7 +1821,8 @@ function connectionListener(socket) {
18101821
function serverSocketCloseListener() {
18111822
debug('server socket close');
18121823
// mark this parser as reusable
1813-
freeParser(parser);
1824+
if (this.parser)
1825+
freeParser(this.parser);
18141826

18151827
abortIncoming();
18161828
}

Diff for: src/node_zlib.cc

+18-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,22 @@ void InitZlib(v8::Handle<v8::Object> target);
5959
class ZCtx : public ObjectWrap {
6060
public:
6161

62-
ZCtx(node_zlib_mode mode) : ObjectWrap(), dictionary_(NULL), mode_(mode) {}
62+
ZCtx(node_zlib_mode mode)
63+
: ObjectWrap()
64+
, init_done_(false)
65+
, level_(0)
66+
, windowBits_(0)
67+
, memLevel_(0)
68+
, strategy_(0)
69+
, err_(0)
70+
, dictionary_(NULL)
71+
, dictionary_len_(0)
72+
, flush_(0)
73+
, chunk_size_(0)
74+
, write_in_progress_(false)
75+
, mode_(mode)
76+
{
77+
}
6378

6479

6580
~ZCtx() {
@@ -108,6 +123,7 @@ class ZCtx : public ObjectWrap {
108123

109124
assert(!ctx->write_in_progress_ && "write already in progress");
110125
ctx->write_in_progress_ = true;
126+
ctx->Ref();
111127

112128
assert(!args[0]->IsUndefined() && "must provide flush value");
113129

@@ -167,8 +183,6 @@ class ZCtx : public ObjectWrap {
167183
ZCtx::Process,
168184
ZCtx::After);
169185

170-
ctx->Ref();
171-
172186
return ctx->handle_;
173187
}
174188

@@ -283,6 +297,7 @@ class ZCtx : public ObjectWrap {
283297
MakeCallback(ctx->handle_, onerror_sym, ARRAY_SIZE(args), args);
284298

285299
// no hope of rescue.
300+
ctx->write_in_progress_ = false;
286301
ctx->Unref();
287302
}
288303

Diff for: test/simple/test-http-destroyed-socket-write.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,6 @@ server.listen(common.PORT, function() {
7575
var writes = 0;
7676
var sawFalseWrite;
7777

78-
var gotError = false;
79-
sec.on('error', function(er) {
80-
assert.equal(gotError, false);
81-
gotError = true;
82-
assert(er.code === 'ECONNRESET');
83-
clearTimeout(timer);
84-
test();
85-
});
86-
8778
function write() {
8879
if (++writes === 64) {
8980
clearTimeout(timer);
@@ -121,7 +112,7 @@ server.listen(common.PORT, function() {
121112
console.error('bad happened', sec.output, sec.outputEncodings);
122113
assert.equal(sec.output.length, 0);
123114
assert.equal(sec.outputEncodings, 0);
124-
assert(gotError);
115+
assert(sawFalseWrite);
125116
assert(gotFirstResponse);
126117
assert(gotFirstData);
127118
assert(gotFirstEnd);

0 commit comments

Comments
 (0)