projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/pr/488'
[collectd.git]
/
src
/
teamspeak2.c
diff --git
a/src/teamspeak2.c
b/src/teamspeak2.c
index
7528406
..
201e182
100644
(file)
--- a/
src/teamspeak2.c
+++ b/
src/teamspeak2.c
@@
-18,15
+18,15
@@
*
* Authors:
* Stefan Hacker <d0t at dbclan dot de>
*
* Authors:
* Stefan Hacker <d0t at dbclan dot de>
- * Florian Forster <octo at
verplant
.org>
+ * Florian Forster <octo at
collectd
.org>
**/
#include "collectd.h"
#include "common.h"
#include "plugin.h"
**/
#include "collectd.h"
#include "common.h"
#include "plugin.h"
-#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.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);
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)
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)
{
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.");
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)
{
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.");
read_fh = NULL;
write_fh = NULL;
ERROR ("teamspeak2 plugin: tss2_receive_line failed.");