sqreen 1.10.0-java → 1.10.1-java
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: 2769174da57177a2fb014d06f5c810f35d1b011e0b84640b935079f83bc01153
|
4
|
+
data.tar.gz: 06be029bc2497b2e1f5eb2f6993f09c4f0ad0dae8597ecd62e1d7ec6b3470f54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19804e889ab4f9aadacaac5d87805c2bb7873f62f95b30829367752a224a7ec9f12d4a31ebccde3ffda21584c6483473c17dfe18c573ec4f393f9e3f1e17fead
|
7
|
+
data.tar.gz: c85dea9e1a61cfb25dcb278213fbb344344f4a5932425b49b80d8375d75a68a7c4042af88d5d700ec65945246014fe14e48f1ceee9eb125d4e3472d3e3ad9909
|
@@ -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