From 37428e60d1d7dc834aa801d3cb100a707940b79b Mon Sep 17 00:00:00 2001 From: fumiama Date: Mon, 3 May 2021 20:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server.c b/server.c index aa004aa..ad97bea 100644 --- a/server.c +++ b/server.c @@ -169,6 +169,7 @@ int s1_get(THREADTIMER *timer) { //get kanban if(sscanf(timer->data, "%u", &cli_ver) > 0) { if(cli_ver < ver) { //need to send a new kanban closeFile(fp); + timer->is_open = 0; return sendAll(kanban_path, timer); } } @@ -332,6 +333,8 @@ void acceptClient() { timer->thread = &accept_threads[p]; timer->touch = time(NULL); timer->data = NULL; + timer->is_open = 0; + timer->fp = NULL; if (pthread_create(timer->thread, NULL, (void *)&handleAccept, timer)) puts("Error creating thread"); else puts("Creating thread succeeded"); } else puts("Allocate timer error");