X-Git-Url: http://git.archive.openwrt.org/?p=project%2Frpcd.git;a=blobdiff_plain;f=plugin.c;h=b75241aae1f82ce0a84b5d40c1c74b2e8c0577ed;hp=ba8d8db44d2f554b202ca25558899d6195321dac;hb=b65f6a844f920eb19f7d05d2ee93819b72021057;hpb=6b189b2201b4302e5e287a9aa51a29c06bdefb11 diff --git a/plugin.c b/plugin.c index ba8d8db..b75241a 100644 --- a/plugin.c +++ b/plugin.c @@ -1,7 +1,7 @@ /* * rpcd - UBUS RPC server * - * Copyright (C) 2013 Jo-Philipp Wich + * Copyright (C) 2013-2014 Jo-Philipp Wich * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -108,12 +108,9 @@ rpc_plugin_call_finish_cb(struct blob_buf *blob, int stat, void *priv) { if (c->obj) { - if (json_object_get_type(c->obj) == json_type_object || - json_object_get_type(c->obj) == json_type_array) - { - blobmsg_add_json_element(blob, NULL, c->obj); + if (json_object_get_type(c->obj) == json_type_object && + blobmsg_add_object(blob, c->obj)) rv = UBUS_STATUS_OK; - } json_object_put(c->obj); }