X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=send_common.c;h=144a48e1ad2ceeffff3d8076a9f79807a038447c;hp=33c56e7ab135b50a4c77242cb3534ec67d5d9608;hb=8b71176b792089c47acc788e1c1e068e9375fd18;hpb=c773ec0d537d239e2eebe2d77a786f0ba49fdc22 diff --git a/send_common.c b/send_common.c index 33c56e7a..144a48e1 100644 --- a/send_common.c +++ b/send_common.c @@ -1,14 +1,18 @@ /* - * Copyright (C) 2005-2010 Andre Noll + * Copyright (C) 2005-2014 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ /** \file send_common.c Functions used by more than one paraslash sender. */ +#include +#include #include -#include #include +#include +#include +#include #include "para.h" #include "error.h" @@ -23,6 +27,7 @@ #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. */ @@ -113,7 +118,7 @@ int send_queued_chunks(int fd, struct chunk_queue *cq) int ret; cq_get(qc, &buf, &len); - ret = write_nonblock(fd, buf, len); + ret = xwrite(fd, buf, len); if (ret < 0) return ret; cq_update(cq, ret); @@ -154,7 +159,7 @@ void init_sender_status(struct sender_status *ss, char **access_arg, * * \return The string printed in the "si" command. */ -char *get_sender_info(struct sender_status *ss, const char *name) +char *generic_sender_status(struct sender_status *ss, const char *name) { char *clnts = NULL, *ret; struct sender_client *sc, *tmp_sc; @@ -166,14 +171,12 @@ char *get_sender_info(struct sender_status *ss, const char *name) clnts = tmp; } ret = make_message( - "%s sender:\n" - "\tstatus: %s\n" - "\tport: %s\n" - "\tnumber of connected clients: %d\n" - "\tmaximal number of clients: %d%s\n" - "\tconnected clients: %s\n" - "\taccess %s list: %s\n", - name, + "status: %s\n" + "port: %s\n" + "number of connected clients: %d\n" + "maximal number of clients: %d%s\n" + "connected clients: %s\n" + "access %s list: %s\n", (ss->listen_fd >= 0)? "on" : "off", stringify_port(ss->port, strcmp(name, "http") ? "dccp" : "tcp"), ss->num_clients,