修复http解析

This commit is contained in:
2025-10-03 10:57:53 +08:00
parent d11c1559ab
commit f518bf5064
3 changed files with 66 additions and 4 deletions

View File

@ -99,9 +99,14 @@ ssize_t read_req(int fd, void *buf)
int process_message(char *req,log_manager *logger)
{
//TODO 修改管道命令解析
if(req[0]!='s')
if(req ==NULL )
return 0;
const char *body = http_get_body(req);
int fd;
char front,rear;
sscanf(req,"%s/%d/%s",&rear,&fd,&rear);
char *req_buf = recv_http_request(fd);
const char *body = http_get_body(req_buf);
free(req_buf);
rbt_msg message;
rbt_parse_json(body,&message);
make_swap((void*)&message);