projects
/
project
/
uhttpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes for json 0.12
[project/uhttpd.git]
/
ubus.c
diff --git
a/ubus.c
b/ubus.c
index
4fa0319
..
f7d1f11
100644
(file)
--- a/
ubus.c
+++ b/
ubus.c
@@
-192,16
+192,16
@@
static void uh_ubus_send_response(struct client *cl)
static void uh_ubus_init_response(struct client *cl)
{
struct dispatch_ubus *du = &cl->dispatch.ubus;
static void uh_ubus_init_response(struct client *cl)
{
struct dispatch_ubus *du = &cl->dispatch.ubus;
- struct json_object *obj = du->jsobj_cur;
+ struct json_object *obj = du->jsobj_cur
, *obj2 = NULL
;
blob_buf_init(&buf, 0);
blobmsg_add_string(&buf, "jsonrpc", "2.0");
if (obj)
blob_buf_init(&buf, 0);
blobmsg_add_string(&buf, "jsonrpc", "2.0");
if (obj)
-
obj = json_object_object_get(obj, "id"
);
+
json_object_object_get_ex(obj, "id", &obj2
);
- if (obj)
- blobmsg_add_json_element(&buf, "id", obj);
+ if (obj
2
)
+ blobmsg_add_json_element(&buf, "id", obj
2
);
else
blobmsg_add_field(&buf, BLOBMSG_TYPE_UNSPEC, "id", NULL, 0);
}
else
blobmsg_add_field(&buf, BLOBMSG_TYPE_UNSPEC, "id", NULL, 0);
}