durable_rules 0.34.29 → 0.34.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/rules/events.c +69 -154
- data/src/rules/json.c +7 -3
- data/src/rules/json.h +3 -0
- data/src/rules/net.c +72 -55
- data/src/rules/net.h +3 -4
- data/src/rules/rete.c +29 -43
- data/src/rules/state.c +138 -80
- data/src/rules/state.h +29 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 695edb93b0911210ca53350c02bc61c77bf9ccd2
|
4
|
+
data.tar.gz: 425666b29236c98d761f50e43a5494f2d6cce21c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2624ce379aa4e8986b1800c79b4381eb4d0c94dab5e9b070ca14fff4a5ea0bfac37e87c004729c9b27a683de200fd63e79a9c989c2b55c6a068887b9986dce9e
|
7
|
+
data.tar.gz: d296bc9d28874dc3519d5938d10003880338372d834c0215dcbd4342615547af96dbba834af84f2ba938f05a43078eed7e4eae1fb585bb91cef2391381b6eecb
|
data/src/rules/events.c
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
|
10
10
|
#include <time.h>
|
11
11
|
|
12
|
-
#define MAX_EVENT_PROPERTIES 64
|
13
12
|
#define MAX_RESULT_NODES 32
|
14
13
|
#define MAX_NODE_RESULTS 16
|
15
14
|
#define MAX_STACK_SIZE 64
|
@@ -467,7 +466,7 @@ static unsigned int valueToProperty(ruleset *tree,
|
|
467
466
|
case JSON_STRING:
|
468
467
|
*state = &tree->stringPool[sourceValue->value.stringOffset];
|
469
468
|
(*targetProperty)->valueLength = strlen(*state);
|
470
|
-
(*targetProperty)->
|
469
|
+
(*targetProperty)->valueString = *state;
|
471
470
|
break;
|
472
471
|
case JSON_INT:
|
473
472
|
(*targetProperty)->value.i = sourceValue->value.i;
|
@@ -507,13 +506,13 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
507
506
|
}
|
508
507
|
|
509
508
|
if (leftProperty->type == JSON_STRING) {
|
510
|
-
leftTemp =
|
511
|
-
|
509
|
+
leftTemp = *(leftProperty->valueString + leftProperty->valueLength);
|
510
|
+
*(leftProperty->valueString + leftProperty->valueLength) = '\0';
|
512
511
|
}
|
513
512
|
|
514
513
|
if (rightProperty->type == JSON_STRING) {
|
515
|
-
rightTemp =
|
516
|
-
|
514
|
+
rightTemp = *(rightProperty->valueString + rightProperty->valueLength);
|
515
|
+
*(rightProperty->valueString + rightProperty->valueLength) = '\0';
|
517
516
|
}
|
518
517
|
}
|
519
518
|
|
@@ -534,7 +533,7 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
534
533
|
if (asprintf(state,
|
535
534
|
"%s%s",
|
536
535
|
leftProperty->value.b ? "true" : "false",
|
537
|
-
|
536
|
+
rightProperty->valueString) == -1) {
|
538
537
|
return ERR_OUT_OF_MEMORY;
|
539
538
|
}
|
540
539
|
break;
|
@@ -554,7 +553,7 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
554
553
|
if (asprintf(state,
|
555
554
|
"%ld%s",
|
556
555
|
leftProperty->value.i,
|
557
|
-
|
556
|
+
rightProperty->valueString) == -1) {
|
558
557
|
return ERR_OUT_OF_MEMORY;
|
559
558
|
}
|
560
559
|
break;
|
@@ -574,7 +573,7 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
574
573
|
if (asprintf(state,
|
575
574
|
"%g%s",
|
576
575
|
leftProperty->value.d,
|
577
|
-
|
576
|
+
rightProperty->valueString) == -1) {
|
578
577
|
return ERR_OUT_OF_MEMORY;
|
579
578
|
}
|
580
579
|
|
@@ -582,7 +581,7 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
582
581
|
case OP_STRING_BOOL:
|
583
582
|
if (asprintf(state,
|
584
583
|
"%s%s",
|
585
|
-
|
584
|
+
leftProperty->valueString,
|
586
585
|
rightProperty->value.b ? "true" : "false") == -1) {
|
587
586
|
return ERR_OUT_OF_MEMORY;
|
588
587
|
}
|
@@ -590,7 +589,7 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
590
589
|
case OP_STRING_INT:
|
591
590
|
if (asprintf(state,
|
592
591
|
"%s%ld",
|
593
|
-
|
592
|
+
leftProperty->valueString,
|
594
593
|
rightProperty->value.i) == -1) {
|
595
594
|
return ERR_OUT_OF_MEMORY;
|
596
595
|
}
|
@@ -598,7 +597,7 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
598
597
|
case OP_STRING_DOUBLE:
|
599
598
|
if (asprintf(state,
|
600
599
|
"%s%ld",
|
601
|
-
|
600
|
+
leftProperty->valueString,
|
602
601
|
rightProperty->value.i) == -1) {
|
603
602
|
return ERR_OUT_OF_MEMORY;
|
604
603
|
}
|
@@ -606,8 +605,8 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
606
605
|
case OP_STRING_STRING:
|
607
606
|
if (asprintf(state,
|
608
607
|
"%s%s",
|
609
|
-
|
610
|
-
|
608
|
+
leftProperty->valueString,
|
609
|
+
rightProperty->valueString) == -1) {
|
611
610
|
return ERR_OUT_OF_MEMORY;
|
612
611
|
}
|
613
612
|
break;
|
@@ -615,15 +614,15 @@ static unsigned int reduceProperties(unsigned char operator,
|
|
615
614
|
|
616
615
|
if (leftProperty->type == JSON_STRING || rightProperty->type == JSON_STRING) {
|
617
616
|
targetValue->type = JSON_STRING;
|
618
|
-
targetValue->
|
617
|
+
targetValue->valueString = *state;
|
619
618
|
targetValue->valueLength = strlen(*state);
|
620
619
|
|
621
620
|
if (leftTemp) {
|
622
|
-
|
621
|
+
*(leftProperty->valueString + leftProperty->valueLength) = leftTemp;
|
623
622
|
}
|
624
623
|
|
625
624
|
if (rightTemp) {
|
626
|
-
|
625
|
+
*(rightProperty->valueString + rightProperty->valueLength) = rightTemp;
|
627
626
|
}
|
628
627
|
}
|
629
628
|
|
@@ -751,13 +750,13 @@ static unsigned int isMatch(ruleset *tree,
|
|
751
750
|
case OP_BOOL_STRING:
|
752
751
|
if (currentProperty->value.b) {
|
753
752
|
*propertyMatch = compareStringProperty("true",
|
754
|
-
|
753
|
+
rightProperty->valueString,
|
755
754
|
rightProperty->valueLength,
|
756
755
|
alphaOp);
|
757
756
|
}
|
758
757
|
else {
|
759
758
|
*propertyMatch = compareStringProperty("false",
|
760
|
-
|
759
|
+
rightProperty->valueString,
|
761
760
|
rightProperty->valueLength,
|
762
761
|
alphaOp);
|
763
762
|
}
|
@@ -783,7 +782,7 @@ static unsigned int isMatch(ruleset *tree,
|
|
783
782
|
snprintf(leftStringInt, sizeof(char)*(rightLength), "%ld", currentProperty->value.i);
|
784
783
|
#endif
|
785
784
|
*propertyMatch = compareStringProperty(leftStringInt,
|
786
|
-
|
785
|
+
rightProperty->valueString,
|
787
786
|
rightProperty->valueLength,
|
788
787
|
alphaOp);
|
789
788
|
}
|
@@ -808,20 +807,20 @@ static unsigned int isMatch(ruleset *tree,
|
|
808
807
|
snprintf(leftStringDouble, sizeof(char)*(rightLength), "%f", currentProperty->value.d);
|
809
808
|
#endif
|
810
809
|
*propertyMatch = compareStringProperty(leftStringDouble,
|
811
|
-
|
810
|
+
rightProperty->valueString,
|
812
811
|
rightProperty->valueLength,
|
813
812
|
alphaOp);
|
814
813
|
}
|
815
814
|
break;
|
816
815
|
case OP_STRING_BOOL:
|
817
816
|
if (rightProperty->value.b) {
|
818
|
-
*propertyMatch = compareString(
|
817
|
+
*propertyMatch = compareString(currentProperty->valueString,
|
819
818
|
currentProperty->valueLength,
|
820
819
|
"true",
|
821
820
|
alphaOp);
|
822
821
|
}
|
823
822
|
else {
|
824
|
-
*propertyMatch = compareString(
|
823
|
+
*propertyMatch = compareString(currentProperty->valueString,
|
825
824
|
currentProperty->valueLength,
|
826
825
|
"false",
|
827
826
|
alphaOp);
|
@@ -837,7 +836,7 @@ static unsigned int isMatch(ruleset *tree,
|
|
837
836
|
char rightStringInt[leftLength];
|
838
837
|
snprintf(rightStringInt, sizeof(char)*(leftLength), "%ld", rightProperty->value.i);
|
839
838
|
#endif
|
840
|
-
*propertyMatch = compareString(
|
839
|
+
*propertyMatch = compareString(currentProperty->valueString,
|
841
840
|
currentProperty->valueLength,
|
842
841
|
rightStringInt,
|
843
842
|
alphaOp);
|
@@ -853,16 +852,16 @@ static unsigned int isMatch(ruleset *tree,
|
|
853
852
|
char rightStringDouble[leftLength];
|
854
853
|
snprintf(rightStringDouble, sizeof(char)*(leftLength), "%f", rightProperty->value.d);
|
855
854
|
#endif
|
856
|
-
*propertyMatch = compareString(
|
855
|
+
*propertyMatch = compareString(currentProperty->valueString,
|
857
856
|
currentProperty->valueLength,
|
858
857
|
rightStringDouble,
|
859
858
|
alphaOp);
|
860
859
|
}
|
861
860
|
break;
|
862
861
|
case OP_STRING_STRING:
|
863
|
-
*propertyMatch = compareStringAndStringProperty(
|
862
|
+
*propertyMatch = compareStringAndStringProperty(currentProperty->valueString,
|
864
863
|
currentProperty->valueLength,
|
865
|
-
|
864
|
+
rightProperty->valueString,
|
866
865
|
rightProperty->valueLength,
|
867
866
|
alphaOp);
|
868
867
|
break;
|
@@ -888,7 +887,7 @@ static unsigned int isMatch(ruleset *tree,
|
|
888
887
|
case OP_STRING_REGEX:
|
889
888
|
case OP_STRING_IREGEX:
|
890
889
|
*propertyMatch = evaluateRegex(tree,
|
891
|
-
|
890
|
+
currentProperty->valueString,
|
892
891
|
currentProperty->valueLength,
|
893
892
|
(type == OP_STRING_REGEX) ? 0 : 1,
|
894
893
|
currentAlpha->right.value.regex.vocabularyLength,
|
@@ -908,8 +907,7 @@ static unsigned int handleAlpha(ruleset *tree,
|
|
908
907
|
char *sid,
|
909
908
|
char *mid,
|
910
909
|
char *message,
|
911
|
-
|
912
|
-
unsigned int propertiesLength,
|
910
|
+
jsonObject *jo,
|
913
911
|
alpha *alphaNode,
|
914
912
|
unsigned char actionType,
|
915
913
|
char **evalKeys,
|
@@ -932,8 +930,8 @@ static unsigned int handleAlpha(ruleset *tree,
|
|
932
930
|
for (entry = 0; nextList[entry] != 0; ++entry) {
|
933
931
|
node *listNode = &tree->nodePool[nextList[entry]];
|
934
932
|
char exists = 0;
|
935
|
-
for(unsigned int propertyIndex = 0; propertyIndex < propertiesLength; ++propertyIndex) {
|
936
|
-
if (listNode->value.a.hash ==
|
933
|
+
for(unsigned int propertyIndex = 0; propertyIndex < jo->propertiesLength; ++propertyIndex) {
|
934
|
+
if (listNode->value.a.hash == jo->properties[propertyIndex].hash) {
|
937
935
|
exists = 1;
|
938
936
|
break;
|
939
937
|
}
|
@@ -952,8 +950,8 @@ static unsigned int handleAlpha(ruleset *tree,
|
|
952
950
|
|
953
951
|
if (currentAlpha->nextOffset) {
|
954
952
|
unsigned int *nextHashset = &tree->nextPool[currentAlpha->nextOffset];
|
955
|
-
for(unsigned int propertyIndex = 0; propertyIndex < propertiesLength; ++propertyIndex) {
|
956
|
-
jsonProperty *currentProperty = &
|
953
|
+
for(unsigned int propertyIndex = 0; propertyIndex < jo->propertiesLength; ++propertyIndex) {
|
954
|
+
jsonProperty *currentProperty = &jo->properties[propertyIndex];
|
957
955
|
for (entry = currentProperty->hash & HASH_MASK; nextHashset[entry] != 0; entry = (entry + 1) % NEXT_BUCKET_LENGTH) {
|
958
956
|
node *hashNode = &tree->nodePool[nextHashset[entry]];
|
959
957
|
if (currentProperty->hash == hashNode->value.a.hash) {
|
@@ -1018,82 +1016,35 @@ static unsigned int handleAlpha(ruleset *tree,
|
|
1018
1016
|
return result;
|
1019
1017
|
}
|
1020
1018
|
|
1021
|
-
static unsigned int getId(jsonProperty *allProperties,
|
1022
|
-
unsigned int idIndex,
|
1023
|
-
jsonProperty **idProperty,
|
1024
|
-
int *idLength) {
|
1025
|
-
jsonProperty *currentProperty;
|
1026
|
-
if (idIndex == UNDEFINED_INDEX) {
|
1027
|
-
return ERR_NO_ID_DEFINED;
|
1028
|
-
}
|
1029
|
-
|
1030
|
-
currentProperty = &allProperties[idIndex];
|
1031
|
-
*idLength = currentProperty->valueLength;
|
1032
|
-
switch(currentProperty->type) {
|
1033
|
-
case JSON_INT:
|
1034
|
-
case JSON_DOUBLE:
|
1035
|
-
*idLength = *idLength + 1;
|
1036
|
-
case JSON_STRING:
|
1037
|
-
break;
|
1038
|
-
case JSON_NIL:
|
1039
|
-
return ERR_NO_ID_DEFINED;
|
1040
|
-
default:
|
1041
|
-
return ERR_INVALID_ID;
|
1042
|
-
}
|
1043
|
-
|
1044
|
-
*idProperty = currentProperty;
|
1045
|
-
return RULES_OK;
|
1046
|
-
}
|
1047
|
-
|
1048
1019
|
static unsigned int handleMessageCore(ruleset *tree,
|
1049
1020
|
char *state,
|
1050
1021
|
char *message,
|
1051
|
-
|
1052
|
-
unsigned int propertiesLength,
|
1053
|
-
unsigned int midIndex,
|
1054
|
-
unsigned int sidIndex,
|
1022
|
+
jsonObject *jo,
|
1055
1023
|
unsigned char actionType,
|
1056
1024
|
char **commands,
|
1057
1025
|
unsigned int *commandCount,
|
1058
1026
|
void **rulesBinding) {
|
1059
|
-
|
1060
|
-
int midLength;
|
1061
|
-
jsonProperty *sidProperty = NULL;
|
1062
|
-
int sidLength;
|
1027
|
+
unsigned int result;
|
1063
1028
|
char *storeCommand;
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
} else if (result != RULES_OK) {
|
1068
|
-
return result;
|
1069
|
-
}
|
1029
|
+
jsonProperty *sidProperty = &jo->properties[jo->sidIndex];
|
1030
|
+
jsonProperty *midProperty = &jo->properties[jo->idIndex];
|
1031
|
+
|
1070
1032
|
#ifdef _WIN32
|
1071
|
-
char *sid = (char *)_alloca(sizeof(char)*(
|
1033
|
+
char *sid = (char *)_alloca(sizeof(char)*(sidProperty->valueLength + 1));
|
1072
1034
|
#else
|
1073
|
-
char sid[
|
1035
|
+
char sid[sidProperty->valueLength + 1];
|
1074
1036
|
#endif
|
1075
|
-
|
1076
|
-
|
1077
|
-
} else {
|
1078
|
-
strncpy(sid, message + sidProperty->valueOffset, sidLength);
|
1079
|
-
}
|
1080
|
-
sid[sidLength] = '\0';
|
1037
|
+
strncpy(sid, sidProperty->valueString, sidProperty->valueLength);
|
1038
|
+
sid[sidProperty->valueLength] = '\0';
|
1081
1039
|
|
1082
|
-
result = getId(properties, midIndex, &midProperty, &midLength);
|
1083
|
-
if (result == ERR_NO_ID_DEFINED) {
|
1084
|
-
midLength = 0;
|
1085
|
-
} else if (result != RULES_OK) {
|
1086
|
-
return result;
|
1087
|
-
}
|
1088
1040
|
#ifdef _WIN32
|
1089
|
-
char *mid = (char *)_alloca(sizeof(char)*(
|
1041
|
+
char *mid = (char *)_alloca(sizeof(char)*(midProperty->valueLength + 1));
|
1090
1042
|
#else
|
1091
|
-
char mid[
|
1043
|
+
char mid[midProperty->valueLength + 1];
|
1092
1044
|
#endif
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
mid[midLength] = '\0';
|
1045
|
+
strncpy(mid, midProperty->valueString, midProperty->valueLength);
|
1046
|
+
mid[midProperty->valueLength] = '\0';
|
1047
|
+
|
1097
1048
|
if (*commandCount == MAX_COMMAND_COUNT) {
|
1098
1049
|
return ERR_MAX_COMMAND_COUNT;
|
1099
1050
|
}
|
@@ -1123,8 +1074,7 @@ static unsigned int handleMessageCore(ruleset *tree,
|
|
1123
1074
|
sid,
|
1124
1075
|
mid,
|
1125
1076
|
message,
|
1126
|
-
|
1127
|
-
propertiesLength,
|
1077
|
+
jo,
|
1128
1078
|
&tree->nodePool[NODE_M_OFFSET].value.a,
|
1129
1079
|
actionType,
|
1130
1080
|
evalKeys,
|
@@ -1156,9 +1106,9 @@ static unsigned int handleMessageCore(ruleset *tree,
|
|
1156
1106
|
result = formatStoreMessage(*rulesBinding,
|
1157
1107
|
sid,
|
1158
1108
|
message,
|
1159
|
-
|
1160
|
-
propertiesLength,
|
1109
|
+
jo,
|
1161
1110
|
actionType == ACTION_ASSERT_FACT ? 1 : 0,
|
1111
|
+
evalCount == 0 ? 1 : 0,
|
1162
1112
|
addKeys,
|
1163
1113
|
addCount,
|
1164
1114
|
&addCommand);
|
@@ -1184,8 +1134,7 @@ static unsigned int handleMessageCore(ruleset *tree,
|
|
1184
1134
|
sid,
|
1185
1135
|
mid,
|
1186
1136
|
message,
|
1187
|
-
|
1188
|
-
propertiesLength,
|
1137
|
+
jo,
|
1189
1138
|
actionType,
|
1190
1139
|
evalKeys,
|
1191
1140
|
evalCount,
|
@@ -1223,30 +1172,20 @@ static unsigned int handleMessageCore(ruleset *tree,
|
|
1223
1172
|
return RULES_OK;
|
1224
1173
|
}
|
1225
1174
|
|
1226
|
-
result = refreshState(tree,sid);
|
1175
|
+
result = refreshState(tree, sid);
|
1227
1176
|
if (result != ERR_NEW_SESSION) {
|
1228
1177
|
return result;
|
1229
1178
|
}
|
1230
1179
|
#ifdef _WIN32
|
1231
|
-
char *stateMessage = (char *)_alloca(sizeof(char)*(36 +
|
1232
|
-
char *newState = (char *)_alloca(sizeof(char)*(12 +
|
1233
|
-
|
1234
|
-
|
1235
|
-
sprintf_s(newState, sizeof(char)*(12 + sidLength), "{\"sid\":\"%s\"}", sid);
|
1236
|
-
} else {
|
1237
|
-
sprintf_s(stateMessage, sizeof(char)*(26 + sidLength), "{\"sid\":%s, \"$s\":1}", sid);
|
1238
|
-
sprintf_s(newState, sizeof(char)*(12 + sidLength), "{\"sid\":%s}", sid);
|
1239
|
-
}
|
1180
|
+
char *stateMessage = (char *)_alloca(sizeof(char)*(36 + sidProperty->valueLength));
|
1181
|
+
char *newState = (char *)_alloca(sizeof(char)*(12 + sidProperty->valueLength));
|
1182
|
+
sprintf_s(stateMessage, sizeof(char)*(26 + sidProperty->valueLength), "{\"sid\":\"%s\", \"$s\":1}", sid);
|
1183
|
+
sprintf_s(newState, sizeof(char)*(12 + sidProperty->valueLength), "{\"sid\":\"%s\"}", sid);
|
1240
1184
|
#else
|
1241
|
-
char stateMessage[36 +
|
1242
|
-
char newState[12 +
|
1243
|
-
|
1244
|
-
|
1245
|
-
snprintf(newState, sizeof(char)*(12 + sidLength), "{\"sid\":\"%s\"}", sid);
|
1246
|
-
} else {
|
1247
|
-
snprintf(stateMessage, sizeof(char)*(26 + sidLength), "{\"sid\":%s, \"$s\":1}", sid);
|
1248
|
-
snprintf(newState, sizeof(char)*(12 + sidLength), "{\"sid\":%s}", sid);
|
1249
|
-
}
|
1185
|
+
char stateMessage[36 + sidProperty->valueLength];
|
1186
|
+
char newState[12 + sidProperty->valueLength];
|
1187
|
+
snprintf(stateMessage, sizeof(char)*(26 + sidProperty->valueLength), "{\"sid\":\"%s\", \"$s\":1}", sid);
|
1188
|
+
snprintf(newState, sizeof(char)*(12 + sidProperty->valueLength), "{\"sid\":\"%s\"}", sid);
|
1250
1189
|
#endif
|
1251
1190
|
|
1252
1191
|
if (*commandCount == MAX_COMMAND_COUNT) {
|
@@ -1290,19 +1229,12 @@ static unsigned int handleMessage(ruleset *tree,
|
|
1290
1229
|
unsigned int *commandCount,
|
1291
1230
|
void **rulesBinding) {
|
1292
1231
|
char *next;
|
1293
|
-
|
1294
|
-
unsigned int midIndex = UNDEFINED_INDEX;
|
1295
|
-
unsigned int sidIndex = UNDEFINED_INDEX;
|
1296
|
-
jsonProperty properties[MAX_EVENT_PROPERTIES];
|
1232
|
+
jsonObject jo;
|
1297
1233
|
int result = constructObject(message,
|
1298
1234
|
NULL,
|
1299
1235
|
NULL,
|
1300
|
-
|
1301
|
-
|
1302
|
-
properties,
|
1303
|
-
&propertiesLength,
|
1304
|
-
&midIndex,
|
1305
|
-
&sidIndex,
|
1236
|
+
JSON_OBJECT_SEQUENCED,
|
1237
|
+
&jo,
|
1306
1238
|
&next);
|
1307
1239
|
if (result != RULES_OK) {
|
1308
1240
|
return result;
|
@@ -1311,10 +1243,7 @@ static unsigned int handleMessage(ruleset *tree,
|
|
1311
1243
|
return handleMessageCore(tree,
|
1312
1244
|
state,
|
1313
1245
|
message,
|
1314
|
-
|
1315
|
-
propertiesLength,
|
1316
|
-
midIndex,
|
1317
|
-
sidIndex,
|
1246
|
+
&jo,
|
1318
1247
|
actionType,
|
1319
1248
|
commands,
|
1320
1249
|
commandCount,
|
@@ -1329,11 +1258,8 @@ static unsigned int handleMessages(void *handle,
|
|
1329
1258
|
void **rulesBinding) {
|
1330
1259
|
unsigned int result;
|
1331
1260
|
unsigned int returnResult = RULES_OK;
|
1332
|
-
|
1333
|
-
|
1334
|
-
unsigned int propertiesMidIndex = UNDEFINED_INDEX;
|
1335
|
-
unsigned int propertiesSidIndex = UNDEFINED_INDEX;
|
1336
|
-
|
1261
|
+
jsonObject jo;
|
1262
|
+
|
1337
1263
|
char *first = messages;
|
1338
1264
|
char *last = NULL;
|
1339
1265
|
char lastTemp;
|
@@ -1345,12 +1271,8 @@ static unsigned int handleMessages(void *handle,
|
|
1345
1271
|
while (constructObject(first,
|
1346
1272
|
NULL,
|
1347
1273
|
NULL,
|
1348
|
-
|
1349
|
-
|
1350
|
-
properties,
|
1351
|
-
&propertiesLength,
|
1352
|
-
&propertiesMidIndex,
|
1353
|
-
&propertiesSidIndex,
|
1274
|
+
JSON_OBJECT_SEQUENCED,
|
1275
|
+
&jo,
|
1354
1276
|
&last) == RULES_OK) {
|
1355
1277
|
|
1356
1278
|
while (*last != ',' && *last != ']' ) {
|
@@ -1362,10 +1284,7 @@ static unsigned int handleMessages(void *handle,
|
|
1362
1284
|
result = handleMessageCore(handle,
|
1363
1285
|
NULL,
|
1364
1286
|
first,
|
1365
|
-
|
1366
|
-
propertiesLength,
|
1367
|
-
propertiesMidIndex,
|
1368
|
-
propertiesSidIndex,
|
1287
|
+
&jo,
|
1369
1288
|
actionType,
|
1370
1289
|
commands,
|
1371
1290
|
commandCount,
|
@@ -1379,11 +1298,7 @@ static unsigned int handleMessages(void *handle,
|
|
1379
1298
|
if (result == ERR_EVENT_NOT_HANDLED) {
|
1380
1299
|
returnResult = ERR_EVENT_NOT_HANDLED;
|
1381
1300
|
}
|
1382
|
-
|
1383
|
-
propertiesLength = 0;
|
1384
|
-
propertiesMidIndex = UNDEFINED_INDEX;
|
1385
|
-
propertiesSidIndex = UNDEFINED_INDEX;
|
1386
|
-
|
1301
|
+
|
1387
1302
|
first = last;
|
1388
1303
|
while (*first != '{' && *first != '\0' ) {
|
1389
1304
|
++first;
|