[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 78/156: Added tests with single and double folded header
From: |
gnunet |
Subject: |
[libmicrohttpd] 78/156: Added tests with single and double folded header |
Date: |
Sun, 28 May 2023 17:52:11 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to tag v0.9.77
in repository libmicrohttpd.
commit 28e28ff4c1d801c4113e1c5eee1ba142f65ef18a
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Nov 7 16:13:15 2022 +0300
Added tests with single and double folded header
---
src/testcurl/Makefile.am | 15 +++++++++++++++
src/testcurl/test_put_header_fold.c | 18 ++++++++++++++++--
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index 1f6560e9..c7d6ffde 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -140,6 +140,11 @@ check_PROGRAMS = \
test_put_large_header_fold \
test_put_header_fold_last \
test_put_header_fold_large \
+ test_get_header_double_fold \
+ test_put_header_double_fold \
+ test_put_large_header_double_fold \
+ test_put_header_double_fold_last \
+ test_put_header_double_fold_large \
$(EMPTY_ITEM)
if HEAVY_TESTS
@@ -479,3 +484,13 @@ test_get_header_fold_SOURCES =
$(test_put_header_fold_SOURCES)
test_put_header_fold_last_SOURCES = $(test_put_header_fold_SOURCES)
test_put_header_fold_large_SOURCES = $(test_put_header_fold_SOURCES)
+
+test_put_header_double_fold_SOURCES = $(test_put_header_fold_SOURCES)
+
+test_put_large_header_double_fold_SOURCES =
$(test_put_large_header_fold_SOURCES)
+
+test_get_header_double_fold_SOURCES = $(test_put_header_fold_SOURCES)
+
+test_put_header_double_fold_last_SOURCES = $(test_put_header_fold_last_SOURCES)
+
+test_put_header_double_fold_large_SOURCES =
$(test_put_header_fold_large_SOURCES)
diff --git a/src/testcurl/test_put_header_fold.c
b/src/testcurl/test_put_header_fold.c
index 2ef916de..3a61327e 100644
--- a/src/testcurl/test_put_header_fold.c
+++ b/src/testcurl/test_put_header_fold.c
@@ -239,8 +239,12 @@ _mhdErrorExit_func (const char *errDesc, const char
*funcName, int lineNum)
#define RQ_HEADER2_NAME "Folded"
#define RQ_HEADER2_VALUE_S "start"
#define RQ_HEADER2_VALUE_E "end"
-#define RQ_HEADER2_VALUE RQ_HEADER2_VALUE_S HDR_FOLD HDR_FOLD
RQ_HEADER2_VALUE_E
+#define RQ_HEADER2_VALUE \
+ RQ_HEADER2_VALUE_S HDR_FOLD RQ_HEADER2_VALUE_E
+#define RQ_HEADER2_VALUE_DF \
+ RQ_HEADER2_VALUE_S HDR_FOLD HDR_FOLD RQ_HEADER2_VALUE_E
#define RQ_HEADER2 RQ_HEADER2_NAME ": " RQ_HEADER2_VALUE
+#define RQ_HEADER2_DF RQ_HEADER2_NAME ": " RQ_HEADER2_VALUE_DF
#define RQ_HEADER3_NAME RP_HEADER2_NAME
#define RQ_HEADER3_VALUE RP_HEADER2_VALUE
#define RQ_HEADER3 RQ_HEADER3_NAME ": " RQ_HEADER3_VALUE
@@ -266,6 +270,7 @@ static int oneone; /**< If false use
HTTP/1.0 for requests*/
static int use_get;
static int use_put;
static int use_put_large;
+static int use_double_fold;
static int use_hdr_last; /**< If non-zero, folded header is placed last */
static int use_hdr_large; /**< If non-zero, folded header is large */
@@ -296,7 +301,10 @@ libcurl_headers_init (void)
if (! use_hdr_large)
{
- libcurl_headers = curl_slist_append (libcurl_headers, RQ_HEADER2);
+ if (! use_double_fold)
+ libcurl_headers = curl_slist_append (libcurl_headers, RQ_HEADER2);
+ else
+ libcurl_headers = curl_slist_append (libcurl_headers, RQ_HEADER2_DF);
if (NULL == libcurl_headers)
libcurlErrorExitDesc ("curl_slist_append() failed");
}
@@ -317,6 +325,11 @@ libcurl_headers_init (void)
pos += MHD_STATICSTR_LEN_ (RQ_HEADER2_VALUE_S);
memcpy (buf + pos, HDR_FOLD, MHD_STATICSTR_LEN_ (HDR_FOLD));
pos += MHD_STATICSTR_LEN_ (HDR_FOLD);
+ if (use_double_fold)
+ {
+ memcpy (buf + pos, HDR_FOLD, MHD_STATICSTR_LEN_ (HDR_FOLD));
+ pos += MHD_STATICSTR_LEN_ (HDR_FOLD);
+ }
memset (buf + pos, 'a',
TEST_UPLOAD_DATA_SIZE - pos
- MHD_STATICSTR_LEN_ (RQ_HEADER2_VALUE_E) - 1);
@@ -1266,6 +1279,7 @@ main (int argc, char *const *argv)
use_get = has_in_name (argv[0], "_get");
use_put = has_in_name (argv[0], "_put");
+ use_double_fold = has_in_name (argv[0], "_double_fold");
use_put_large = has_in_name (argv[0], "_put_large");
use_hdr_last = has_in_name (argv[0], "_last");
use_hdr_large = has_in_name (argv[0], "_fold_large");
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 121/156: tests: unified use of function name macros, (continued)
- [libmicrohttpd] 121/156: tests: unified use of function name macros, gnunet, 2023/05/28
- [libmicrohttpd] 127/156: Updated test keys to use SHA-256 hash instead of SHA-1, gnunet, 2023/05/28
- [libmicrohttpd] 135/156: W32 VS projects: target Win8 or later on ARM and ARM64 arches, gnunet, 2023/05/28
- [libmicrohttpd] 136/156: W32 VS projects: added ARM and ARM64 configurations, gnunet, 2023/05/28
- [libmicrohttpd] 102/156: configure: removed 'gettext' from the final report, gnunet, 2023/05/28
- [libmicrohttpd] 109/156: test_client_put_stop: avoid stress-testing the OS, gnunet, 2023/05/28
- [libmicrohttpd] 115/156: test_post: fixed caseless key name match, gnunet, 2023/05/28
- [libmicrohttpd] 120/156: Simplified usage of the function name magic macros, gnunet, 2023/05/28
- [libmicrohttpd] 131/156: ChangeLog: updated, gnunet, 2023/05/28
- [libmicrohttpd] 138/156: Fixed compiler warning on x32, gnunet, 2023/05/28
- [libmicrohttpd] 78/156: Added tests with single and double folded header,
gnunet <=
- [libmicrohttpd] 110/156: digest auth: fixed parallel access to the hash table, gnunet, 2023/05/28
- [libmicrohttpd] 114/156: examples/largepost.c: fixed code style, gnunet, 2023/05/28
- [libmicrohttpd] 125/156: .gitignore: force include all *.{c,h} files, gnunet, 2023/05/28
- [libmicrohttpd] 113/156: examples/largepost.c: fixed caseless method match, gnunet, 2023/05/28
- [libmicrohttpd] 129/156: Detect sysctl() symbols in configure, gnunet, 2023/05/28
- [libmicrohttpd] 98/156: .gitignore: added universal patter to ignore test binaries, gnunet, 2023/05/28
- [libmicrohttpd] 140/156: Added support for custom command for tarball compression, gnunet, 2023/05/28
- [libmicrohttpd] 143/156: Fixed compiler warning when built without poll() support, gnunet, 2023/05/28
- [libmicrohttpd] 141/156: contrib/make-dist.sh: added use of zopfli if available, gnunet, 2023/05/28
- [libmicrohttpd] 142/156: daemon.c: redesigned code for clarity and formatting, gnunet, 2023/05/28