Skip to content

Commit

Permalink
ubus: pass current session id as ubus_rpc_session attribute to any ca…
Browse files Browse the repository at this point in the history
…lled procedure
  • Loading branch information
jow- committed Aug 8, 2013
1 parent 4fb73b3 commit a7b7bad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ubus.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static void uh_ubus_single_error(struct client *cl, enum rpc_error type)
ops->request_done(cl);
}

static void uh_ubus_send_request(struct client *cl, json_object *obj, struct blob_attr *args)
static void uh_ubus_send_request(struct client *cl, json_object *obj, const char *sid, struct blob_attr *args)
{
struct dispatch *d = &cl->dispatch;
struct dispatch_ubus *du = &d->ubus;
Expand All @@ -253,6 +253,8 @@ static void uh_ubus_send_request(struct client *cl, json_object *obj, struct blo
blobmsg_for_each_attr(cur, args, rem)
blobmsg_add_blob(&req, cur);

blobmsg_add_string(&req, "ubus_rpc_session", sid);

blob_buf_init(&du->buf, 0);
memset(&du->req, 0, sizeof(du->req));
ret = ubus_invoke_async(ctx, du->obj, du->func, req.head, &du->req);
Expand Down Expand Up @@ -484,7 +486,7 @@ static void uh_ubus_handle_request_object(struct client *cl, struct json_object
goto error;
}

uh_ubus_send_request(cl, obj, data.data);
uh_ubus_send_request(cl, obj, data.sid, data.data);
goto out;
}
else if (!strcmp(data.method, "list")) {
Expand Down

0 comments on commit a7b7bad

Please sign in to comment.