mirror of
https://github.com/fumiama/simple-kanban.git
synced 2026-06-19 00:55:39 +08:00
fix recv nil
This commit is contained in:
3
server.c
3
server.c
@@ -207,10 +207,11 @@ static void accept_client() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HANDLE_CLIENTS:
|
HANDLE_CLIENTS:
|
||||||
|
char c;
|
||||||
for(i = 0; i < THREADCNT; i++) {
|
for(i = 0; i < THREADCNT; i++) {
|
||||||
if(timers[i].touch && timers[i].accept_fd) {
|
if(timers[i].touch && timers[i].accept_fd) {
|
||||||
if(FD_ISSET(timers[i].accept_fd, &rdfds)) {
|
if(FD_ISSET(timers[i].accept_fd, &rdfds)) {
|
||||||
if(!handle_accept(&timers[i])) clean_timer(&timers[i]);
|
if(recv(timers[i].accept_fd, &c, 1, MSG_PEEK) <= 0 || !handle_accept(&timers[i])) clean_timer(&timers[i]);
|
||||||
else FD_SET(timers[i].accept_fd, &tmpfds);
|
else FD_SET(timers[i].accept_fd, &tmpfds);
|
||||||
} else if(FD_ISSET(timers[i].accept_fd, &erfds)) {
|
} else if(FD_ISSET(timers[i].accept_fd, &erfds)) {
|
||||||
printf("Close@%d due to error\n", i);
|
printf("Close@%d due to error\n", i);
|
||||||
|
|||||||
Reference in New Issue
Block a user