Revert "apcups plugin: Handle "END APC" lines correctly and stop reading."
[collectd.git] / src / apcups.c
index 29d58c3..8006bd1 100644 (file)
@@ -220,7 +220,7 @@ static int net_recv (int *sockfd, char *buf, int buflen)
  * Returns zero on success
  * Returns non-zero on error
  */
-static int net_send (int *sockfd, char *buff, int len)
+static int net_send (int *sockfd, const char *buff, int len)
 {
        uint16_t packet_size;
 
@@ -322,9 +322,6 @@ static int apc_query_server (char const *node, char const *service,
                printf ("net_recv = `%s';\n", recvline);
 #endif /* if APCMAIN */
 
-               if (strncmp ("END APC", recvline, strlen ("END APC")) == 0)
-                       break;
-
                toksaveptr = NULL;
                tokptr = strtok_r (recvline, " :\t", &toksaveptr);
                while (tokptr != NULL)
@@ -401,7 +398,7 @@ static int apcups_config (oconfig_item_t *ci)
        return (0);
 } /* int apcups_config */
 
-static void apc_submit_generic (char *type, char *type_inst, double value)
+static void apc_submit_generic (const char *type, const char *type_inst, double value)
 {
        value_t values[1];
        value_list_t vl = VALUE_LIST_INIT;