Compare commits

...

2 Commits

Author SHA1 Message Date
d11c1559ab 时间原因,暂存部分更改 2025-10-03 10:01:01 +08:00
3ada071d44 优化模拟终端稳定性 2025-10-01 19:30:44 +08:00
5 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,11 @@
#include "erroprocess.h"
#include <stdio.h>
#include <stddef.h>
int give_upjobs(indiector *self)
{
if(self == NULL)
{
}
}

View File

@ -0,0 +1,20 @@
#ifndef ERROPROCESS
#define EROPROCESS
typedef struct jobs
{
struct jobs* next;
int job;
}jobs;
typedef struct indiector
{
int status;//熔断标志位
int retreat_index;//退避指数
jobs *head_job;
jobs *rear_job;
}indiector;
int give_upjobs(indiector *self);
#endif

View File

@ -89,6 +89,7 @@ int init_network(int port)
ssize_t read_req(int fd, void *buf)
{
// TODO 修改读取任务函数
ssize_t n = read(fd, buf, MAX_MESSAGE_BUF);
if (n == 0) /* 写端已关闭,管道永不会再有数据 */
return -1;
@ -97,6 +98,9 @@ ssize_t read_req(int fd, void *buf)
int process_message(char *req,log_manager *logger)
{
//TODO 修改管道命令解析
if(req[0]!='s')
return 0;
const char *body = http_get_body(req);
rbt_msg message;
rbt_parse_json(body,&message);

View File

@ -272,6 +272,8 @@ Ctl *init_tem(log_manager *logmanager)
tem->infifo = infifo;
tem->index = 0;
tem->logmanager = logmanager;
char *his_buf[HISTORY_BUF] = {NULL};
memcpy(tem->history,his_buf,HISTORY_BUF);
for(int i =0;i<6;i++)
{
tem->history[i] = NULL;

View File

@ -6,7 +6,7 @@
#include "interpreter/interpreter.h"
#define MAX_BUF 256
#define HISTORY_BUF 256
#define HISTORY_BUF 210
#define PROMPT "chatbot$$ "