summaryrefslogtreecommitdiff
path: root/shaping/src/shaper_marsio.cpp
diff options
context:
space:
mode:
authorliuchang <[email protected]>2023-06-12 08:08:22 +0000
committerliuchang <[email protected]>2023-06-12 08:08:22 +0000
commitd23be1adab8aec295981db8a34a38cd6bd933410 (patch)
tree930540204604421db10acf940fd224e8dbf9e810 /shaping/src/shaper_marsio.cpp
parent64ad3f73726f2f1f9fc02f5729cac823d686fd73 (diff)
add debug info for msgpack parse
Diffstat (limited to 'shaping/src/shaper_marsio.cpp')
-rw-r--r--shaping/src/shaper_marsio.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/shaping/src/shaper_marsio.cpp b/shaping/src/shaper_marsio.cpp
index 36e0a03..605de9c 100644
--- a/shaping/src/shaper_marsio.cpp
+++ b/shaping/src/shaper_marsio.cpp
@@ -194,6 +194,11 @@ int shaper_marsio_ctrl_pkt_data_parse(struct ctrl_pkt_data *ctrl_data, const cha
mpack_tree_parse(&tree);
root = mpack_tree_root(&tree);
+ if (mpack_node_type(root) == mpack_type_nil) {
+ LOG_ERROR("%s: shaping marsio msgpack root type wrong, type is %d", LOG_TAG_MARSIO, mpack_node_type(root) );
+ goto ERROR;
+ }
+
//tsync
tmp_node = mpack_node_map_cstr(root, "tsync");
if (mpack_type_str != mpack_node_type(tmp_node)) {
@@ -253,7 +258,7 @@ int shaper_marsio_ctrl_pkt_data_parse(struct ctrl_pkt_data *ctrl_data, const cha
}
tmp_node = mpack_node_map_cstr(shaper, "rule_ids");
if (mpack_type_array != mpack_node_type(tmp_node)) {
- LOG_ERROR("%s: shaping marsio msgpack shaper type wrong, type is %d", LOG_TAG_MARSIO, mpack_node_type(tmp_node));
+ LOG_ERROR("%s: shaping marsio msgpack rule_ids type wrong, type is %d", LOG_TAG_MARSIO, mpack_node_type(tmp_node));
goto ERROR;
}