projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
nginx.c
diff --git
a/src/nginx.c
b/src/nginx.c
index
69ec06d
..
e346cee
100644
(file)
--- a/
src/nginx.c
+++ b/
src/nginx.c
@@
-27,6
+27,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
#include "common.h"
#include "plugin.h"
#include "configfile.h"
@@
-71,7
+72,7
@@
static size_t nginx_curl_callback (void *buf, size_t size, size_t nmemb,
len = (sizeof (nginx_buffer) - 1) - nginx_buffer_len;
}
len = (sizeof (nginx_buffer) - 1) - nginx_buffer_len;
}
- if (len
<
= 0)
+ if (len
=
= 0)
return (len);
memcpy (&nginx_buffer[nginx_buffer_len], buf, len);
return (len);
memcpy (&nginx_buffer[nginx_buffer_len], buf, len);
@@
-195,7
+196,7
@@
static int init (void)
return (0);
} /* void init */
return (0);
} /* void init */
-static void submit (c
har *type,
char *inst, long long value)
+static void submit (c
onst char *type, const
char *inst, long long value)
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
@@
-224,8
+225,6
@@
static void submit (char *type, char *inst, long long value)
static int nginx_read (void)
{
static int nginx_read (void)
{
- int i;
-
char *ptr;
char *lines[16];
int lines_num = 0;
char *ptr;
char *lines[16];
int lines_num = 0;
@@
-263,7
+262,7
@@
static int nginx_read (void)
* 16630948 16630948 31070465
* Reading: 6 Writing: 179 Waiting: 106
*/
* 16630948 16630948 31070465
* Reading: 6 Writing: 179 Waiting: 106
*/
- for (i = 0; i < lines_num; i++)
+ for (i
nt i
= 0; i < lines_num; i++)
{
fields_num = strsplit (lines[i], fields,
(sizeof (fields) / sizeof (fields[0])));
{
fields_num = strsplit (lines[i], fields,
(sizeof (fields) / sizeof (fields[0])));