projects
/
project
/
ubus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libubus: reduce code duplication and add stack depth protection for unsubscribe/notif...
[project/ubus.git]
/
libubus.c
diff --git
a/libubus.c
b/libubus.c
index
dffbfeb
..
e9809cf
100644
(file)
--- a/
libubus.c
+++ b/
libubus.c
@@
-214,6
+214,8
@@
void __hidden ubus_process_msg(struct ubus_context *ctx, struct ubus_msghdr *hdr
break;
case UBUS_MSG_INVOKE:
break;
case UBUS_MSG_INVOKE:
+ case UBUS_MSG_UNSUBSCRIBE:
+ case UBUS_MSG_NOTIFY:
if (ctx->stack_depth > 2) {
pending = calloc(1, sizeof(*pending) +
blob_raw_len(hdr->data));
if (ctx->stack_depth > 2) {
pending = calloc(1, sizeof(*pending) +
blob_raw_len(hdr->data));
@@
-225,17
+227,9
@@
void __hidden ubus_process_msg(struct ubus_context *ctx, struct ubus_msghdr *hdr
blob_raw_len(hdr->data));
list_add(&pending->list, &ctx->pending);
} else {
blob_raw_len(hdr->data));
list_add(&pending->list, &ctx->pending);
} else {
- ubus_process_
invoke
(ctx, hdr);
+ ubus_process_
obj_msg
(ctx, hdr);
}
break;
}
break;
-
- case UBUS_MSG_UNSUBSCRIBE:
- ubus_process_unsubscribe(ctx, hdr);
- break;
-
- case UBUS_MSG_NOTIFY:
- ubus_process_notify(ctx, hdr);
- break;
}
}
}
}