Make sure meteor shell options JSON is parsed separately.

Also don't ignore the `error` parameter passed to the readJSONFromStream
callback function.

Fixes #7312.
This commit is contained in:
Ben Newman
2016-06-28 20:50:15 -04:00
parent 1783559b56
commit c91a95cbef
2 changed files with 7 additions and 1 deletions

View File

@@ -134,7 +134,7 @@ Cp.setUpSocket = function setUpSocket(sock, key) {
sock.write(JSON.stringify({
terminal: ! process.env.EMACS,
key: key
}));
}) + "\n");
process.stderr.write(shellBanner());
process.stdin.pipe(sock);

View File

@@ -161,6 +161,12 @@ Sp.onConnection = function onConnection(socket) {
readJSONFromStream(socket, function (error, options, replInputSocket) {
clearTimeout(timeout);
if (error) {
socket = null;
console.error(error.stack);
return;
}
if (options.key !== self.key) {
if (socket) {
socket.end(EXITING_MESSAGE + "\n");