s = blob_nest_start(&b, UBUS_ATTR_SIGNATURE);
list_for_each_entry(m, &obj->type->methods, list)
- blob_put(&b, blob_id(m->data), blob_data(m->data), blob_len(m->data));
+ blobmsg_add_blob(&b, m->data);
blob_nest_end(&b, s);
ubus_send_msg_from_blob(cl, ub, UBUS_MSG_DATA);
blob_put_int8(&b, UBUS_ATTR_ACTIVE, active);
ub = ubus_msg_from_blob(false);
+ if (!ub)
+ return;
+
ubus_msg_init(ub, UBUS_MSG_NOTIFY, ++obj->invoke_seq, 0);
ubus_msg_send(obj->client, ub, true);
}
blob_put_int32(&b, UBUS_ATTR_TARGET, s->target->id.id);
ub = ubus_msg_from_blob(false);
- ubus_msg_init(ub, UBUS_MSG_UNSUBSCRIBE, ++s->subscriber->invoke_seq, 0);
- ubus_msg_send(s->subscriber->client, ub, true);
+ if (ub != NULL) {
+ ubus_msg_init(ub, UBUS_MSG_UNSUBSCRIBE, ++s->subscriber->invoke_seq, 0);
+ ubus_msg_send(s->subscriber->client, ub, true);
+ }
ubus_unsubscribe(s);
}
-static void __init ubusd_proto_init(void)
+static void __constructor ubusd_proto_init(void)
{
ubus_init_id_tree(&clients);