summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
181beb3)
Just pass a pointer to struct sched instead of the fd sets. Since
two of the prototypes declared in send.h now refer to this structure,
sched.h must be included before send.h.
The udp sender implements neither ->pre_select() nor ->post_select(),
so we only need to fix the order in which send.h and sched.h are
included.
#include "net.h"
#include "server.h"
#include "list.h"
#include "net.h"
#include "server.h"
#include "list.h"
#include "vss.h"
#include "daemon.h"
#include "fd.h"
#include "vss.h"
#include "daemon.h"
#include "fd.h"
#include "net.h"
#include "server.h"
#include "list.h"
#include "net.h"
#include "server.h"
#include "list.h"
#include "vss.h"
#include "fd.h"
#include "vss.h"
#include "fd.h"
struct fec_client *fc;
};
struct fec_client *fc;
};
-static void dccp_pre_select(int *max_fileno, fd_set *rfds,
- __a_unused fd_set *wfds)
+static void dccp_pre_select(struct sched *s)
{
unsigned n;
FOR_EACH_LISTEN_FD(n, dss)
if (dss->listen_fds[n] >= 0)
{
unsigned n;
FOR_EACH_LISTEN_FD(n, dss)
if (dss->listen_fds[n] >= 0)
- para_fd_set(dss->listen_fds[n], rfds, max_fileno);
+ para_fd_set(dss->listen_fds[n], &s->rfds, &s->max_fileno);
dccp_shutdown_client(sc);
}
dccp_shutdown_client(sc);
}
-static void dccp_post_select(__a_unused fd_set *rfds, __a_unused fd_set *wfds)
+static void dccp_post_select(__a_unused struct sched *s)
{
struct sender_client *sc;
struct dccp_fec_client *dfc;
{
struct sender_client *sc;
struct dccp_fec_client *dfc;
#include "server.h"
#include "http.h"
#include "list.h"
#include "server.h"
#include "http.h"
#include "list.h"
#include "vss.h"
#include "close_on_fork.h"
#include "fd.h"
#include "vss.h"
#include "close_on_fork.h"
#include "fd.h"
-static void http_post_select(__a_unused fd_set *rfds, __a_unused fd_set *wfds)
+static void http_post_select(__a_unused struct sched *s)
{
struct sender_client *sc, *tmp;
struct private_http_sender_data *phsd;
{
struct sender_client *sc, *tmp;
struct private_http_sender_data *phsd;
phsd->status = HTTP_CONNECTED;
}
phsd->status = HTTP_CONNECTED;
}
-static void http_pre_select(int *max_fileno, fd_set *rfds, fd_set *wfds)
+static void http_pre_select(struct sched *s)
{
struct sender_client *sc, *tmp;
unsigned n;
{
struct sender_client *sc, *tmp;
unsigned n;
FOR_EACH_LISTEN_FD(n, hss) {
if (hss->listen_fds[n] < 0)
continue;
FOR_EACH_LISTEN_FD(n, hss) {
if (hss->listen_fds[n] < 0)
continue;
- para_fd_set(hss->listen_fds[n], rfds, max_fileno);
+ para_fd_set(hss->listen_fds[n], &s->rfds, &s->max_fileno);
}
list_for_each_entry_safe(sc, tmp, &hss->client_list, node) {
struct private_http_sender_data *phsd = sc->private_data;
if (phsd->status == HTTP_CONNECTED) /* need to recv get request */
}
list_for_each_entry_safe(sc, tmp, &hss->client_list, 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);
+ para_fd_set(sc->fd, &s->rfds, &s->max_fileno);
if (phsd->status == HTTP_GOT_GET_REQUEST ||
phsd->status == HTTP_INVALID_GET_REQUEST)
if (phsd->status == HTTP_GOT_GET_REQUEST ||
phsd->status == HTTP_INVALID_GET_REQUEST)
- para_fd_set(sc->fd, wfds, max_fileno);
+ para_fd_set(sc->fd, &s->wfds, &s->max_fileno);
* Add file descriptors to fd_sets.
*
* The pre_select function of each supported sender is called just before
* Add file descriptors to fd_sets.
*
* The pre_select function of each supported sender is called just before
- * para_server enters its main select loop. Each sender may add its own
- * file descriptors to the \a rfds or the \a wfds set.
- *
- * If a file descriptor was added, \a max_fileno must be increased by
- * this function, if necessary.
+ * para_server enters its main select loop. Each sender may watch its own
+ * file descriptors for reading or writing.
- void (*pre_select)(int *max_fileno, fd_set *rfds, fd_set *wfds);
+ void (*pre_select)(struct sched *s);
/**
* Handle the file descriptors which are ready for I/O.
*
/**
* Handle the file descriptors which are ready for I/O.
*
- * If the pre_select hook added one ore more file descriptors to the
- * read or write set, this is the hook to check the result and do any
- * I/O on those descriptors which are ready for reading/writing.
+ * If the pre_select hook asked for one or more file descriptors to be
+ * watched, this is the hook to check the result and perform I/O on the
+ * descriptors which are ready for reading/writing.
- void (*post_select)(fd_set *rfds, fd_set *wfds);
+ void (*post_select)(struct sched *s);
/**
* Terminate all connected clients.
*
/**
* Terminate all connected clients.
*
#include "afs.h"
#include "server.h"
#include "acl.h"
#include "afs.h"
#include "server.h"
#include "acl.h"
#include "send.h"
#include "close_on_fork.h"
#include "chunk_queue.h"
#include "send.h"
#include "close_on_fork.h"
#include "chunk_queue.h"
#include "vss.h"
/** Clients will be kicked if there are more than that many bytes pending. */
#include "vss.h"
/** Clients will be kicked if there are more than that many bytes pending. */
#include "net.h"
#include "server.h"
#include "list.h"
#include "net.h"
#include "server.h"
#include "list.h"
#include "vss.h"
#include "config.h"
#include "close_on_fork.h"
#include "vss.h"
#include "config.h"
#include "close_on_fork.h"
#include "net.h"
#include "server.h"
#include "list.h"
#include "net.h"
#include "server.h"
#include "list.h"
#include "vss.h"
#include "portable_io.h"
#include "fd.h"
#include "vss.h"
#include "portable_io.h"
#include "fd.h"
#include "net.h"
#include "server.h"
#include "list.h"
#include "net.h"
#include "server.h"
#include "list.h"
#include "vss.h"
#include "ipc.h"
#include "fd.h"
#include "vss.h"
#include "ipc.h"
#include "fd.h"
FOR_EACH_SENDER(i) {
if (!senders[i]->pre_select)
continue;
FOR_EACH_SENDER(i) {
if (!senders[i]->pre_select)
continue;
- senders[i]->pre_select(&s->max_fileno, &s->rfds, &s->wfds);
+ senders[i]->pre_select(s);
}
vss_compute_timeout(s, vsst);
}
}
vss_compute_timeout(s, vsst);
}
FOR_EACH_SENDER(i) {
if (!senders[i]->post_select)
continue;
FOR_EACH_SENDER(i) {
if (!senders[i]->post_select)
continue;
- senders[i]->post_select(&s->rfds, &s->wfds);
+ senders[i]->post_select(s);
}
if ((vss_playing() && !(mmd->vss_status_flags & VSS_PLAYING)) ||
(vss_next() && vss_playing()))
}
if ((vss_playing() && !(mmd->vss_status_flags & VSS_PLAYING)) ||
(vss_next() && vss_playing()))