[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/04: Added more chunked response tests
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/04: Added more chunked response tests |
Date: |
Sun, 15 Aug 2021 17:29:10 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 4595a443ed295d5d987908576acd145d18d360c6
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Aug 15 18:23:33 2021 +0300
Added more chunked response tests
---
src/testcurl/.gitignore | 2 ++
src/testcurl/Makefile.am | 14 ++++++++++++++
src/testcurl/test_get_chunked.c | 16 +++++++++++++---
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/src/testcurl/.gitignore b/src/testcurl/.gitignore
index 23c83b66..cf4ba3bd 100644
--- a/src/testcurl/.gitignore
+++ b/src/testcurl/.gitignore
@@ -37,6 +37,8 @@
/test_get_chunked_close_sized
/test_get_chunked_empty_sized
/test_get_chunked_close_empty_sized
+/test_get_chunked_forced
+/test_get_chunked_empty_forced
/test_get11
/test_get
/test_digestauth_with_arguments
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index 873017c2..cc13962c 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -110,6 +110,8 @@ check_PROGRAMS = \
test_get_chunked_close_sized \
test_get_chunked_empty_sized \
test_get_chunked_close_empty_sized \
+ test_get_chunked_forced \
+ test_get_chunked_empty_forced \
test_put_chunked \
test_callback \
$(EMPTY_ITEM)
@@ -346,6 +348,18 @@ test_get_chunked_close_empty_sized_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
@LIBCURL@
+test_get_chunked_forced_SOURCES = \
+ test_get_chunked.c
+test_get_chunked_forced_LDADD = \
+ $(top_builddir)/src/microhttpd/libmicrohttpd.la \
+ @LIBCURL@
+
+test_get_chunked_empty_forced_SOURCES = \
+ test_get_chunked.c
+test_get_chunked_empty_forced_LDADD = \
+ $(top_builddir)/src/microhttpd/libmicrohttpd.la \
+ @LIBCURL@
+
test_post_SOURCES = \
test_post.c mhd_has_in_name.h
test_post_LDADD = \
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index cb46b6dc..dbe7b7f8 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -76,6 +76,11 @@ int resp_sized;
*/
int resp_empty;
+/**
+ * Force chunked response by response header?
+ */
+int chunked_forced;
+
struct headers_check_result
{
@@ -225,14 +230,14 @@ ahc_echo (void *cls,
}
if (NULL == response)
abort ();
- if (conn_close || resp_sized)
- { /* Enforce chunked response even for non-Keep-Alive and static responses */
+ if (chunked_forced)
+ {
if (MHD_NO == MHD_add_response_header (response,
MHD_HTTP_HEADER_TRANSFER_ENCODING,
"chunked"))
abort ();
}
- if (resp_string)
+ if (resp_string || (resp_sized && resp_empty))
{
/* There is no chance to add footer later */
if (MHD_YES != MHD_add_response_footer (response,
@@ -737,8 +742,13 @@ main (int argc, char *const *argv)
resp_string = has_in_name (argv[0], "_string");
resp_sized = has_in_name (argv[0], "_sized");
resp_empty = has_in_name (argv[0], "_empty");
+ chunked_forced = has_in_name (argv[0], "_forced");
if (resp_string)
resp_sized = ! 0;
+ if (resp_sized)
+ chunked_forced = ! 0;
+ if (conn_close) /* TODO: remove when supported by MHD */
+ chunked_forced = ! 0;
if (MHD_YES == MHD_is_feature_supported (MHD_FEATURE_THREADS))
{
errorCount += testInternalGet ();
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.