gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]