🐞 fix(TSG-15212): 修复TFE_CMSG_SSL_INTERCEPT_STATE字段设置错误; 修复msgpack默写字段为空时, 增加默认值
This commit is contained in:
@@ -79,14 +79,20 @@ struct mpack_mmap_id2type
|
||||
|
||||
static int fqdn_id_set_cmsg(struct ctrl_pkt_parser *handler, mpack_node_t node, int table_index)
|
||||
{
|
||||
char empty_str[4] = {0};
|
||||
uint32_t fqdn_val[8] = {0};
|
||||
|
||||
uint32_t array_cnt = mpack_node_array_length(node);
|
||||
tfe_cmsg_set(handler->cmsg, TFE_CMSG_FQDN_CAT_ID_NUM, (const unsigned char *)&array_cnt, sizeof(uint32_t));
|
||||
for (uint32_t i = 0; i < array_cnt; i++) {
|
||||
fqdn_val[i] = mpack_node_u32(mpack_node_array_at(node, i));
|
||||
if (array_cnt > 0) {
|
||||
for (uint32_t i = 0; i < array_cnt; i++) {
|
||||
fqdn_val[i] = mpack_node_u32(mpack_node_array_at(node, i));
|
||||
}
|
||||
tfe_cmsg_set(handler->cmsg, TFE_CMSG_FQDN_CAT_ID_VAL, (const unsigned char*)fqdn_val, array_cnt * sizeof(uint32_t));
|
||||
}
|
||||
else {
|
||||
tfe_cmsg_set(handler->cmsg, TFE_CMSG_FQDN_CAT_ID_VAL, (const unsigned char *)empty_str, 0);
|
||||
}
|
||||
tfe_cmsg_set(handler->cmsg, TFE_CMSG_FQDN_CAT_ID_VAL, (const unsigned char*)fqdn_val, array_cnt * sizeof(uint32_t));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -124,6 +130,7 @@ static int proxy_parse_messagepack(mpack_node_t node, void *ctx, void *logger)
|
||||
{
|
||||
int ret = 0;
|
||||
uint64_t value = 0;
|
||||
char empty_str[4] = {0};
|
||||
char cmsg_str[256] = {0};
|
||||
struct ctrl_pkt_parser *handler = (struct ctrl_pkt_parser *)ctx;
|
||||
|
||||
@@ -152,10 +159,11 @@ static int proxy_parse_messagepack(mpack_node_t node, void *ctx, void *logger)
|
||||
tfe_cmsg_set(handler->cmsg, mpack_table[i].type, (const unsigned char *)&value, mpack_table[i].size);
|
||||
break;
|
||||
case mpack_type_str:
|
||||
snprintf(cmsg_str, sizeof(cmsg_str), mpack_node_str(ptr), mpack_node_strlen(ptr));
|
||||
mpack_node_copy_cstr(ptr, cmsg_str, sizeof(cmsg_str));
|
||||
tfe_cmsg_set(handler->cmsg, mpack_table[i].type, (const unsigned char *)cmsg_str, mpack_node_strlen(ptr));
|
||||
break;
|
||||
case mpack_type_nil:
|
||||
tfe_cmsg_set(handler->cmsg, mpack_table[i].type, (const unsigned char *)empty_str, 0);
|
||||
break;
|
||||
case mpack_type_array:
|
||||
switch(mpack_table[i].array_index)
|
||||
|
||||
Reference in New Issue
Block a user