ops->request_done(cl);
}
-static void uh_ubus_send_request(struct client *cl, json_object *obj)
+static void uh_ubus_send_request(struct client *cl, json_object *obj, struct blob_attr *args)
{
struct dispatch *d = &cl->dispatch;
struct dispatch_ubus *du = &d->ubus;
- int ret;
+ struct blob_attr *cur;
+ static struct blob_buf req;
+ int ret, rem;
+
+ blob_buf_init(&req, 0);
+ blobmsg_for_each_attr(cur, args, rem)
+ blobmsg_add_blob(&req, cur);
blob_buf_init(&du->buf, 0);
memset(&du->req, 0, sizeof(du->req));
- ret = ubus_invoke_async(ctx, du->obj, du->func, buf.head, &du->req);
+ ret = ubus_invoke_async(ctx, du->obj, du->func, req.head, &du->req);
if (ret)
return uh_ubus_json_error(cl, ERROR_INTERNAL);
goto error;
}
- uh_ubus_send_request(cl, obj);
+ uh_ubus_send_request(cl, obj, data.data);
return;
error: