summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2013-05-13 11:13:39 -0700
committerBert Belder <bertbelder@gmail.com>2013-05-13 11:13:39 -0700
commitbdc58811693fd4454b5c99cbbbdaddbce3950f6f (patch)
tree982ab861e3dd1c941bb5ad0782840669a8c4caf1 /lib
parent8db693a87e324d2354d253990e3f75a149c029e3 (diff)
parent21bd45676390fd21ffa7c3cca91af4ad37ed3e5c (diff)
downloadandroid-node-v8-bdc58811693fd4454b5c99cbbbdaddbce3950f6f.tar.gz
android-node-v8-bdc58811693fd4454b5c99cbbbdaddbce3950f6f.tar.bz2
android-node-v8-bdc58811693fd4454b5c99cbbbdaddbce3950f6f.zip
Merge branch 'v0.10'
Conflicts: tools/test.py
Diffstat (limited to 'lib')
-rw-r--r--lib/_stream_readable.js3
-rw-r--r--lib/child_process.js9
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
index 070628288e..07bd8b046e 100644
--- a/lib/_stream_readable.js
+++ b/lib/_stream_readable.js
@@ -759,7 +759,6 @@ Readable.prototype.wrap = function(stream) {
if (chunk && chunk.length)
self.push(chunk);
}
- state.ended = true;
self.push(null);
});
@@ -767,7 +766,7 @@ Readable.prototype.wrap = function(stream) {
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);
diff --git a/lib/child_process.js b/lib/child_process.js
index 1b6b8b21d6..f7312215cd 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -336,8 +336,13 @@ function setupChannel(target, channel) {
var json = jsonBuffer.slice(start, i);
var message = JSON.parse(json);
- handleMessage(target, message, recvHandle);
- recvHandle = undefined;
+ // There will be at most one NODE_HANDLE message in every chunk we
+ // read because SCM_RIGHTS messages don't get coalesced. Make sure
+ // that we deliver the handle with the right message however.
+ if (message && message.cmd === 'NODE_HANDLE')
+ handleMessage(target, message, recvHandle);
+ else
+ handleMessage(target, message, undefined);
start = i + 1;
}