[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 07/07: response: use macro instead of string for connect
From: |
gnunet |
Subject: |
[libmicrohttpd] 07/07: response: use macro instead of string for connection header |
Date: |
Wed, 28 Jul 2021 10:37:06 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 182ed3a0e02f5b339f6198c46d562fef30577a4a
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Jul 27 17:14:53 2021 +0300
response: use macro instead of string for connection header
---
src/microhttpd/response.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 6e6ed4d3..c7cfd086 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -208,9 +208,10 @@ static enum MHD_Result
add_response_header_connection (struct MHD_Response *response,
const char *value)
{
- static const char *key = "Connection";
+ static const char *key = MHD_HTTP_HEADER_CONNECTION;
/** the length of the "Connection" key */
- static const size_t key_len = MHD_STATICSTR_LEN_ ("Connection");
+ static const size_t key_len =
+ MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONNECTION);
size_t value_len; /**< the length of the @a value */
size_t old_value_len; /**< the length of the existing "Connection" value */
size_t buf_size; /**< the size of the buffer */
@@ -373,8 +374,10 @@ del_response_header_connection (struct MHD_Response
*response,
{
struct MHD_HTTP_Header *hdr; /**< existing "Connection" header */
- hdr = MHD_get_response_element_n_ (response, MHD_HEADER_KIND, "Connection",
- MHD_STATICSTR_LEN_ ("Connection"));
+ hdr = MHD_get_response_element_n_ (response, MHD_HEADER_KIND,
+ MHD_HTTP_HEADER_CONNECTION,
+ MHD_STATICSTR_LEN_ ( \
+ MHD_HTTP_HEADER_CONNECTION));
if (NULL == hdr)
return MHD_NO;
@@ -548,8 +551,9 @@ MHD_del_response_header (struct MHD_Response *response,
header_len = strlen (header);
if ((0 != (response->flags_auto & MHD_RAF_HAS_CONNECTION_HDR)) &&
- (MHD_STATICSTR_LEN_ ("Connection") == header_len) &&
- MHD_str_equal_caseless_bin_n_ (header, "Connection", header_len))
+ (MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONNECTION) == header_len) &&
+ MHD_str_equal_caseless_bin_n_ (header, MHD_HTTP_HEADER_CONNECTION,
+ header_len))
return del_response_header_connection (response, content);
content_len = strlen (content);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (237aebfa -> 182ed3a0), gnunet, 2021/07/28
- [libmicrohttpd] 02/07: try_ready_chunked_body: use new string function, fixes., gnunet, 2021/07/28
- [libmicrohttpd] 03/07: response: use auto flag for chunked encoding header, gnunet, 2021/07/28
- [libmicrohttpd] 07/07: response: use macro instead of string for connection header,
gnunet <=
- [libmicrohttpd] 05/07: Re-written chunk footer generation function as a separate function, gnunet, 2021/07/28
- [libmicrohttpd] 01/07: Added internal functions for printing decimal and hex numbers, gnunet, 2021/07/28
- [libmicrohttpd] 04/07: keepalive_possible(): check whether app requested close, gnunet, 2021/07/28
- [libmicrohttpd] 06/07: Added new public API function MHD_get_reason_phrase_len_for(), gnunet, 2021/07/28