struct resource *resource;
if (!client)
- return NULL;
+ return;
resource = find_resource_by_type(client, resource_type);
if (!resource) {
static void handle_request_in_running(struct request_client *client, char *buffer)
{
- char response[10];
- int response_len;
int nr_tokens;
char *tokens[REQUEST_TOKEN_MAX];
int request_type;
struct timeval wait;
struct request_client *client = (struct request_client *)data;
- wait.tv_sec = 1;
- wait.tv_usec = 0;
-
FD_ZERO(&active_fds);
FD_SET(client->socket_fd, &active_fds);
while (client->worker_running) {
read_fds = active_fds;
+ wait.tv_sec = 1;
+ wait.tv_usec = 0;
if (select(FD_SETSIZE, &read_fds, NULL, NULL, &wait) < 0) {
_E("select failed");
goto error_out;
}
+
if (FD_ISSET(client->socket_fd, &read_fds)) {
/* client submits request */
recv_len = recv(client->socket_fd, buffer, REQUEST_MAX, 0);
FD_ZERO(&active_fds);
FD_SET(server_socket, &active_fds);
- wait.tv_sec = 1;
- wait.tv_usec = 0;
_I("start server");
client_list_test();
while (request_server_run) {
/* 1. (re)initialize client sockets */
read_fds = active_fds;
+ wait.tv_sec = 1;
+ wait.tv_usec = 0;
if (select(FD_SETSIZE, &read_fds, NULL, NULL, &wait) < 0) {
_E("select failed");