char *name;
/** The client's current status. */
enum http_status status;
- /** Non-zero if we included \a fd in the read set.*/
- int check_r;
/** The position of this client in the client list. */
struct list_head node;
/** non-zero if audio file header has been sent */
case HTTP_STREAMING: /* nothing to do */
break;
case HTTP_CONNECTED: /* need to recv get request */
- if (hc->check_r && FD_ISSET(hc->fd, rfds)) {
+ if (FD_ISSET(hc->fd, rfds)) {
if (recv_pattern(hc->fd, HTTP_GET_MSG, MAXLINE)
< 0) {
hc->status = HTTP_INVALID_GET_REQUEST;
para_fd_set(listen_fd, rfds, max_fileno);
list_for_each_entry_safe(hc, tmp, &clients, node) {
//PARA_DEBUG_LOG("hc %p on fd %d: status %d\n", hc, hc->fd, hc->status);
- hc->check_r = 0;
switch (hc->status) {
case HTTP_STREAMING:
case HTTP_GOT_GET_REQUEST: /* need to send ok msg */
break;
case HTTP_CONNECTED: /* need to recv get request */
para_fd_set(hc->fd, rfds, max_fileno);
- hc->check_r = 1;
break;
}
}