X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fteamspeak2.c;h=201e1828a2b2037093fde4b02c45709a53d6d062;hb=6299d39b903cb87a3db5b6d2148a2d717754a30a;hp=7528406cc61a131e9fa276dcdacb1fe3345f23fc;hpb=565c731a4353d1453b65dc9a4267e1f8e4740c06;p=collectd.git diff --git a/src/teamspeak2.c b/src/teamspeak2.c index 7528406c..201e1828 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -18,15 +18,15 @@ * * Authors: * Stefan Hacker - * Florian Forster + * Florian Forster **/ #include "collectd.h" #include "common.h" #include "plugin.h" -#include #include +#include #include #include #include @@ -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.");