return false;
ubus_msg_init(ub, UBUS_MSG_HELLO, 0, cl->id.id);
- ubus_msg_send(cl, ub);
+ ubus_msg_send(cl, ub, true);
return true;
}
static int ubusd_send_pong(struct ubus_client *cl, struct ubus_msg_buf *ub, struct blob_attr **attr)
{
ub->hdr.type = UBUS_MSG_DATA;
- ubus_msg_send(cl, ubus_msg_ref(ub));
+ ubus_msg_send(cl, ub, false);
return 0;
}
if (!ub)
return UBUS_STATUS_NO_DATA;
- ubus_msg_send(cl, ub);
+ ubus_msg_send(cl, ub, true);
return 0;
}
if (!ub)
return;
- ubus_msg_send(cl, ub);
+ ubus_msg_send(cl, ub, true);
}
static int ubusd_handle_lookup(struct ubus_client *cl, struct ubus_msg_buf *ub, struct blob_attr **attr)
ub->hdr.type = UBUS_MSG_INVOKE;
ub->hdr.peer = cl->id.id;
- ubus_msg_send(obj->client, ub);
+ ubus_msg_send(obj->client, ub, true);
return -1;
}
static int ubusd_handle_response(struct ubus_client *cl, struct ubus_msg_buf *ub, struct blob_attr **attr)
{
struct ubus_object *obj;
- struct ubus_id *id;
if (!attr[UBUS_ATTR_OBJID] ||
(ub->hdr.type == UBUS_MSG_STATUS && !attr[UBUS_ATTR_STATUS]) ||
(ub->hdr.type == UBUS_MSG_DATA && !attr[UBUS_ATTR_DATA]))
goto error;
- id = ubus_find_id(&objects, blob_get_int32(attr[UBUS_ATTR_OBJID]));
- if (!id)
+ obj = ubusd_find_object(blob_get_int32(attr[UBUS_ATTR_OBJID]));
+ if (!obj)
goto error;
- obj = container_of(id, struct ubus_object, id);
if (cl != obj->client)
goto error;
goto error;
ub->hdr.peer = blob_get_int32(attr[UBUS_ATTR_OBJID]);
- ubus_msg_send(cl, ub);
+ ubus_msg_send(cl, ub, true);
return -1;
error:
ubus_msg_free(ub);
*retmsg_data = htonl(ret);
- ubus_msg_send(cl, ubus_msg_ref(retmsg));
+ ubus_msg_send(cl, retmsg, false);
}
static void __init ubusd_proto_init(void)