From 46d845837694629d1e856aaffa5669c6bb3eebd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Wed, 26 Oct 2022 16:05:09 +0800 Subject: [PATCH] fix set --- server.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server.c b/server.c index ce376f8..9c2d798 100644 --- a/server.c +++ b/server.c @@ -299,7 +299,7 @@ static int close_file_and_send(threadtimer_t *timer, char *data, size_t numbytes return send_data(timer->accept_fd, data, numbytes); } -#define take_word(p, w, buff) if((p)->numbytes > strlen(w) && strstr(buff, w) == buff) {\ +#define take_word(p, w, buff) if((p)->numbytes >= strlen(w) && strstr(buff, w) == buff) {\ printf("<--- Taking: %s --->\n", w);\ int l = strlen(w);\ char store = buff[l];\ @@ -331,7 +331,6 @@ static int handle_accept(threadtimer_t* p) { //处理部分粘连 take_word(p, cfg->pwd, my_dat(p)); take_word(p, "get", my_dat(p)); - take_word(p, "set", my_dat(p)); take_word(p, "cat", my_dat(p)); take_word(p, "quit", my_dat(p)); take_word(p, cfg->sps, my_dat(p));