修复部分bug,添加内存池,为后续内存池化分配打基础

This commit is contained in:
2026-02-18 14:46:33 +08:00
parent 19e0392db6
commit b23828cd5c
8 changed files with 224 additions and 4 deletions

View File

@ -33,6 +33,8 @@ static void safe_strcpy(char *dst, size_t dst_size, const char *src)
/* 主解析 */
int rbt_parse_json(const char *json_text, rbt_msg *out)
{
if(json_text == NULL)
return -1;
memset(out, 0, sizeof(*out)); // 统一清 0gid 天然 '\0'
cJSON *root = cJSON_Parse(json_text);
@ -108,7 +110,7 @@ int process_message(char *req, log_manager *logger,rbt_msg *swap) {
make_swap(swap);
logger->in_log(log, logger);
}
//通知前端已收到消息
const char *response =
"HTTP/1.1 200 OK\r\n"
"Content-Type: text/plain\r\n"