[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 14/29: Added test with folded header placed last
From: |
gnunet |
Subject: |
[libmicrohttpd] 14/29: Added test with folded header placed last |
Date: |
Tue, 20 Jun 2023 22:24:27 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 04ad057ab93959a7d437709eb59dfa5ca950a293
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Nov 7 13:56:11 2022 +0300
Added test with folded header placed last
---
src/testcurl/Makefile.am | 3 +++
src/testcurl/test_put_header_fold.c | 24 +++++++++++++++++++-----
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index 930bedd3..c9a9473f 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -140,6 +140,7 @@ check_PROGRAMS = \
test_get_header_fold \
test_put_header_fold \
test_put_large_header_fold \
+ test_put_header_fold_last \
$(EMPTY_ITEM)
if ENABLE_COOKIE
@@ -639,3 +640,5 @@ test_put_header_fold_SOURCES = \
test_put_large_header_fold_SOURCES = $(test_put_header_fold_SOURCES)
test_get_header_fold_SOURCES = $(test_put_header_fold_SOURCES)
+
+test_put_header_fold_last_SOURCES = $(test_put_header_fold_SOURCES)
diff --git a/src/testcurl/test_put_header_fold.c
b/src/testcurl/test_put_header_fold.c
index f01b6762..c9a1d46d 100644
--- a/src/testcurl/test_put_header_fold.c
+++ b/src/testcurl/test_put_header_fold.c
@@ -233,13 +233,14 @@ _mhdErrorExit_func (const char *errDesc, const char
*funcName, int lineNum)
#define RP_HEADER2 RP_HEADER2_NAME ": " RP_HEADER2_VALUE
#define RP_HEADER2_CRLF RP_HEADER2 "\r\n"
+#define HDR_FOLD "\r\n "
#define RQ_HEADER1_NAME RP_HEADER1_NAME
#define RQ_HEADER1_VALUE RP_HEADER1_VALUE
#define RQ_HEADER1 RQ_HEADER1_NAME ": " RQ_HEADER1_VALUE
#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 "\r\n \r\n " RQ_HEADER2_VALUE_E
+#define RQ_HEADER2_VALUE RQ_HEADER2_VALUE_S HDR_FOLD HDR_FOLD
RQ_HEADER2_VALUE_E
#define RQ_HEADER2 RQ_HEADER2_NAME ": " RQ_HEADER2_VALUE
#define RQ_HEADER3_NAME RP_HEADER2_NAME
#define RQ_HEADER3_VALUE RP_HEADER2_VALUE
@@ -266,6 +267,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_hdr_last; /**< If non-zero, folded header is placed last */
/* Static data */
static struct curl_slist *libcurl_headers = NULL;
@@ -285,13 +287,23 @@ libcurl_headers_init (void)
if (NULL == libcurl_headers)
libcurlErrorExitDesc ("curl_slist_append() failed");
+ if (use_hdr_last)
+ {
+ libcurl_headers = curl_slist_append (libcurl_headers, RQ_HEADER3);
+ if (NULL == libcurl_headers)
+ libcurlErrorExitDesc ("curl_slist_append() failed");
+ }
+
libcurl_headers = curl_slist_append (libcurl_headers, RQ_HEADER2);
if (NULL == libcurl_headers)
libcurlErrorExitDesc ("curl_slist_append() failed");
- libcurl_headers = curl_slist_append (libcurl_headers, RQ_HEADER3);
- if (NULL == libcurl_headers)
- libcurlErrorExitDesc ("curl_slist_append() failed");
+ if (! use_hdr_last)
+ {
+ libcurl_headers = curl_slist_append (libcurl_headers, RQ_HEADER3);
+ if (NULL == libcurl_headers)
+ libcurlErrorExitDesc ("curl_slist_append() failed");
+ }
}
@@ -1064,7 +1076,8 @@ performCheck (void)
port += UINT16_C (2);
if (use_put_large)
port += UINT16_C (4);
- port = (uint16_t) 4220;
+ if (use_hdr_last)
+ port += UINT16_C (8);
}
if (1)
@@ -1212,6 +1225,7 @@ main (int argc, char *const *argv)
use_put = has_in_name (argv[0], "_put");
use_put_large = has_in_name (argv[0], "_put_large");
+ use_hdr_last = has_in_name (argv[0], "_last");
if (1 !=
((use_get ? 1 : 0) + (use_put ? 1 : 0)))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 09/29: daemon: added debug member to avoid accept4() usage, (continued)
- [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, 2023/06/20
- [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 <=
- [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
- [libmicrohttpd] 17/29: connection.c: corrected error responses, gnunet, 2023/06/20
- [libmicrohttpd] 24/29: process new connection: fixed missing mutex unlock in error handling path, gnunet, 2023/06/20
- [libmicrohttpd] 23/29: Adjusted buffer increase default step size, gnunet, 2023/06/20
- [libmicrohttpd] 28/29: try_grow_read_buffer(): better handling of edge cases, gnunet, 2023/06/20
- [libmicrohttpd] 26/29: W32 VS Projects: fixed code parsing, gnunet, 2023/06/20