Module: kamailio
Branch: master
Commit: 7d3766614832ef22433e36ef0791fa41796829a2
URL: 
https://github.com/kamailio/kamailio/commit/7d3766614832ef22433e36ef0791fa41796829a2

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2018-06-07T10:33:26+02:00

kazoo: replaced obsolete json is_error() macro

---

Modified: src/modules/kazoo/kz_amqp.c
Modified: src/modules/kazoo/kz_json.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/7d3766614832ef22433e36ef0791fa41796829a2.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7d3766614832ef22433e36ef0791fa41796829a2.patch

---

diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index 3e161839dc..36e7ea0843 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -1241,7 +1241,7 @@ int kz_amqp_publish(struct sip_msg* msg, char* exchange, 
char* routing_key, char
 
                struct json_object *j = json_tokener_parse(json_s.s);
 
-               if (is_error(j)) {
+               if (j==NULL) {
                        LM_ERR("empty or invalid JSON payload : %.*s\n", 
json_s.len, json_s.s);
                        return -1;
                }
@@ -1304,7 +1304,7 @@ int kz_amqp_async_query(struct sip_msg* msg, char* 
_exchange, char* _routing_key
 
          json_obj = json_tokener_parse(json_s.s);
 
-         if (is_error(json_obj)) {
+         if (json_obj==NULL) {
                  LM_ERR("empty or invalid JSON payload : %*.s\n", json_s.len, 
json_s.s);
                  goto error;
          }
@@ -1457,7 +1457,7 @@ int kz_amqp_query_ex(struct sip_msg* msg, char* exchange, 
char* routing_key, cha
 
                struct json_object *j = json_tokener_parse(json_s.s);
 
-               if (is_error(j)) {
+               if (j==NULL) {
                        LM_ERR("empty or invalid JSON payload : %*.s\n", 
json_s.len, json_s.s);
                        return -1;
                }
diff --git a/src/modules/kazoo/kz_json.c b/src/modules/kazoo/kz_json.c
index 7911489eaf..4fd30998f6 100644
--- a/src/modules/kazoo/kz_json.c
+++ b/src/modules/kazoo/kz_json.c
@@ -132,7 +132,7 @@ struct json_object * kz_json_get_field_object(str* json, 
str* field)
   struct json_object *j = json_tokener_parse(dup);
   pkg_free(dup);
 
-  if (is_error(j)) {
+  if (j==NULL) {
          LM_ERR("empty or invalid JSON\n");
          return NULL;
   }


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to