X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnginx.c;h=16ce3d5f6ba33d5207b0cbf44f0e0673ea539925;hb=6fc6255c95b966014ee02a2a37666b2c4880ff8d;hp=69ec06dc996edc9452ea565776c9d9d70c241e68;hpb=b758f3b7146f1497d93e1df64cbc0c14ae164768;p=collectd.git diff --git a/src/nginx.c b/src/nginx.c index 69ec06dc..16ce3d5f 100644 --- a/src/nginx.c +++ b/src/nginx.c @@ -27,9 +27,9 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" -#include "configfile.h" #include @@ -71,7 +71,7 @@ static size_t nginx_curl_callback (void *buf, size_t size, size_t nmemb, len = (sizeof (nginx_buffer) - 1) - nginx_buffer_len; } - if (len <= 0) + if (len == 0) return (len); memcpy (&nginx_buffer[nginx_buffer_len], buf, len); @@ -195,7 +195,7 @@ static int init (void) return (0); } /* void init */ -static void submit (char *type, char *inst, long long value) +static void submit (const char *type, const char *inst, long long value) { value_t values[1]; value_list_t vl = VALUE_LIST_INIT; @@ -224,8 +224,6 @@ static void submit (char *type, char *inst, long long value) static int nginx_read (void) { - int i; - char *ptr; char *lines[16]; int lines_num = 0; @@ -263,7 +261,7 @@ static int nginx_read (void) * 16630948 16630948 31070465 * Reading: 6 Writing: 179 Waiting: 106 */ - for (i = 0; i < lines_num; i++) + for (int i = 0; i < lines_num; i++) { fields_num = strsplit (lines[i], fields, (sizeof (fields) / sizeof (fields[0])));