Merge branch 'collectd-3.10'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 21 Dec 2006 19:40:49 +0000 (20:40 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 21 Dec 2006 19:40:49 +0000 (20:40 +0100)
Conflicts:

ChangeLog

ChangeLog
configure.in
debian/changelog
src/collectd.c
src/network.c

index 27836d7..2615eaf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,11 @@ pending, Version 3.11.0
          plugin, including `extended naming', collection of voltage values
          and the possibility to ignore certain values.
 
+2006-12-21, Version 3.10.4
+       * Max Kellermann has identified a bug in the server routine: When
+         opening a socket fails the daemon will (re)try opening the socket in
+         an endless loop, ultimately leading to a `EMFILE' error.
+
 2006-11-04, Version 3.10.3
        * Lubos Stanek has identified a bug in the ntpd-plugin: When the
          ntpd's reply was sent in more than one packet, the buffer size was
index 69ac2cf..27c2978 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.10.3)
+AC_INIT(collectd, 3.10.4)
 AC_CONFIG_SRCDIR(src/collectd.c)
 AC_CONFIG_HEADERS(src/config.h)
 AM_INIT_AUTOMAKE(dist-bzip2)
index 3bd5e05..c187e48 100644 (file)
@@ -1,3 +1,9 @@
+collectd (3.10.4-0octo1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Florian Forster <octo@leeloo.home.verplant.org>  Thu, 21 Dec 2006 20:36:37 +0100
+
 collectd (3.10.3-0octo1) unstable; urgency=low
 
   * New upstream release.
index a1e15bf..a93cc28 100644 (file)
@@ -223,16 +223,27 @@ static int start_client (void)
 #if HAVE_LIBRRD
 static int start_server (void)
 {
-       /* FIXME use stack here! */
        char *host;
        char *type;
        char *instance;
        char *values;
 
-       while (loop == 0)
+       int  error_counter = 0;
+       int  status;
+
+       while ((loop == 0) && (error_counter < 3))
        {
-               if (network_receive (&host, &type, &instance, &values) == 0)
-                       plugin_write (host, type, instance, values);
+               status = network_receive (&host, &type, &instance, &values);
+
+               if (status != 0)
+               {
+                       if (status < 0)
+                               error_counter++;
+                       continue;
+               }
+               error_counter = 0;
+
+               plugin_write (host, type, instance, values);
 
                if (host     != NULL) free (host);     host     = NULL;
                if (type     != NULL) free (type);     type     = NULL;
index 22e911a..e9ba84b 100644 (file)
@@ -284,6 +284,7 @@ int network_create_socket (const char *node, const char *service)
                {
                        if (network_bind_socket (se, ai_ptr) != 0)
                        {
+                               close (se->fd);
                                free (se->addr);
                                free (se);
                                continue;
@@ -451,7 +452,7 @@ int network_receive (char **host, char **type, char **inst, char **value)
        {
                syslog (LOG_WARNING, "Invalid message from `%s'", *host);
                free (*host); *host = NULL;
-               return (-1);
+               return (1);
        }
 
        if ((*type = strdup (fields[0])) == NULL)