[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] branch master updated: check rvalues from MHD_add_respon
From: |
gnunet |
Subject: |
[libmicrohttpd] branch master updated: check rvalues from MHD_add_response_header in examples |
Date: |
Mon, 25 Sep 2023 21:32:09 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new 138ee33a check rvalues from MHD_add_response_header in examples
138ee33a is described below
commit 138ee33a41bd52897ba00f8483272694dd3f16b7
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Sep 25 21:31:59 2023 +0200
check rvalues from MHD_add_response_header in examples
---
src/examples/post_example.c | 44 ++++++++++++++++++++++++++++++++------------
1 file changed, 32 insertions(+), 12 deletions(-)
diff --git a/src/examples/post_example.c b/src/examples/post_example.c
index f49b49ff..5bd88773 100644
--- a/src/examples/post_example.c
+++ b/src/examples/post_example.c
@@ -292,9 +292,14 @@ serve_simple_form (const void *cls,
if (NULL == response)
return MHD_NO;
add_session_cookie (session, response);
- MHD_add_response_header (response,
- MHD_HTTP_HEADER_CONTENT_ENCODING,
- mime);
+ if (MHD_YES !=
+ MHD_add_response_header (response,
+ MHD_HTTP_HEADER_CONTENT_ENCODING,
+ mime))
+ {
+ fprintf (stderr,
+ "Failed to set content encoding header!\n");
+ }
ret = MHD_queue_response (connection,
MHD_HTTP_OK,
response);
@@ -342,9 +347,14 @@ fill_v1_form (const void *cls,
return MHD_NO;
}
add_session_cookie (session, response);
- MHD_add_response_header (response,
- MHD_HTTP_HEADER_CONTENT_ENCODING,
- mime);
+ if (MHD_YES !=
+ MHD_add_response_header (response,
+ MHD_HTTP_HEADER_CONTENT_ENCODING,
+ mime))
+ {
+ fprintf (stderr,
+ "Failed to set content encoding header!\n");
+ }
ret = MHD_queue_response (connection,
MHD_HTTP_OK,
response);
@@ -394,9 +404,14 @@ fill_v1_v2_form (const void *cls,
return MHD_NO;
}
add_session_cookie (session, response);
- MHD_add_response_header (response,
- MHD_HTTP_HEADER_CONTENT_ENCODING,
- mime);
+ if (MHD_YES !=
+ MHD_add_response_header (response,
+ MHD_HTTP_HEADER_CONTENT_ENCODING,
+ mime))
+ {
+ fprintf (stderr,
+ "Failed to set content encoding header!\n");
+ }
ret = MHD_queue_response (connection,
MHD_HTTP_OK,
response);
@@ -433,9 +448,14 @@ not_found_page (const void *cls,
ret = MHD_queue_response (connection,
MHD_HTTP_NOT_FOUND,
response);
- MHD_add_response_header (response,
- MHD_HTTP_HEADER_CONTENT_ENCODING,
- mime);
+ if (MHD_YES !=
+ MHD_add_response_header (response,
+ MHD_HTTP_HEADER_CONTENT_ENCODING,
+ mime))
+ {
+ fprintf (stderr,
+ "Failed to set content encoding header!\n");
+ }
MHD_destroy_response (response);
return ret;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.