isomorfeus-speednode 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/speednode/runner.js +11 -11
- data/lib/isomorfeus/speednode/runtime/vm.rb +4 -4
- data/lib/isomorfeus/speednode/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bd172161010e250f491960ea42831049d9f469dabc52543fdc6f2122409fd2e
|
4
|
+
data.tar.gz: e4fbc29c0fdc33ce8a0c0dd589b38e3fa976403cab874a8a31b6aebcba767082
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8b1128703bfda3dc7c47705aa71af6e5de484a918b7ec648c32151e1a2b3f90635fd8101a3e28f0ab2985075f0e6b026ddaf427be49ced91e8491d5379c6b2d
|
7
|
+
data.tar.gz: 77c73e250ec950d6bb77ea42db0c0ed22545ed424d64048bb38e02c007a91f34d41869b37bba38d9345fedb16d3290f56229401fd07e8f54a9732ca8cddc168a
|
@@ -135,7 +135,7 @@ function attachFunctionSource(responder_path, context, func) {
|
|
135
135
|
if (!global.__responder_socket) {\n\
|
136
136
|
return new Promise(function(resolve, reject) {\n\
|
137
137
|
setTimeout(function(){\n\
|
138
|
-
if (os.platform().indexOf('win')
|
138
|
+
if (os.platform().indexOf('win') == 0) {\n\
|
139
139
|
let socket = net.connect(responder_path);\n\
|
140
140
|
socket.on('connect', function(){\n\
|
141
141
|
global.__responder_socket = true;\n\
|
@@ -160,9 +160,9 @@ function attachFunctionSource(responder_path, context, func) {
|
|
160
160
|
socket.on('error', function (err) {\n\
|
161
161
|
if (err.syscall === 'connect') {\n\
|
162
162
|
// ignore, close will handle\n\
|
163
|
-
} else if (os.platform().indexOf('win')
|
163
|
+
} else if ((os.platform().indexOf('win') == 0) && err.message.includes('read EPIPE')) {\n\
|
164
164
|
// ignore, close will handle\n\
|
165
|
-
} else if (os.platform().indexOf('win')
|
165
|
+
} else if ((os.platform().indexOf('win') == 0) && err.message.includes('write EPIPE')) {\n\
|
166
166
|
// ignore, close will handle\n\
|
167
167
|
} else { reject(err); }\n\
|
168
168
|
});\n\
|
@@ -224,7 +224,7 @@ function getContextOptions(uuid) {
|
|
224
224
|
if (contexts[uuid].options.timeout) {
|
225
225
|
options.timeout = contexts[uuid].options.timeout;
|
226
226
|
}
|
227
|
-
return options;
|
227
|
+
return options;
|
228
228
|
}
|
229
229
|
|
230
230
|
function massageStackTrace(stack) {
|
@@ -242,7 +242,7 @@ let commands = {
|
|
242
242
|
attach: function(input) {
|
243
243
|
let context = getContext(input.context);
|
244
244
|
let responder_path;
|
245
|
-
if (os.platform().indexOf('win')
|
245
|
+
if (os.platform().indexOf('win') == 0) { responder_path = '\\\\\\\\.\\\\pipe\\\\' + socket_path + '_responder'; }
|
246
246
|
else { responder_path = socket_path + '_responder' }
|
247
247
|
let result = vm.runInContext(attachFunctionSource(responder_path, input.context, input.func), context, { filename: "(execjs)", displayErrors: true });
|
248
248
|
return formatResult(result);
|
@@ -286,23 +286,23 @@ let server = net.createServer(function(s) {
|
|
286
286
|
s.on('data', function (data) {
|
287
287
|
received_data.push(data);
|
288
288
|
if (data[data.length - 1] !== 4) { return; }
|
289
|
-
|
289
|
+
|
290
290
|
let request = received_data.join('').toString('utf8');
|
291
291
|
request = request.substr(0, request.length - 1);
|
292
292
|
received_data = [];
|
293
|
-
|
293
|
+
|
294
294
|
let input, result;
|
295
295
|
let outputJSON = '';
|
296
296
|
|
297
297
|
try { input = JSON.parse(request); }
|
298
|
-
catch(err) {
|
298
|
+
catch(err) {
|
299
299
|
outputJSON = JSON.stringify(['err', ['', err].join(''), err.stack]);
|
300
300
|
s.write([outputJSON, "\x04"].join(''));
|
301
301
|
return;
|
302
302
|
}
|
303
303
|
|
304
|
-
try { result = commands[input.cmd].apply(null, input.args); }
|
305
|
-
catch (err) {
|
304
|
+
try { result = commands[input.cmd].apply(null, input.args); }
|
305
|
+
catch (err) {
|
306
306
|
outputJSON = JSON.stringify(['err', ['', err].join(''), massageStackTrace(err.stack)]);
|
307
307
|
s.write([outputJSON, "\x04"].join(''));
|
308
308
|
return;
|
@@ -323,5 +323,5 @@ let server = net.createServer(function(s) {
|
|
323
323
|
});
|
324
324
|
});
|
325
325
|
|
326
|
-
if (os.platform().indexOf('win')
|
326
|
+
if (os.platform().indexOf('win') == 0) { server.listen('\\\\.\\pipe\\' + socket_path); }
|
327
327
|
else { server.listen(socket_path); }
|
@@ -56,7 +56,7 @@ module Isomorfeus
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def self.finalize(socket, socket_dir, socket_path, pid)
|
59
|
-
proc do
|
59
|
+
proc do
|
60
60
|
Isomorfeus::Speednode::Runtime.responders[socket_path].kill if Isomorfeus::Speednode::Runtime.responders[socket_path]
|
61
61
|
exit_node(socket, socket_dir, socket_path, pid)
|
62
62
|
end
|
@@ -97,7 +97,7 @@ module Isomorfeus
|
|
97
97
|
|
98
98
|
def attach(context, func)
|
99
99
|
create_responder(context) unless responder
|
100
|
-
command("attach", {'context' => context, 'func' => func })
|
100
|
+
command("attach", {'context' => context, 'func' => func })
|
101
101
|
end
|
102
102
|
|
103
103
|
def delete_context(context)
|
@@ -127,12 +127,12 @@ module Isomorfeus
|
|
127
127
|
end
|
128
128
|
@pid = Process.spawn({"SOCKET_PATH" => @socket_path}, @options[:binary], @options[:source_maps], @options[:runner_path])
|
129
129
|
|
130
|
-
retries =
|
130
|
+
retries = 50
|
131
131
|
|
132
132
|
if ExecJS.windows?
|
133
133
|
timeout_or_connected = false
|
134
134
|
begin
|
135
|
-
retries -= 1
|
135
|
+
retries -= 1
|
136
136
|
begin
|
137
137
|
@socket = Win32::Pipe::Client.new(@socket_path, Win32::Pipe::ACCESS_DUPLEX)
|
138
138
|
rescue
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-speednode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.13.
|
33
|
+
version: 3.13.9
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.13.
|
40
|
+
version: 3.13.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: win32-pipe
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
rubygems_version: 3.2.
|
153
|
+
rubygems_version: 3.2.22
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: A fast ExecJS runtime based on nodejs, tuned for Isomorfeus.
|