1
0
mirror of https://github.com/fumiama/simple-kanban.git synced 2026-06-25 05:18:59 +08:00

fix 多次

This commit is contained in:
源文雨
2022-10-26 15:46:42 +08:00
parent b21d7be3d4
commit 60cc834753

View File

@@ -323,7 +323,7 @@ static int close_file_and_send(threadtimer_t *timer, char *data, size_t numbytes
static int handle_accept(threadtimer_t* p) { static int handle_accept(threadtimer_t* p) {
int r = 1; int r = 1;
printf("Recv data from client@%d\n", p->index); printf("Recv data from client@%d\n", p->index);
if(send_data(my_fd(p), "Welcome to simple kanban server.", 33) <= 0) return 0; if(!~((p)->status) && send_data(my_fd(p), "Welcome to simple kanban server.", 33) <= 0) return 0;
while(((p)->numbytes = recv(my_fd(p), my_dat(p), TIMERDATSZ, MSG_DONTWAIT)) > 0) { while(((p)->numbytes = recv(my_fd(p), my_dat(p), TIMERDATSZ, MSG_DONTWAIT)) > 0) {
touch_timer(p); touch_timer(p);
my_dat(p)[(p)->numbytes] = 0; my_dat(p)[(p)->numbytes] = 0;