/*
- * Copyright (C) 2005-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005 Andre Noll <maan@tuebingen.mpg.de>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file send_common.c Functions used by more than one paraslash sender. */
+#include <netinet/in.h>
+#include <sys/socket.h>
#include <regex.h>
-#include <dirent.h>
#include <osl.h>
+#include <arpa/inet.h>
+#include <sys/un.h>
+#include <netdb.h>
#include "para.h"
#include "error.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. */
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);
*
* \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;
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,