1
0
mirror of https://github.com/fumiama/simple-kanban.git synced 2026-06-23 20:16:44 +08:00

fix client

This commit is contained in:
源文雨
2023-11-08 18:38:00 +09:00
parent 2df02e6032
commit 34885e9e9c

View File

@@ -91,7 +91,7 @@ static int s3_set_data(tcpool_thread_timer_t *timer);
printf("<--- pass in %zd --->\n", (p)->numbytes); \ printf("<--- pass in %zd --->\n", (p)->numbytes); \
} }
static void accept_action(tcpool_thread_timer_t *p) { static void accept_action(tcpool_thread_timer_t *p) {
if(send_data(p->accept_fd, "Welcome to simple kanban server. get", 36) <= 0) { if(send_data(p->accept_fd, "Welcome to simple kanban server. ", 33) <= 0) {
puts("Send banner to new client failed"); puts("Send banner to new client failed");
return; return;
} }
@@ -230,6 +230,9 @@ static int s1_get(tcpool_thread_timer_t *timer) {
uint32_t close_file_wrap_data[2] = {timer->index, (uint32_t)timer->isdata}; uint32_t close_file_wrap_data[2] = {timer->index, (uint32_t)timer->isdata};
int r; uint32_t ver, cli_ver; int r; uint32_t ver, cli_ver;
r = send_data(timer->accept_fd, "get", 3);
if (!r) goto GET_END;
pthread_cleanup_push((void (*)(void*))&close_file_wrap, (void*)close_file_wrap_data); pthread_cleanup_push((void (*)(void*))&close_file_wrap, (void*)close_file_wrap_data);
timer->isdata = 0; timer->isdata = 0;
r = fscanf(fp, "%u", &ver); r = fscanf(fp, "%u", &ver);