free(client);
}
/* Accept connections on the local socket. */
- ret = para_accept(ct->fd, &s->rfds, &unix_addr, sizeof(unix_addr), &fd);
+ ret = para_accept(ct->fd, &unix_addr, sizeof(unix_addr), &fd);
if (ret < 0)
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
if (ret <= 0)
ret = task_get_notification(ct->task);
if (ret < 0)
return ret;
- ret = handle_connect(ct->fd, &s->rfds);
+ ret = handle_connect(ct->fd);
if (ret < 0) {
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
if (ret == -E_AUDIOD_TERM) {
/* defined in audiod_command.c */
void audiod_status_dump(bool force);
void close_stat_clients(void);
-int handle_connect(int accept_fd, fd_set *rfds);
+int handle_connect(int accept_fd);
void stat_client_write_item(int item_num);
* Handle arriving connections on the local socket.
*
* \param accept_fd The fd to accept connections on.
- * \param rfds If \a accept_fd is not set in \a rfds, do nothing.
*
* This is called in each iteration of the select loop. If there is an incoming
* connection on \a accept_fd, this function reads the command sent by the peer,
*
* \sa \ref para_accept(), \ref recv_cred_buffer().
* */
-int handle_connect(int accept_fd, fd_set *rfds)
+int handle_connect(int accept_fd)
{
int argc, ret, clifd;
char buf[MAXLINE], **argv = NULL;
char *errctx = NULL;
const struct audiod_command_info *aci;
- ret = para_accept(accept_fd, rfds, &unix_addr, sizeof(struct sockaddr_un), &clifd);
+ ret = para_accept(accept_fd, &unix_addr, sizeof(struct sockaddr_un), &clifd);
if (ret <= 0)
return ret;
ret = recv_cred_buffer(clifd, buf, sizeof(buf) - 1);
dccp_shutdown_client(sc);
}
-static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds)
+static void dccp_post_select(__a_unused fd_set *rfds, __a_unused fd_set *wfds)
{
struct sender_client *sc;
struct dccp_fec_client *dfc;
int tx_ccid;
uint32_t k, n;
- sc = accept_sender_client(dss, rfds);
+ sc = accept_sender_client(dss);
if (!sc)
return;
}
}
-static void http_post_select(fd_set *rfds, __a_unused fd_set *wfds)
+static void http_post_select(__a_unused fd_set *rfds, __a_unused fd_set *wfds)
{
struct sender_client *sc, *tmp;
struct private_http_sender_data *phsd;
break;
}
}
- sc = accept_sender_client(hss, rfds);
+ sc = accept_sender_client(hss);
if (!sc)
return;
phsd = para_malloc(sizeof(*phsd));
* Wrapper around the accept system call.
*
* \param fd The listening socket.
- * \param rfds An optional fd_set pointer.
* \param addr Structure which is filled in with the address of the peer socket.
* \param size Should contain the size of the structure pointed to by \a addr.
* \param new_fd Result pointer.
*
- * Accept incoming connections on \a addr, retry if interrupted. If \a rfds is
- * not \p NULL, return 0 if \a fd is not set in \a rfds without calling accept().
+ * Accept incoming connections on addr, retry if interrupted.
*
* \return Negative on errors, zero if no connections are present to be accepted,
* one otherwise.
*
* \sa accept(2).
*/
-int para_accept(int fd, fd_set *rfds, void *addr, socklen_t size, int *new_fd)
+int para_accept(int fd, void *addr, socklen_t size, int *new_fd)
{
int ret;
- if (rfds && !FD_ISSET(fd, rfds))
- return 0;
do
ret = accept(fd, (struct sockaddr *) addr, &size);
while (ret < 0 && errno == EINTR);
int recv_bin_buffer(int fd, char *buf, size_t size);
int recv_buffer(int fd, char *buf, size_t size);
-int para_accept(int fd, fd_set *rfds, void *addr, socklen_t size, int *new_fd);
+int para_accept(int fd, void *addr, socklen_t size, int *new_fd);
int create_local_socket(const char *name);
int connect_local_socket(const char *name);
int recv_cred_buffer(int, char *, size_t);
void generic_acl_deplete(struct list_head *acl);
void generic_com_off(struct sender_status *ss);
char *generic_sender_help(void);
-struct sender_client *accept_sender_client(struct sender_status *ss, fd_set *rfds);
+struct sender_client *accept_sender_client(struct sender_status *ss);
int send_queued_chunks(int fd, struct chunk_queue *cq);
int parse_fec_url(const char *arg, struct sender_command_data *scd);
* Accept a connection on the socket(s) this server is listening on.
*
* \param ss The sender whose listening fd is ready for reading.
- * \param rfds Passed to para_accept(),
*
* This accepts incoming connections on any of the listening sockets of the
* server. If there is a connection pending, the function
* \sa \ref para_accept(), \ref mark_fd_nonblocking(), \ref acl_check_access(),
* \ref cq_new(), \ref add_close_on_fork_list().
*/
-struct sender_client *accept_sender_client(struct sender_status *ss, fd_set *rfds)
+struct sender_client *accept_sender_client(struct sender_status *ss)
{
struct sender_client *sc;
int fd, ret;
FOR_EACH_LISTEN_FD(n, ss) {
if (ss->listen_fds[n] < 0)
continue;
- ret = para_accept(ss->listen_fds[n], rfds, NULL, 0, &fd);
+ ret = para_accept(ss->listen_fds[n], NULL, 0, &fd);
if (ret < 0)
goto warn;
if (ret == 0)
pid_t child_pid;
uint32_t *chunk_table;
- ret = para_accept(sct->listen_fds[listen_idx], &s->rfds, NULL, 0, &new_fd);
+ ret = para_accept(sct->listen_fds[listen_idx], NULL, 0, &new_fd);
if (ret <= 0)
goto out;
mmd->num_connects++;