X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fcollectd.c;h=e13064771dcef9878bef79a3bf5bd289e4ded6ac;hb=2cea8075c666a6c6c7d6e1b4f95e1bee6f3803ac;hp=6ffb7c3993af05117d7929f5311e98d48349ee6f;hpb=7f96b393c49eb44ef737e305e8664ff924d7319d;p=collectd.git diff --git a/src/collectd.c b/src/collectd.c index 6ffb7c39..e1306477 100644 --- a/src/collectd.c +++ b/src/collectd.c @@ -222,7 +222,6 @@ static int start_client (void) #if HAVE_LIBRRD static int start_server (void) { - /* FIXME use stack here! */ /* FIXME */ #if 0 char *host; @@ -230,10 +229,22 @@ static int start_server (void) 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;