X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fteamspeak2.c;h=2552ad305ffcaa51decb9ab490764a1cc907e4fb;hb=ba2ee9aec4c0454eed8f29b4c6ce96c6fc372346;hp=7528406cc61a131e9fa276dcdacb1fe3345f23fc;hpb=0eff156c7816507fa1865b76e948574dd320fae0;p=collectd.git diff --git a/src/teamspeak2.c b/src/teamspeak2.c index 7528406c..2552ad30 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -25,8 +25,8 @@ #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)