- 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);
- switch (hc->status) {
- case HTTP_STREAMING:
- case HTTP_GOT_GET_REQUEST: /* need to send ok msg */
- case HTTP_INVALID_GET_REQUEST: /* need to send err msg */
- break;
- case HTTP_CONNECTED: /* need to recv get request */
- para_fd_set(hc->fd, rfds, max_fileno);
- break;
- }
- }
-}
-
-static int http_open(void)
-{
- int ret;
-
- listen_fd = para_listen(AF_UNSPEC, IPPROTO_TCP, conf.http_port_arg);
- if (listen_fd < 0)
- return listen_fd;
- ret = mark_fd_nonblocking(listen_fd);
- if (ret < 0) {
- PARA_EMERG_LOG("%s\n", para_strerror(-ret));
- exit(EXIT_FAILURE);
+ list_for_each_entry_safe(sc, tmp, &clients, node) {
+ struct private_http_sender_data *phsd = sc->private_data;
+ if (phsd->status == HTTP_CONNECTED) /* need to recv get request */
+ para_fd_set(sc->fd, rfds, max_fileno);