diff --git a/src/memcached.c b/src/memcached.c
index 535ea84704b3dac328a5af495f69bccdbdfedb9a..f684abffe9314515771d75cef1d1cd81143838ee 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
#include "configfile.h"
#include <netdb.h>
#include "configfile.h"
#include <netdb.h>
-#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
sfree (st->socket);
sfree (st->host);
sfree (st->port);
sfree (st->socket);
sfree (st->host);
sfree (st->port);
+ sfree (st);
}
static int memcached_connect_unix (memcached_t *st)
}
static int memcached_connect_unix (memcached_t *st)
return (-1);
}
return (-1);
}
+ /* connect to the memcached daemon */
+ int status = connect (fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
+ if (status != 0)
+ {
+ shutdown (fd, SHUT_RDWR);
+ close (fd);
+ fd = -1;
+ }
+
return (fd);
} /* int memcached_connect_unix */
return (fd);
} /* int memcached_connect_unix */
/*
* For an explanation on these fields please refer to
/*
* For an explanation on these fields please refer to
- * <http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt>
+ * <https://github.com/memcached/memcached/blob/master/doc/protocol.txt>
*/
/*
*/
/*
{
submit_gauge ("memcached_connections", "current", atof (fields[2]), st);
}
{
submit_gauge ("memcached_connections", "current", atof (fields[2]), st);
}
+ else if (FIELD_IS ("listen_disabled_num"))
+ {
+ submit_derive ("memcached_connections", "listen_disabled", atof (fields[2]), st);
+ }
/*
* Commands
/*
* Commands
status = plugin_register_complex_read (/* group = */ "memcached",
/* name = */ callback_name,
/* callback = */ memcached_read,
status = plugin_register_complex_read (/* group = */ "memcached",
/* name = */ callback_name,
/* callback = */ memcached_read,
- /* interval = */ NULL,
+ /* interval = */ 0,
/* user_data = */ &ud);
return (status);
} /* int memcached_add_read_callback */
/* user_data = */ &ud);
return (status);
} /* int memcached_add_read_callback */