client: simplified client_read()
Remove one comparison by changing branch order.
This commit is contained in:
parent
1bb154098d
commit
9ceadb0561
@ -453,10 +453,12 @@ static int client_read(struct client *client)
|
|||||||
|
|
||||||
if (bytesRead > 0)
|
if (bytesRead > 0)
|
||||||
return client_input_received(client, bytesRead);
|
return client_input_received(client, bytesRead);
|
||||||
else if (bytesRead == 0 || (bytesRead < 0 && errno != EINTR)) {
|
else if (bytesRead < 0 && errno == EINTR)
|
||||||
return COMMAND_RETURN_CLOSE;
|
/* try again later, after select() */
|
||||||
} else
|
|
||||||
return 0;
|
return 0;
|
||||||
|
else
|
||||||
|
/* peer disconnected or I/O error */
|
||||||
|
return COMMAND_RETURN_CLOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void client_manager_register_read_fd(fd_set * fds, int *fdmax)
|
static void client_manager_register_read_fd(fd_set * fds, int *fdmax)
|
||||||
|
Loading…
Reference in New Issue
Block a user