commit 2618c8c42fc43a0772fe9bd68bccc2d5fcd8693a
parent 2ed00da9babc5608e8ed44e07f8d2067b4a4d8f5
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 22 Jan 2017 23:11:01 +0300
test_large_put: added test with incremental read and limited buffer
Diffstat:
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
@@ -32,6 +32,7 @@ check_PROGRAMS = \
test_get_sendfile11 \
test_put11 \
test_large_put11 \
+ test_large_put_inc11 \
test_long_header \
test_long_header11 \
test_get_chunked \
@@ -284,6 +285,12 @@ test_large_put11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
@LIBCURL@
+test_large_put_inc11_SOURCES = \
+ test_large_put.c
+test_large_put_inc11_LDADD = \
+ $(top_builddir)/src/microhttpd/libmicrohttpd.la \
+ @LIBCURL@
+
test_long_header_SOURCES = \
test_long_header.c
test_long_header_LDADD = \
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
@@ -189,7 +189,7 @@ testPutInternalThread ()
d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
1080,
NULL, NULL, &ahc_echo, &done_flag,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (1024*1024),
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read ? 1024 : (PUT_SIZE * 4)),
MHD_OPTION_END);
if (d == NULL)
return 1;
@@ -247,7 +247,7 @@ testPutThreadPerConn ()
d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
1081,
NULL, NULL, &ahc_echo, &done_flag,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (1024*1024),
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read ? 1024 : (PUT_SIZE * 4)),
MHD_OPTION_END);
if (d == NULL)
return 16;
@@ -309,7 +309,7 @@ testPutThreadPool ()
1081,
NULL, NULL, &ahc_echo, &done_flag,
MHD_OPTION_THREAD_POOL_SIZE, CPU_COUNT,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (1024*1024),
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read ? 1024 : (PUT_SIZE * 4)),
MHD_OPTION_END);
if (d == NULL)
return 16;
@@ -385,8 +385,8 @@ testPutExternal ()
d = MHD_start_daemon (MHD_USE_ERROR_LOG,
1082,
NULL, NULL, &ahc_echo, &done_flag,
- MHD_OPTION_CONNECTION_MEMORY_LIMIT,
- (size_t) (PUT_SIZE * 4), MHD_OPTION_END);
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t)(incr_read ? 1024 : (PUT_SIZE * 4)),
+ MHD_OPTION_END);
if (d == NULL)
return 256;
c = curl_easy_init ();