Updated MeshAgents, all except FreeBSD and MacOS.

Ylian Saint-Hilaire committed Jan 30, 2020 at 14:31 UTC efb7ac9dba28047245fd72e9bf2f85538a295880
20 files changed +44 -6
agents/MeshCmd-signed.exe
Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ
agents/MeshCmd64-signed.exe
Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ
agents/MeshService-signed.exe
Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ
agents/MeshService.exe
Binary files a/agents/MeshService.exe and b/agents/MeshService.exe differ
agents/MeshService64-signed.exe
Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ
agents/MeshService64.exe
Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ
agents/meshagent_arm
Binary files a/agents/meshagent_arm and b/agents/meshagent_arm differ
agents/meshagent_arm64
Binary files a/agents/meshagent_arm64 and b/agents/meshagent_arm64 differ
agents/meshagent_armhf
Binary files a/agents/meshagent_armhf and b/agents/meshagent_armhf differ
agents/meshagent_mips
Binary files a/agents/meshagent_mips and b/agents/meshagent_mips differ
agents/meshagent_pogo
Binary files a/agents/meshagent_pogo and b/agents/meshagent_pogo differ
agents/meshagent_poky
Binary files a/agents/meshagent_poky and b/agents/meshagent_poky differ
agents/meshagent_poky64
Binary files a/agents/meshagent_poky64 and b/agents/meshagent_poky64 differ
agents/meshagent_x86
Binary files a/agents/meshagent_x86 and b/agents/meshagent_x86 differ
agents/meshagent_x86-64
Binary files a/agents/meshagent_x86-64 and b/agents/meshagent_x86-64 differ
agents/meshagent_x86-64_nokvm
Binary files a/agents/meshagent_x86-64_nokvm and b/agents/meshagent_x86-64_nokvm differ
agents/meshagent_x86_nokvm
Binary files a/agents/meshagent_x86_nokvm and b/agents/meshagent_x86_nokvm differ
agents/meshcore.js
-1
@@ -1165,7 +1165,6 @@ function createMeshCore(agent) {
1165 this.httprequest._dispatcher.ws = this;
1166 this.httprequest._dispatcher.on('connection', function (c)
1167 {
1168 - console.log('client connected');
1168 this.ws._term = c;
1169 c.pipe(this.ws, { dataTypeSkip: 1 });
1170 this.ws.pipe(c, { dataTypeSkip: 1 });
agents/modules_meshcore/win-terminal.js
+4
@@ -146,6 +146,10 @@ function windows_terminal() {
146
147 this.StartEx = function Start(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, terminalTarget)
148 {
149 + // The older windows terminal does not support
150 + CONSOLE_SCREEN_WIDTH = 80;
151 + CONSOLE_SCREEN_HEIGHT = 25;
152 +
153 if (this._stream != null)
154 {
155 throw ('Concurrent terminal sessions are not supported on Windows.');
agents/modules_meshcore/win-virtual-terminal.js
+40 -5
@@ -1,5 +1,5 @@
1 /*
2 -Copyright 2019-2020 Intel Corporation
2 +Copyright 2019 Intel Corporation
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
@@ -47,12 +47,16 @@ function vt()
47
48 var GM = require('_GenericMarshal');
49 var k32 = GM.CreateNativeProxy('kernel32.dll');
50 + k32.CreateMethod('CancelIoEx');
51 k32.CreateMethod('CreatePipe');
52 k32.CreateMethod('CreateProcessW');
53 k32.CreateMethod('CreatePseudoConsole');
54 + k32.CreateMethod('CloseHandle');
55 + k32.CreateMethod('ClosePseudoConsole');
56 k32.CreateMethod('GetProcessHeap');
57 k32.CreateMethod('HeapAlloc');
58 k32.CreateMethod('InitializeProcThreadAttributeList');
59 + k32.CreateMethod('ResizePseudoConsole');
60 k32.CreateMethod('UpdateProcThreadAttribute');
61 k32.CreateMethod('WriteFile');
62 k32.CreateMethod('ReadFile');
@@ -101,16 +105,46 @@ function vt()
105 {
106 if (this.terminal._process)
107 {
104 - this.terminal.k32.TerminateProcess(this.terminal._process, 0);
108 this.terminal._process = null;
106 - this.terminal.k32.ReadFile.async.abort();
109 + k32.ClosePseudoConsole(this._obj._h.Deref());
110 }
111 flush();
112 }
113 });
114 + ds._obj = ret;
115 ret._waiter = require('DescriptorEvents').addDescriptor(pi.Deref(0));
116 ret._waiter.ds = ds;
113 - ret._waiter.on('signaled', function () { this.ds.push(null); });
117 + ret._waiter._obj = ret;
118 + ret._waiter.on('signaled', function ()
119 + {
120 + k32.CancelIoEx(this._obj._output.Deref(), 0);
121 +
122 + // Child process has exited
123 + this.ds.push(null);
124 +
125 + if (this._obj._process)
126 + {
127 + this._obj._process = null;
128 + k32.ClosePseudoConsole(this._obj._h.Deref());
129 + }
130 + k32.CloseHandle(this._obj._input.Deref());
131 + k32.CloseHandle(this._obj._output.Deref());
132 +
133 + k32.CloseHandle(this._obj._consoleInput.Deref());
134 + k32.CloseHandle(this._obj._consoleOutput.Deref());
135 + });
136 + ds.resizeTerminal = function (w, h)
137 + {
138 + console.setDestination(console.Destinations.LOGFILE);
139 + console.log('resizeTerminal(' + w + ', ' + h + ')');
140 + var hr;
141 + if((hr=k32.ResizePseudoConsole(this._obj._h.Deref(), (h << 16) | w).Val) != 0)
142 + {
143 + console.log('HResult=' + hr);
144 + throw ('Resize returned HRESULT: ' + hr);
145 + }
146 + console.log('SUCCESS');
147 + };
148
149 ds.terminal = ret;
150 ds._rpbuf = GM.CreateVariable(4096);
@@ -121,6 +155,8 @@ function vt()
155 this._rp.then(function ()
156 {
157 var len = this.parent._rpbufRead.toBuffer().readUInt32LE();
158 + if (len <= 0) { return; }
159 +
160 this.parent.push(this.parent._rpbuf.toBuffer().slice(0, len));
161 this.parent.__read();
162 });
@@ -131,7 +167,6 @@ function vt()
167 }
168 else
169 {
134 - console.log('FAILED!');
170 }
171 }
172