[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 14/14: doc/examples: Fixed drop of 'const' qualifiers
From: |
gnunet |
Subject: |
[libmicrohttpd] 14/14: doc/examples: Fixed drop of 'const' qualifiers |
Date: |
Tue, 19 Apr 2022 19:31:21 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 4b6419b1f3a9e89dbcafaf31eaf611455e6a207a
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Apr 19 20:21:52 2022 +0300
doc/examples: Fixed drop of 'const' qualifiers
---
doc/examples/basicauthentication.c | 8 ++------
doc/examples/hellobrowser.c | 4 +---
doc/examples/largepost.c | 5 +----
doc/examples/responseheaders.c | 4 +---
doc/examples/sessions.c | 14 +++++---------
doc/examples/simplepost.c | 4 +---
doc/examples/tlsauthentication.c | 4 +---
7 files changed, 12 insertions(+), 31 deletions(-)
diff --git a/doc/examples/basicauthentication.c
b/doc/examples/basicauthentication.c
index 3b105a1d..d75ba636 100644
--- a/doc/examples/basicauthentication.c
+++ b/doc/examples/basicauthentication.c
@@ -54,9 +54,7 @@ answer_to_connection (void *cls, struct MHD_Connection
*connection,
if (fail)
{
const char *page = "<html><body>Go away.</body></html>";
- response =
- MHD_create_response_from_buffer (strlen (page), (void *) page,
- MHD_RESPMEM_PERSISTENT);
+ response = MHD_create_response_from_buffer_static (strlen (page), page);
ret = MHD_queue_basic_auth_fail_response (connection,
"my realm",
response);
@@ -64,9 +62,7 @@ answer_to_connection (void *cls, struct MHD_Connection
*connection,
else
{
const char *page = "<html><body>A secret.</body></html>";
- response =
- MHD_create_response_from_buffer (strlen (page), (void *) page,
- MHD_RESPMEM_PERSISTENT);
+ response = MHD_create_response_from_buffer_static (strlen (page), page);
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
}
MHD_destroy_response (response);
diff --git a/doc/examples/hellobrowser.c b/doc/examples/hellobrowser.c
index b14ea6d8..0b7d9071 100644
--- a/doc/examples/hellobrowser.c
+++ b/doc/examples/hellobrowser.c
@@ -31,9 +31,7 @@ answer_to_connection (void *cls, struct MHD_Connection
*connection,
(void) upload_data_size; /* Unused. Silent compiler warning. */
(void) req_cls; /* Unused. Silent compiler warning. */
- response =
- MHD_create_response_from_buffer (strlen (page), (void *) page,
- MHD_RESPMEM_PERSISTENT);
+ response = MHD_create_response_from_buffer_static (strlen (page), page);
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
MHD_destroy_response (response);
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c
index ee9e85da..b7cccc04 100644
--- a/doc/examples/largepost.c
+++ b/doc/examples/largepost.c
@@ -98,10 +98,7 @@ send_page (struct MHD_Connection *connection,
enum MHD_Result ret;
struct MHD_Response *response;
- response =
- MHD_create_response_from_buffer (strlen (page),
- (void *) page,
- MHD_RESPMEM_MUST_COPY);
+ response = MHD_create_response_from_buffer_static (strlen (page), page);
if (! response)
return MHD_NO;
MHD_add_response_header (response,
diff --git a/doc/examples/responseheaders.c b/doc/examples/responseheaders.c
index 80eebbe9..162e5e2d 100644
--- a/doc/examples/responseheaders.c
+++ b/doc/examples/responseheaders.c
@@ -49,9 +49,7 @@ answer_to_connection (void *cls, struct MHD_Connection
*connection,
if (fd != -1)
(void) close (fd);
response =
- MHD_create_response_from_buffer (strlen (errorstr),
- (void *) errorstr,
- MHD_RESPMEM_PERSISTENT);
+ MHD_create_response_from_buffer_static (strlen (errorstr), errorstr);
if (NULL != response)
{
ret =
diff --git a/doc/examples/sessions.c b/doc/examples/sessions.c
index 5dd74e2c..0fe143eb 100644
--- a/doc/examples/sessions.c
+++ b/doc/examples/sessions.c
@@ -311,9 +311,7 @@ serve_simple_form (const void *cls,
struct MHD_Response *response;
/* return static form */
- response = MHD_create_response_from_buffer (strlen (form),
- (void *) form,
- MHD_RESPMEM_PERSISTENT);
+ response = MHD_create_response_from_buffer_static (strlen (form), form);
add_session_cookie (session, response);
MHD_add_response_header (response,
MHD_HTTP_HEADER_CONTENT_ENCODING,
@@ -431,9 +429,8 @@ not_found_page (const void *cls,
(void) session; /* Unused. Silent compiler warning. */
/* unsupported HTTP method */
- response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR),
- (void *) NOT_FOUND_ERROR,
- MHD_RESPMEM_PERSISTENT);
+ response = MHD_create_response_from_buffer_static (strlen (NOT_FOUND_ERROR),
+ NOT_FOUND_ERROR);
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_FOUND,
response);
@@ -651,9 +648,8 @@ create_response (void *cls,
return ret;
}
/* unsupported HTTP method */
- response = MHD_create_response_from_buffer (strlen (METHOD_ERROR),
- (void *) METHOD_ERROR,
- MHD_RESPMEM_PERSISTENT);
+ response = MHD_create_response_from_buffer_static (strlen (METHOD_ERROR),
+ METHOD_ERROR);
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_ACCEPTABLE,
response);
diff --git a/doc/examples/simplepost.c b/doc/examples/simplepost.c
index ea3899d1..51cf23c0 100644
--- a/doc/examples/simplepost.c
+++ b/doc/examples/simplepost.c
@@ -55,9 +55,7 @@ send_page (struct MHD_Connection *connection, const char
*page)
struct MHD_Response *response;
- response =
- MHD_create_response_from_buffer (strlen (page), (void *) page,
- MHD_RESPMEM_PERSISTENT);
+ response = MHD_create_response_from_buffer_static (strlen (page), page);
if (! response)
return MHD_NO;
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c
index 4db00b7f..1898e730 100644
--- a/doc/examples/tlsauthentication.c
+++ b/doc/examples/tlsauthentication.c
@@ -208,9 +208,7 @@ secret_page (struct MHD_Connection *connection)
struct MHD_Response *response;
const char *page = "<html><body>A secret.</body></html>";
- response =
- MHD_create_response_from_buffer (strlen (page), (void *) page,
- MHD_RESPMEM_PERSISTENT);
+ response = MHD_create_response_from_buffer_static (strlen (page), page);
if (! response)
return MHD_NO;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 03/14: Refactored create response functions., (continued)
- [libmicrohttpd] 03/14: Refactored create response functions., gnunet, 2022/04/19
- [libmicrohttpd] 02/14: Added _MHD_EXTERN to the all public functions definitions, gnunet, 2022/04/19
- [libmicrohttpd] 06/14: Added new API function MHD_create_response_from_buffer_static(), gnunet, 2022/04/19
- [libmicrohttpd] 07/14: Fixed drop of 'const' when building internal error response, gnunet, 2022/04/19
- [libmicrohttpd] 12/14: microhttpd.h: minor doxy improvement, gnunet, 2022/04/19
- [libmicrohttpd] 08/14: Fixed missing 'const' qualifiers, gnunet, 2022/04/19
- [libmicrohttpd] 05/14: MHD_get_version(): fixed signed value bit shift, gnunet, 2022/04/19
- [libmicrohttpd] 09/14: Added workaround for external APIs, gnunet, 2022/04/19
- [libmicrohttpd] 11/14: Added new API function MHD_create_response_from_buffer_copy(), gnunet, 2022/04/19
- [libmicrohttpd] 10/14: Minor simplification for ALPN protocols code, gnunet, 2022/04/19
- [libmicrohttpd] 14/14: doc/examples: Fixed drop of 'const' qualifiers,
gnunet <=
- [libmicrohttpd] 13/14: src/examples: Fixed drop of 'const' qualifiers and minor fixes., gnunet, 2022/04/19