durable_rules 0.33.03 → 0.33.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/rules/Makefile +6 -25
- data/src/rules/events.c +4 -1
- data/src/rules/net.c +25 -9
- data/src/rulesrb/extconf.rb +1 -1
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14164e8dd6116391e91df6a34c18dadc3ff24a0f
|
4
|
+
data.tar.gz: 556e9724071ab335c72228114c8c5168b497cfa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9df7fe66c5ee833b6866922883031e114661cd1085c254156fea8754c4d2e489c46998822283db472316c6ca2c2414976272b47173a3397bf0f6e1dd3bc9b204
|
7
|
+
data.tar.gz: 3920871e93fa6bf162207352d7f05e170ceec0c7f4fe8c93f3a7a7069678baa2dbe2e30848610f1aa8dd703b24b2d0b1f1e08d7627eee54404ef9e00d7d425a7
|
data/src/rules/Makefile
CHANGED
@@ -1,27 +1,17 @@
|
|
1
1
|
OBJ=events.o json.o net.o rete.o state.o
|
2
|
-
LIBNAME=
|
2
|
+
LIBNAME=librules
|
3
3
|
|
4
4
|
# Fallback to gcc when $CC is not in $PATH.
|
5
5
|
CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
|
6
6
|
OPTIMIZATION?=-O3
|
7
7
|
WARNINGS=-Wall
|
8
8
|
DEBUG?= -g -ggdb
|
9
|
-
REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG) $(ARCH)
|
10
|
-
REAL_LDFLAGS=$(LDFLAGS) $(ARCH)
|
11
|
-
|
12
|
-
REAL_CFLAGS+= -I../../deps/hiredis
|
13
|
-
REAL_LDFLAGS+= ../deps/hiredis/libhiredis.a
|
9
|
+
REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG) $(ARCH) -I../../deps/hiredis -D_GNU_SOURCE
|
14
10
|
|
15
11
|
STLIBSUFFIX=a
|
16
12
|
STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
|
17
|
-
STLIB_MAKE_CMD=
|
18
|
-
|
19
|
-
# Platform-specific overrides
|
20
|
-
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
21
|
-
ifeq ($(uname_S),SunOS)
|
22
|
-
REAL_LDFLAGS+= -ldl -lnsl -lsocket
|
23
|
-
INSTALL= cp -r
|
24
|
-
endif
|
13
|
+
STLIB_MAKE_CMD=ld $(ARCH) -o $(STLIBNAME) -L../../deps/hiredis/ -lhiredis -r
|
14
|
+
#STLIB_MAKE_CMD=ar rcs $(STLIBNAME)
|
25
15
|
|
26
16
|
all: $(STLIBNAME)
|
27
17
|
|
@@ -37,19 +27,10 @@ $(STLIBNAME): $(OBJ)
|
|
37
27
|
|
38
28
|
static: $(STLIBNAME)
|
39
29
|
|
40
|
-
rules-%: %.o $(STLIBNAME)
|
41
|
-
$(CC) -o $@ $(REAL_LDFLAGS) $< $(STLIBNAME)
|
42
|
-
|
43
30
|
.c.o:
|
44
31
|
$(CC) -std=c99 -c $(REAL_CFLAGS) $<
|
45
32
|
|
46
33
|
clean:
|
47
|
-
rm -rf $(STLIBNAME) $(BINS) *.o
|
48
|
-
|
49
|
-
gprof:
|
50
|
-
$(MAKE) CFLAGS="-pg" LDFLAGS="-pg"
|
51
|
-
|
52
|
-
noopt:
|
53
|
-
$(MAKE) OPTIMIZATION=""
|
34
|
+
rm -rf $(STLIBNAME) $(BINS) *.o
|
54
35
|
|
55
|
-
.PHONY: all clean
|
36
|
+
.PHONY: all clean
|
data/src/rules/events.c
CHANGED
@@ -497,7 +497,10 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
497
497
|
char rightTemp = 0;
|
498
498
|
if (leftProperty->type == JSON_STRING || rightProperty->type == JSON_STRING) {
|
499
499
|
if (operator != OP_ADD) {
|
500
|
-
|
500
|
+
*state = (char*)calloc(1, sizeof(char));
|
501
|
+
if (!*state) {
|
502
|
+
return ERR_OUT_OF_MEMORY;
|
503
|
+
}
|
501
504
|
return RULES_OK;
|
502
505
|
}
|
503
506
|
|
data/src/rules/net.c
CHANGED
@@ -123,7 +123,8 @@ static unsigned int createTest(ruleset *tree, expression *expr, char **test, cha
|
|
123
123
|
unsigned char setPrimaryKey = 0;
|
124
124
|
*primaryKey = NULL;
|
125
125
|
*primaryFrameKey = NULL;
|
126
|
-
|
126
|
+
*test = (char*)calloc(1, sizeof(char));
|
127
|
+
if (!*test) {
|
127
128
|
return ERR_OUT_OF_MEMORY;
|
128
129
|
}
|
129
130
|
|
@@ -284,10 +285,13 @@ static unsigned int createTest(ruleset *tree, expression *expr, char **test, cha
|
|
284
285
|
}
|
285
286
|
|
286
287
|
if (*primaryKey == NULL) {
|
287
|
-
|
288
|
+
*primaryKey = (char*)calloc(1, sizeof(char));
|
289
|
+
if (!*primaryKey) {
|
288
290
|
return ERR_OUT_OF_MEMORY;
|
289
291
|
}
|
290
|
-
|
292
|
+
|
293
|
+
*primaryFrameKey = (char*)calloc(1, sizeof(char));
|
294
|
+
if (!*primaryFrameKey) {
|
291
295
|
return ERR_OUT_OF_MEMORY;
|
292
296
|
}
|
293
297
|
}
|
@@ -310,15 +314,19 @@ static unsigned int loadCommands(ruleset *tree, binding *rulesBinding) {
|
|
310
314
|
char *peekActionLua = NULL;
|
311
315
|
char *addMessageLua = NULL;
|
312
316
|
char *oldLua;
|
313
|
-
|
317
|
+
|
318
|
+
peekActionLua = (char*)calloc(1, sizeof(char));
|
319
|
+
if (!peekActionLua) {
|
314
320
|
return ERR_OUT_OF_MEMORY;
|
315
321
|
}
|
316
322
|
|
317
|
-
|
323
|
+
lua = (char*)calloc(1, sizeof(char));
|
324
|
+
if (!lua) {
|
318
325
|
return ERR_OUT_OF_MEMORY;
|
319
326
|
}
|
320
327
|
|
321
|
-
|
328
|
+
addMessageLua = (char*)calloc(1, sizeof(char));
|
329
|
+
if (!addMessageLua) {
|
322
330
|
return ERR_OUT_OF_MEMORY;
|
323
331
|
}
|
324
332
|
|
@@ -404,7 +412,8 @@ static unsigned int loadCommands(ruleset *tree, binding *rulesBinding) {
|
|
404
412
|
char *currentKey = &tree->stringPool[expr->nameOffset];
|
405
413
|
char *nextKeyTest;
|
406
414
|
if (iii == (currentJoin->expressionsLength - 1)) {
|
407
|
-
|
415
|
+
nextKeyTest = (char*)calloc(1, sizeof(char));
|
416
|
+
if (!nextKeyTest) {
|
408
417
|
return ERR_OUT_OF_MEMORY;
|
409
418
|
}
|
410
419
|
} else {
|
@@ -419,6 +428,10 @@ static unsigned int loadCommands(ruleset *tree, binding *rulesBinding) {
|
|
419
428
|
|
420
429
|
if (iii == 0) {
|
421
430
|
oldAddMessageLua = addMessageLua;
|
431
|
+
if (!addMessageLua) {
|
432
|
+
addMessageLua = "";
|
433
|
+
}
|
434
|
+
|
422
435
|
if (asprintf(&addMessageLua,
|
423
436
|
"%sif input_keys[\"%s\"] then\n"
|
424
437
|
" primary_message_keys[\"%s\"] = function(message)\n"
|
@@ -489,6 +502,10 @@ static unsigned int loadCommands(ruleset *tree, binding *rulesBinding) {
|
|
489
502
|
free(oldLua);
|
490
503
|
|
491
504
|
oldPeekActionLua = peekActionLua;
|
505
|
+
if (!peekActionLua) {
|
506
|
+
peekActionLua = "";
|
507
|
+
}
|
508
|
+
|
492
509
|
if (asprintf(&peekActionLua,
|
493
510
|
"%skeys[1] = \"%s\"\n"
|
494
511
|
"reviewers[1] = function(message, frame, index)\n"
|
@@ -528,8 +545,6 @@ static unsigned int loadCommands(ruleset *tree, binding *rulesBinding) {
|
|
528
545
|
return ERR_OUT_OF_MEMORY;
|
529
546
|
}
|
530
547
|
|
531
|
-
|
532
|
-
|
533
548
|
oldLua = lua;
|
534
549
|
if (asprintf(&lua,
|
535
550
|
"%sif input_keys[\"%s\"] %s then\n"
|
@@ -1356,6 +1371,7 @@ static unsigned int loadCommands(ruleset *tree, binding *rulesBinding) {
|
|
1356
1371
|
lua) == -1) {
|
1357
1372
|
return ERR_OUT_OF_MEMORY;
|
1358
1373
|
}
|
1374
|
+
|
1359
1375
|
free(oldLua);
|
1360
1376
|
redisAppendCommand(reContext, "SCRIPT LOAD %s", lua);
|
1361
1377
|
redisGetReply(reContext, (void**)&reply);
|
data/src/rulesrb/extconf.rb
CHANGED
@@ -31,7 +31,7 @@ end
|
|
31
31
|
|
32
32
|
# Statically link to hiredis (mkmf can't do this for us)
|
33
33
|
$CFLAGS << " -I#{rules_lib} "
|
34
|
-
$LDFLAGS << " #{
|
34
|
+
$LDFLAGS << " -L#{rules_lib} -L#{hiredis_lib} -lrules -lhiredis"
|
35
35
|
|
36
36
|
have_func("rb_thread_fd_select")
|
37
37
|
create_makefile('src/rulesrb/rules')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: durable_rules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.33.
|
4
|
+
version: 0.33.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesus Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 10.4.2
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 10.4.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake-compiler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.9.5
|
34
34
|
type: :development
|
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: 0.
|
40
|
+
version: 0.9.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: timers
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 4.0.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sinatra
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.4.6
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.4.6
|
55
69
|
description: A lightweight library for real-time, consistent and scalable coordination
|
56
70
|
of events.
|
57
71
|
email: jr3791@live.com
|
@@ -116,5 +130,5 @@ rubyforge_project:
|
|
116
130
|
rubygems_version: 2.0.14
|
117
131
|
signing_key:
|
118
132
|
specification_version: 4
|
119
|
-
summary: for real time analytics
|
133
|
+
summary: for real time analytics (a Ruby Rules Engine)
|
120
134
|
test_files: []
|