HTTPContext *c, *c_next;
if (my_http_addr.sin_port) {
- server_fd = socket_open_listen(&my_http_addr);
- if (server_fd < 0)
- return -1;
+ server_fd = socket_open_listen(&my_http_addr);
+ if (server_fd < 0)
+ return -1;
}
if (my_rtsp_addr.sin_port) {
- rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
- if (rtsp_server_fd < 0)
- return -1;
+ rtsp_server_fd = socket_open_listen(&my_rtsp_addr);
+ if (rtsp_server_fd < 0)
+ return -1;
}
if (!rtsp_server_fd && !server_fd) {
for(;;) {
poll_entry = poll_table;
if (server_fd) {
- poll_entry->fd = server_fd;
- poll_entry->events = POLLIN;
- poll_entry++;
+ poll_entry->fd = server_fd;
+ poll_entry->events = POLLIN;
+ poll_entry++;
}
if (rtsp_server_fd) {
- poll_entry->fd = rtsp_server_fd;
- poll_entry->events = POLLIN;
- poll_entry++;
+ poll_entry->fd = rtsp_server_fd;
+ poll_entry->events = POLLIN;
+ poll_entry++;
}
/* wait for events on each HTTP handle */
poll_entry = poll_table;
if (server_fd) {
- /* new HTTP connection request ? */
- if (poll_entry->revents & POLLIN)
- new_connection(server_fd, 0);
- poll_entry++;
+ /* new HTTP connection request ? */
+ if (poll_entry->revents & POLLIN)
+ new_connection(server_fd, 0);
+ poll_entry++;
}
if (rtsp_server_fd) {
- /* new RTSP connection request ? */
- if (poll_entry->revents & POLLIN)
- new_connection(rtsp_server_fd, 1);
+ /* new RTSP connection request ? */
+ if (poll_entry->revents & POLLIN)
+ new_connection(rtsp_server_fd, 1);
}
}
}