修复部分bug,添加内存池,为后续内存池化分配打基础
This commit is contained in:
@ -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)); // 统一清 0,gid 天然 '\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"
|
||||
|
||||
Reference in New Issue
Block a user