X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fteamspeak2.c;h=201e1828a2b2037093fde4b02c45709a53d6d062;hb=979b0fa58b2de639ff79209eff12ec17ff593483;hp=a78e700f03a67962132bb9be8dd372dcb68144d5;hpb=7947c0d3d8e4cae18dc55108465eb6fa3b88b5f0;p=collectd.git diff --git a/src/teamspeak2.c b/src/teamspeak2.c index a78e700f..201e1828 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -18,7 +18,7 @@ * * Authors: * Stefan Hacker - * Florian Forster + * Florian Forster **/ #include "collectd.h" @@ -299,6 +299,13 @@ static int tss2_get_socket (FILE **ret_read_fh, FILE **ret_write_fh) char *buffer_ptr; buffer_ptr = fgets (buffer, sizeof (buffer), global_read_fh); + if (buffer_ptr == NULL) + { + WARNING ("teamspeak2 plugin: Unexpected EOF received " + "from remote host %s:%s.", + config_host ? config_host : DEFAULT_HOST, + config_port ? config_port : DEFAULT_PORT); + } buffer[sizeof (buffer) - 1] = 0; if (memcmp ("[TS]\r\n", buffer, 6) != 0) @@ -432,7 +439,7 @@ static int tss2_vserver_gapl (FILE *read_fh, FILE *write_fh, status = tss2_receive_line (read_fh, buffer, sizeof (buffer)); if (status != 0) { - /* Set to NULL just to make sure noone uses these FHs anymore. */ + /* Set to NULL just to make sure no one uses these FHs anymore. */ read_fh = NULL; write_fh = NULL; ERROR ("teamspeak2 plugin: tss2_receive_line failed."); @@ -557,7 +564,7 @@ static int tss2_read_vserver (vserver_list_t *vserver) status = tss2_receive_line (read_fh, buffer, sizeof (buffer)); if (status != 0) { - /* Set to NULL just to make sure noone uses these FHs anymore. */ + /* Set to NULL just to make sure no one uses these FHs anymore. */ read_fh = NULL; write_fh = NULL; ERROR ("teamspeak2 plugin: tss2_receive_line failed.");