projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
curl_json plugin: fix indentation
[collectd.git]
/
src
/
write_http.c
diff --git
a/src/write_http.c
b/src/write_http.c
index
2733781
..
779c94f
100644
(file)
--- a/
src/write_http.c
+++ b/
src/write_http.c
@@
-29,10
+29,6
@@
#include "utils_cache.h"
#include "utils_format_json.h"
#include "utils_cache.h"
#include "utils_format_json.h"
-#if HAVE_PTHREAD_H
-# include <pthread.h>
-#endif
-
#include <curl/curl.h>
#ifndef WRITE_HTTP_DEFAULT_BUFFER_SIZE
#include <curl/curl.h>
#ifndef WRITE_HTTP_DEFAULT_BUFFER_SIZE
@@
-182,7
+178,7
@@
static int wh_callback_init (wh_callback_t *cb) /* {{{ */
if (cb->pass != NULL)
credentials_size += strlen (cb->pass);
if (cb->pass != NULL)
credentials_size += strlen (cb->pass);
- cb->credentials =
(char *)
malloc (credentials_size);
+ cb->credentials = malloc (credentials_size);
if (cb->credentials == NULL)
{
ERROR ("curl plugin: malloc failed.");
if (cb->credentials == NULL)
{
ERROR ("curl plugin: malloc failed.");
@@
-240,7
+236,7
@@
static int wh_flush_nolock (cdtime_t timeout, wh_callback_t *cb) /* {{{ */
if (cb->format == WH_FORMAT_COMMAND)
{
if (cb->format == WH_FORMAT_COMMAND)
{
- if (cb->send_buffer_fill
<
= 0)
+ if (cb->send_buffer_fill
=
= 0)
{
cb->send_buffer_init_time = cdtime ();
return (0);
{
cb->send_buffer_init_time = cdtime ();
return (0);
@@
-567,13
+563,12
@@
static int wh_config_node (oconfig_item_t *ci) /* {{{ */
int status = 0;
int i;
int status = 0;
int i;
- cb =
malloc (
sizeof (*cb));
+ cb =
calloc (1,
sizeof (*cb));
if (cb == NULL)
{
if (cb == NULL)
{
- ERROR ("write_http plugin:
m
alloc failed.");
+ ERROR ("write_http plugin:
c
alloc failed.");
return (-1);
}
return (-1);
}
- memset (cb, 0, sizeof (*cb));
cb->verify_peer = 1;
cb->verify_host = 1;
cb->format = WH_FORMAT_COMMAND;
cb->verify_peer = 1;
cb->verify_host = 1;
cb->format = WH_FORMAT_COMMAND;