[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 16/29: Added tests with single and double folded header
From: |
gnunet |
Subject: |
[libmicrohttpd] 16/29: Added tests with single and double folded header |
Date: |
Tue, 20 Jun 2023 22:24:29 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit edde133d39a3475f0adc60493f3a5ae4c1d4a976
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 b95c798d..f4ca1974 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -142,6 +142,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 ENABLE_COOKIE
@@ -645,3 +650,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 61a781af..dbfe3f25 100644
--- a/src/testcurl/test_put_header_fold.c
+++ b/src/testcurl/test_put_header_fold.c
@@ -240,8 +240,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
@@ -267,6 +271,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 */
@@ -297,7 +302,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");
}
@@ -318,6 +326,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] 03/29: microhttpd.h: fixed typos in comments, (continued)
- [libmicrohttpd] 03/29: microhttpd.h: fixed typos in comments, gnunet, 2023/06/20
- [libmicrohttpd] 04/29: Renamed connection state for clarity, gnunet, 2023/06/20
- [libmicrohttpd] 02/29: Re-implemented parsing of the request line from scratch., gnunet, 2023/06/20
- [libmicrohttpd] 08/29: tests: minor improvemnts, gnunet, 2023/06/20
- [libmicrohttpd] 07/29: Removed request line and headers processing old functions and variables, gnunet, 2023/06/20
- [libmicrohttpd] 09/29: daemon: added debug member to avoid accept4() usage, gnunet, 2023/06/20
- [libmicrohttpd] 01/29: Refactoring: check whether memory block is resizable, gnunet, 2023/06/20
- [libmicrohttpd] 06/29: Re-implemented parsing of the request headers and footers from scratch., gnunet, 2023/06/20
- [libmicrohttpd] 12/29: Added back testing with socat as a fallback option, gnunet, 2023/06/20
- [libmicrohttpd] 05/29: Request body processing: removed impossible code paths, gnunet, 2023/06/20
- [libmicrohttpd] 16/29: Added tests with single and double folded header,
gnunet <=
- [libmicrohttpd] 21/29: process_request_body(): minor readability improvementы, gnunet, 2023/06/20
- [libmicrohttpd] 11/29: testzzuf: re-worked zzuf testing, gnunet, 2023/06/20
- [libmicrohttpd] 10/29: testzzuf: added special debug functions, gnunet, 2023/06/20
- [libmicrohttpd] 22/29: Minor refactoring for partially processed request body, gnunet, 2023/06/20
- [libmicrohttpd] 14/29: Added test with folded header placed last, gnunet, 2023/06/20
- [libmicrohttpd] 15/29: Added test with large folded header, gnunet, 2023/06/20
- [libmicrohttpd] 20/29: Added checks for correct values specified for connection memory limits, gnunet, 2023/06/20
- [libmicrohttpd] 19/29: connection: fixed pipelined requests processing, gnunet, 2023/06/20
- [libmicrohttpd] 13/29: Added new tests with header fold, gnunet, 2023/06/20
- [libmicrohttpd] 18/29: Added proper connection's buffers pre-initialisaion, gnunet, 2023/06/20