[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 06/10: test_long_header: use power of two f
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 06/10: test_long_header: use power of two for size to properly test allocations, test various buffer sizes |
Date: |
Mon, 17 Jun 2019 20:35:49 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 4bc166ee2fc716f68e120fce514bd69a26146f28
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Mon Jun 17 14:49:18 2019 +0300
test_long_header: use power of two for size to properly test allocations,
test various buffer sizes
---
src/testcurl/test_long_header.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/testcurl/test_long_header.c b/src/testcurl/test_long_header.c
index 80842622..dc76a136 100644
--- a/src/testcurl/test_long_header.c
+++ b/src/testcurl/test_long_header.c
@@ -42,7 +42,7 @@
* half of this value, so the actual value does not have
* to be big at all...
*/
-#define VERY_LONG (1024*10)
+#define VERY_LONG (1024*8)
static int oneone;
@@ -94,7 +94,7 @@ ahc_echo (void *cls,
static int
-testLongUrlGet ()
+testLongUrlGet (size_t buff_size)
{
struct MHD_Daemon *d;
CURL *c;
@@ -108,7 +108,7 @@ testLongUrlGet ()
port = 0;
else
{
- port = 1330;
+ port = 1330 + buff_size % 20;
if (oneone)
port += 5;
}
@@ -122,7 +122,7 @@ testLongUrlGet ()
&ahc_echo,
"GET",
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
- (size_t) (VERY_LONG / 2), MHD_OPTION_END);
+ (size_t) buff_size, MHD_OPTION_END);
if (d == NULL)
return 1;
if (0 == port)
@@ -182,7 +182,7 @@ testLongUrlGet ()
static int
-testLongHeaderGet ()
+testLongHeaderGet (size_t buff_size)
{
struct MHD_Daemon *d;
CURL *c;
@@ -197,7 +197,7 @@ testLongHeaderGet ()
port = 0;
else
{
- port = 1331;
+ port = 1331 + buff_size % 20;
if (oneone)
port += 5;
}
@@ -212,7 +212,7 @@ testLongHeaderGet ()
&ahc_echo,
"GET",
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
- (size_t) (VERY_LONG / 2), MHD_OPTION_END);
+ (size_t) buff_size, MHD_OPTION_END);
if (d == NULL)
return 16;
if (0 == port)
@@ -288,8 +288,10 @@ main (int argc, char *const *argv)
oneone = has_in_name (argv[0], "11");
if (0 != curl_global_init (CURL_GLOBAL_WIN32))
return 2;
- errorCount += testLongUrlGet ();
- errorCount += testLongHeaderGet ();
+ errorCount += testLongUrlGet (VERY_LONG / 2);
+ errorCount += testLongUrlGet (VERY_LONG / 2 + 978);
+ errorCount += testLongHeaderGet (VERY_LONG / 2);
+ errorCount += testLongHeaderGet (VERY_LONG / 2 + 1893);
if (errorCount != 0)
fprintf (stderr, "Error (code: %u)\n", errorCount);
curl_global_cleanup ();
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] branch master updated (d12ed49f -> 55dc42e6), gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 04/10: memorypool: comments minor improvements, gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 05/10: MHD_pool_reallocate(): never allocate additional buffer when shrinking, gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 07/10: transmit_error_response(): discard read buffer to free space for error response, gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 09/10: try_ready_chunked_body(): remove useless loop, use know free memory size instead of guessing, gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 01/10: memorypool: fixed MHD_pool_reset(), gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 03/10: memorypool: re-commit memory on W32 when resetting pool, gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 06/10: test_long_header: use power of two for size to properly test allocations, test various buffer sizes,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 02/10: memorypool: round mmap allocation for page size, gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 10/10: Optimised read buffer allocation, gnunet, 2019/06/17
- [GNUnet-SVN] [libmicrohttpd] 08/10: process_request_body(): do not move data if nothing was processed, gnunet, 2019/06/17