Code

src/apache.c: Increase the buffer size from 4kByte to 16kByte, since this was a probl...
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 26 Sep 2006 18:05:21 +0000 (20:05 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 26 Sep 2006 18:05:21 +0000 (20:05 +0200)
Also, make this limit easier to configure.

src/apache.c

index 156ad5dc905d757d2fd2fd05f97c1b5a8e748633..530481be3f802b88bb4582a14dd9aef84612eef5 100644 (file)
@@ -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)