Module: kamailio
Branch: 5.1
Commit: 53f46ab7b6eb311137033f6cdb27ef73d87cb3f2
URL:
https://github.com/kamailio/kamailio/commit/53f46ab7b6eb311137033f6cdb27ef7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-21T08:25:47+02:00
kazoo: replaced obsolete json is_error() macro
(cherry picked from commit 7d3766614832ef22433e36ef0791fa41796829a2)
---
Modified: src/modules/kazoo/kz_amqp.c
Modified: src/modules/kazoo/kz_json.c
---
Diff:
https://github.com/kamailio/kamailio/commit/53f46ab7b6eb311137033f6cdb27ef7…
Patch:
https://github.com/kamailio/kamailio/commit/53f46ab7b6eb311137033f6cdb27ef7…
---
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;
}