/** \file send_common.c Functions used by more than one paraslash sender. */
+#include <regex.h>
#include <dirent.h>
+#include <osl.h>
+
#include "para.h"
#include "error.h"
#include "string.h"
*/
static int open_sender(unsigned l4type, int port)
{
- int fd, ret = para_listen(AF_UNSPEC, l4type, port);
+ int fd, ret = para_listen_simple(l4type, port);
if (ret < 0)
return ret;
*
* \return The string printed in the "si" command.
*/
-char *get_sender_info(struct sender_status *ss, char *name)
+char *get_sender_info(struct sender_status *ss, const char *name)
{
char *clnts = NULL, *ret;
struct sender_client *sc, *tmp_sc;
ret = make_message(
"%s sender:\n"
"\tstatus: %s\n"
- "\tport: %d\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,
(ss->listen_fd >= 0)? "on" : "off",
- ss->port,
+ stringify_port(ss->port, strcmp(name, "http") ? "dccp" : "tcp"),
ss->num_clients,
ss->max_clients,
ss->max_clients > 0? "" : " (unlimited)",