From: Florian Forster Date: Tue, 26 Sep 2006 18:05:21 +0000 (+0200) Subject: src/apache.c: Increase the buffer size from 4kByte to 16kByte, since this was a probl... X-Git-Tag: collectd-3.11.0~71 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e4e51c6605b934c3f5e85f38436ce3e84038595e;p=collectd.git src/apache.c: Increase the buffer size from 4kByte to 16kByte, since this was a problem twice. Also, make this limit easier to configure. --- diff --git a/src/apache.c b/src/apache.c index 156ad5dc..530481be 100644 --- a/src/apache.c +++ b/src/apache.c @@ -42,7 +42,8 @@ static char *cacert = NULL; #if HAVE_LIBCURL static CURL *curl = NULL; -static char apache_buffer[4096]; +#define ABUFFER_SIZE 16384 +static char apache_buffer[ABUFFER_SIZE]; static int apache_buffer_len = 0; static char apache_curl_error[CURL_ERROR_SIZE]; #endif /* HAVE_LIBCURL */ @@ -89,9 +90,9 @@ static size_t apache_curl_callback (void *buf, size_t size, size_t nmemb, void * { size_t len = size * nmemb; - if ((apache_buffer_len + len) >= 4096) + if ((apache_buffer_len + len) >= ABUFFER_SIZE) { - len = 4095 - apache_buffer_len; + len = (ABUFFER_SIZE - 1) - apache_buffer_len; } if (len <= 0)