X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=send_common.c;h=ea494d9a7b23f5ee87186917d11e883631ec9cbc;hp=90242d5c9b5ccb125617004e16fbf9b64d5484f6;hb=refs%2Fheads%2Fpu;hpb=c20e3e67fc2be1d5f8778b9c482271e023bbdcb8 diff --git a/send_common.c b/send_common.c index 90242d5c..8dc82e9c 100644 --- a/send_common.c +++ b/send_common.c @@ -21,10 +21,10 @@ #include "afs.h" #include "server.h" #include "acl.h" +#include "sched.h" #include "send.h" #include "close_on_fork.h" #include "chunk_queue.h" -#include "sched.h" #include "vss.h" /** Clients will be kicked if there are more than that many bytes pending. */ @@ -120,14 +120,14 @@ void init_sender_status(struct sender_status *ss, if (n == 0) { ss->num_listen_fds = 1; - ss->listen_addresses = para_malloc(sizeof(char *)); + ss->listen_addresses = alloc(sizeof(char *)); ss->listen_addresses[0] = NULL; - ss->listen_fds = para_malloc(sizeof(int)); + ss->listen_fds = alloc(sizeof(int)); ss->listen_fds[0] = -1; } else { ss->num_listen_fds = n; - ss->listen_addresses = para_malloc(n * sizeof(char *)); - ss->listen_fds = para_malloc(n * sizeof(int)); + ss->listen_addresses = alloc(n * sizeof(char *)); + ss->listen_fds = alloc(n * sizeof(int)); FOR_EACH_LISTEN_FD(i, ss) { ss->listen_addresses[i] = para_strdup(lls_string_val(i, listen_address_opt_result)); @@ -181,7 +181,7 @@ void free_sender_status(const struct sender_status *ss) * * \return The string printed in the "si" command. */ -char *generic_sender_status(struct sender_status *ss, const char *name) +__malloc char *generic_sender_status(struct sender_status *ss, const char *name) { char *clnts = NULL, *ret, *addr = NULL; struct sender_client *sc, *tmp_sc; @@ -343,7 +343,6 @@ void generic_com_off(struct sender_status *ss) * 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 @@ -367,7 +366,7 @@ void generic_com_off(struct sender_status *ss) * \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; @@ -376,7 +375,7 @@ struct sender_client *accept_sender_client(struct sender_status *ss, fd_set *rfd 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) @@ -391,7 +390,7 @@ struct sender_client *accept_sender_client(struct sender_status *ss, fd_set *rfd if (ret < 0) goto close_fd_and_warn; ss->num_clients++; - sc = para_calloc(sizeof(*sc)); + sc = zalloc(sizeof(*sc)); sc->fd = fd; sc->name = para_strdup(remote_name(fd)); sc->cq = cq_new(MAX_CQ_BYTES); @@ -414,7 +413,7 @@ warn: * \return A dynamically allocated string containing the help text for * a paraslash sender. */ -char *generic_sender_help(void) +__malloc char *generic_sender_help(void) { return make_message( "usage: {on|off}\n"