115 |
tv.tv_usec = 0; |
tv.tv_usec = 0; |
116 |
fds = select (maxfd + 1, &rfdset, &wfdset, NULL, &tv); |
fds = select (maxfd + 1, &rfdset, &wfdset, NULL, &tv); |
117 |
} |
} |
118 |
|
|
119 |
|
/* FIXME: find a better way of doing this */ |
120 |
|
if(!haccess->is_connected()) |
121 |
|
engine_stop(); |
122 |
|
|
123 |
if (fds > 0) |
if (fds > 0) |
124 |
{ |
{ |
125 |
engine_read (&rfdset); |
engine_read (&rfdset); |
182 |
client[index].timeout = timeout; |
client[index].timeout = timeout; |
183 |
client[index].last_timeout = 0; |
client[index].last_timeout = 0; |
184 |
client[index].fn = fn; |
client[index].fn = fn; |
185 |
|
client[index].lastread = time (NULL); |
186 |
init_buffer (&client[index].in); |
init_buffer (&client[index].in); |
187 |
init_buffer (&client[index].out); |
init_buffer (&client[index].out); |
188 |
|
|
210 |
if (index == -1) |
if (index == -1) |
211 |
return; |
return; |
212 |
|
|
213 |
|
destroy_buffer(&client[index].in); |
214 |
|
destroy_buffer(&client[index].out); |
215 |
if (index < nbclients - 1) |
if (index < nbclients - 1) |
216 |
{ |
{ |
217 |
/* Shift all next clients */ |
/* Shift all next clients */ |
280 |
fd_set *fdset; |
fd_set *fdset; |
281 |
{ |
{ |
282 |
int i; |
int i; |
283 |
|
|
284 |
for (i = 0; i < nbclients; i++) |
for (i = 0; i < nbclients; i++) |
285 |
{ |
{ |
286 |
if (FD_ISSET (client[i].fd, fdset)) |
if (FD_ISSET (client[i].fd, fdset)) |