sqreen 1.10.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sqreen/rules_callbacks/execjs.rb +8 -1
- data/lib/sqreen/runner.rb +1 -1
- data/lib/sqreen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04735d805b8ea864d96c46e800a897b8a9721189f0ba85aed0d5d299cb6e7907
|
4
|
+
data.tar.gz: 283e87804132bdbeac132989113bd352f71b0e359a55dbffdb577748466ab5b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 409bea4a589bf468b0a1d28024137d9ff19c2a7b2a967b7a7e8c21f963ab71085085b7cdacb1eecdc84303d4774a7b89ce0476dd9b2dfdc36349127c16f4ccbb
|
7
|
+
data.tar.gz: e9c396aa040c4c57760e8a27c9ea5caa168da52c4a21c134d565696f801f3c63be4dbbe0888b8cf7ae911f3cb839083dcb85f033d6876a3eb1e3b7f56ee6db0d
|
@@ -14,6 +14,7 @@ else
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
require 'weakref'
|
17
18
|
require 'execjs'
|
18
19
|
|
19
20
|
require 'sqreen/rule_attributes'
|
@@ -41,6 +42,8 @@ module Sqreen
|
|
41
42
|
build_runnable(callbacks)
|
42
43
|
if !SQREEN_V8_THREAD
|
43
44
|
@compiled = ExecJS.compile(@source)
|
45
|
+
else
|
46
|
+
@runtimes = []
|
44
47
|
end
|
45
48
|
@restrict_max_depth = 20
|
46
49
|
end
|
@@ -144,7 +147,11 @@ module Sqreen
|
|
144
147
|
|
145
148
|
def call_callback(name, inst, args, rv = nil)
|
146
149
|
if SQREEN_V8_THREAD
|
147
|
-
Thread.current["SQREEN_EXECJS_SOURCE#{self.object_id}"]
|
150
|
+
if Thread.current["SQREEN_EXECJS_SOURCE#{self.object_id}"].nil? || !Thread.current["SQREEN_EXECJS_SOURCE#{self.object_id}"].weakref_alive?
|
151
|
+
runtime = ExecJS.compile(@source)
|
152
|
+
@runtimes.push runtime
|
153
|
+
Thread.current["SQREEN_EXECJS_SOURCE#{self.object_id}"] = WeakRef.new(runtime)
|
154
|
+
end
|
148
155
|
end
|
149
156
|
ret = nil
|
150
157
|
args_override = nil
|
data/lib/sqreen/runner.rb
CHANGED
@@ -169,7 +169,7 @@ module Sqreen
|
|
169
169
|
Sqreen.log.debug do
|
170
170
|
format('rules: %s', rules.
|
171
171
|
sort_by { |r| r['name'] }.
|
172
|
-
map { |r| format('(%s, %s)', r[
|
172
|
+
map { |r| format('(%s, %s, %s)', r[Rules::Attrs::NAME], r.to_json.size, r[Rules::Attrs::BLOCK]) }.
|
173
173
|
join(', '))
|
174
174
|
end
|
175
175
|
[rulespack_id, rules]
|
data/lib/sqreen/version.rb
CHANGED