durable_rules 0.34.26 → 0.34.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 240fc57baccb92e497e5f220881e131f086c9f02
4
- data.tar.gz: b08818faad5060a0aef4508ae1a84b4db646633c
3
+ metadata.gz: c8271032dff0a76d7a23894c8feac51fd816be8f
4
+ data.tar.gz: 565c32ae6735f76c0e732ebd28fc63fec5959ef3
5
5
  SHA512:
6
- metadata.gz: 0cf652b12ccb66f545ead8ca3688b85079ff4bc34fbd7c6457fb70cbdfeef6c7576779948160ca716793ec0c0c26e67ed98a7c6a76936ffb785e789bf74f6364
7
- data.tar.gz: bbe68fcdc572957b5f8bdd2623956f7f113bd0ac858504635fc24df6f797652f9d1fd220a04347c14c4221a42780a2e87b65d9585b6d124d47c0abeb90f94380
6
+ metadata.gz: 9bf826e66598b81e9de27aa890957132dd63cd3687ca46e9fe78c2b2e4dac178fc026173f4fae4ed73d285484c3b1cb6d65ed649ee32f24fe43b13093ef64471
7
+ data.tar.gz: ec3ccd64ea46ec1ead3bda34a917d0865661c8aff9a245547ec8d03ac220907a160d55fea4464692670c131bff130411308b68a7a073bbd7a105d7b39fd6c2cb
data/src/rules/events.c CHANGED
@@ -1032,6 +1032,8 @@ static unsigned int getId(jsonProperty *allProperties,
1032
1032
  *idLength = *idLength + 1;
1033
1033
  case JSON_STRING:
1034
1034
  break;
1035
+ case JSON_NIL:
1036
+ return ERR_NO_ID_DEFINED;
1035
1037
  default:
1036
1038
  return ERR_INVALID_ID;
1037
1039
  }
@@ -1864,6 +1866,10 @@ unsigned int abandonAction(void *handle, void *actionHandle) {
1864
1866
 
1865
1867
  unsigned int queueMessage(void *handle, unsigned int queueAction, char *sid, char *destination, char *message) {
1866
1868
  void *rulesBinding;
1869
+ if (!sid) {
1870
+ sid = "0";
1871
+ }
1872
+
1867
1873
  unsigned int result = resolveBinding(handle, sid, &rulesBinding);
1868
1874
  if (result != RULES_OK) {
1869
1875
  return result;
@@ -1874,6 +1880,10 @@ unsigned int queueMessage(void *handle, unsigned int queueAction, char *sid, cha
1874
1880
 
1875
1881
  unsigned int startTimer(void *handle, char *sid, unsigned int duration, char *timer) {
1876
1882
  void *rulesBinding;
1883
+ if (!sid) {
1884
+ sid = "0";
1885
+ }
1886
+
1877
1887
  unsigned int result = resolveBinding(handle, sid, &rulesBinding);
1878
1888
  if (result != RULES_OK) {
1879
1889
  return result;
@@ -1884,6 +1894,10 @@ unsigned int startTimer(void *handle, char *sid, unsigned int duration, char *ti
1884
1894
 
1885
1895
  unsigned int cancelTimer(void *handle, char *sid, char *timer) {
1886
1896
  void *rulesBinding;
1897
+ if (!sid) {
1898
+ sid = "0";
1899
+ }
1900
+
1887
1901
  unsigned int result = resolveBinding(handle, sid, &rulesBinding);
1888
1902
  if (result != RULES_OK) {
1889
1903
  return result;
@@ -1894,6 +1908,10 @@ unsigned int cancelTimer(void *handle, char *sid, char *timer) {
1894
1908
 
1895
1909
  unsigned int renewActionLease(void *handle, char *sid) {
1896
1910
  void *rulesBinding;
1911
+ if (!sid) {
1912
+ sid = "0";
1913
+ }
1914
+
1897
1915
  unsigned int result = resolveBinding(handle, sid, &rulesBinding);
1898
1916
  if (result != RULES_OK) {
1899
1917
  return result;
data/src/rules/net.c CHANGED
@@ -698,7 +698,7 @@ static unsigned int loadAddMessageCommand(ruleset *tree, binding *rulesBinding)
698
698
  "end\n"
699
699
  "local mid = message[\"id\"]\n"
700
700
  "if not mid then\n"
701
- " mid = \"$m-\" .. redis.call(\"hincrby\", mid_count_hashset, mid, 1)\n"
701
+ " mid = \"$m-\" .. redis.call(\"hincrby\", mid_count_hashset, sid, 1)\n"
702
702
  " message[\"id\"] = mid\n"
703
703
  "else\n"
704
704
  " if redis.call(\"hsetnx\", visited_hashset, mid, 1) == 0 then\n"
data/src/rules/state.c CHANGED
@@ -445,6 +445,10 @@ unsigned int fetchStateProperty(void *tree,
445
445
 
446
446
  unsigned int getState(void *handle, char *sid, char **state) {
447
447
  void *rulesBinding = NULL;
448
+ if (!sid) {
449
+ sid = "0";
450
+ }
451
+
448
452
  unsigned int result = resolveBinding(handle, sid, &rulesBinding);
449
453
  if (result != RULES_OK) {
450
454
  return result;
@@ -465,6 +469,10 @@ unsigned int getStateVersion(void *handle, char *sid, unsigned long *stateVersio
465
469
 
466
470
 
467
471
  unsigned int deleteState(void *handle, char *sid) {
472
+ if (!sid) {
473
+ sid = "0";
474
+ }
475
+
468
476
  void *rulesBinding = NULL;
469
477
  unsigned int result = resolveBinding(handle, sid, &rulesBinding);
470
478
  if (result != RULES_OK) {
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.34.26
4
+ version: 0.34.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesus Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-27 00:00:00.000000000 Z
11
+ date: 2017-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake