Introduce the new nonblock API.
[paraslash.git] / command.c
index afa1e66..b7795a0 100644 (file)
--- a/command.c
+++ b/command.c
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (C) 1997-2009 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2010 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -234,7 +234,7 @@ int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
 {
        int i, ret;
        char *ut;
 {
        int i, ret;
        char *ut;
-       char *sender_info = NULL, *sender_list = NULL;
+       char *sender_info = NULL;
 
        if (argc != 1)
                return -E_COMMAND_SYNTAX;
 
        if (argc != 1)
                return -E_COMMAND_SYNTAX;
@@ -243,8 +243,6 @@ int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
                char *info = senders[i].info();
                sender_info = para_strcat(sender_info, info);
                free(info);
                char *info = senders[i].info();
                sender_info = para_strcat(sender_info, info);
                free(info);
-               sender_list = para_strcat(sender_list, senders[i].name);
-               sender_list = para_strcat(sender_list, " ");
        }
        ut = uptime_str();
        ret = rc4_send_va_buffer(rc4c, "up: %s\nplayed: %u\n"
        }
        ut = uptime_str();
        ret = rc4_send_va_buffer(rc4c, "up: %s\nplayed: %u\n"
@@ -253,7 +251,6 @@ int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
                "connections (active/accepted/total): %u/%u/%u\n"
                "current loglevel: %s\n"
                "supported audio formats: %s\n"
                "connections (active/accepted/total): %u/%u/%u\n"
                "current loglevel: %s\n"
                "supported audio formats: %s\n"
-               "supported senders: %s\n"
                "%s",
                ut, mmd->num_played,
                (int)getppid(),
                "%s",
                ut, mmd->num_played,
                (int)getppid(),
@@ -263,12 +260,10 @@ int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
                mmd->num_connects,
                conf.loglevel_arg,
                supported_audio_formats(),
                mmd->num_connects,
                conf.loglevel_arg,
                supported_audio_formats(),
-               sender_list,
                sender_info
        );
        mutex_unlock(mmd_mutex);
        free(ut);
                sender_info
        );
        mutex_unlock(mmd_mutex);
        free(ut);
-       free(sender_list);
        free(sender_info);
        return ret;
 }
        free(sender_info);
        return ret;
 }
@@ -778,7 +773,7 @@ __noreturn void handle_connect(int fd, const char *peername)
                numbytes = 256;
                get_random_bytes_or_die((unsigned char *)buf, numbytes);
        }
                numbytes = 256;
                get_random_bytes_or_die((unsigned char *)buf, numbytes);
        }
-       PARA_DEBUG_LOG("sending %zu byte challenge + rc4 keys (%u bytes)\n",
+       PARA_DEBUG_LOG("sending %u byte challenge + rc4 keys (%zu bytes)\n",
                CHALLENGE_SIZE, numbytes);
        ret = send_bin_buffer(fd, buf, numbytes);
        if (ret < 0)
                CHALLENGE_SIZE, numbytes);
        ret = send_bin_buffer(fd, buf, numbytes);
        if (ret < 0)
@@ -788,7 +783,7 @@ __noreturn void handle_connect(int fd, const char *peername)
        if (ret < 0)
                goto net_err;
        numbytes = ret;
        if (ret < 0)
                goto net_err;
        numbytes = ret;
-       PARA_DEBUG_LOG("received %zu bytes challenge response\n", ret);
+       PARA_DEBUG_LOG("received %d bytes challenge response\n", ret);
        ret = -E_BAD_USER;
        if (!u)
                goto net_err;
        ret = -E_BAD_USER;
        if (!u)
                goto net_err;