diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-25 21:38:23 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-25 21:38:23 +0200 |
commit | 0ae494028bd892cdf58346f7e93310b33cd3aa09 (patch) | |
tree | 594d36067d1ac1983bed8522758df1c581bc0f5d /doc/examples | |
parent | 138ee33a41bd52897ba00f8483272694dd3f16b7 (diff) | |
download | libmicrohttpd-0ae494028bd892cdf58346f7e93310b33cd3aa09.tar.gz libmicrohttpd-0ae494028bd892cdf58346f7e93310b33cd3aa09.zip |
check rvalues from MHD_post_process in examples
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/largepost.c | 11 | ||||
-rw-r--r-- | doc/examples/simplepost.c | 7 |
2 files changed, 13 insertions, 5 deletions
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c index 45c4ad03..d52cabe0 100644 --- a/doc/examples/largepost.c +++ b/doc/examples/largepost.c | |||
@@ -95,9 +95,14 @@ send_page (struct MHD_Connection *connection, | |||
95 | response = MHD_create_response_from_buffer_static (strlen (page), page); | 95 | response = MHD_create_response_from_buffer_static (strlen (page), page); |
96 | if (! response) | 96 | if (! response) |
97 | return MHD_NO; | 97 | return MHD_NO; |
98 | MHD_add_response_header (response, | 98 | if (MHD_YES != |
99 | MHD_HTTP_HEADER_CONTENT_TYPE, | 99 | MHD_add_response_header (response, |
100 | "text/html"); | 100 | MHD_HTTP_HEADER_CONTENT_TYPE, |
101 | "text/html")) | ||
102 | { | ||
103 | fprintf (stderr, | ||
104 | "Failed to set content type header!\n"); | ||
105 | } | ||
101 | ret = MHD_queue_response (connection, | 106 | ret = MHD_queue_response (connection, |
102 | status_code, | 107 | status_code, |
103 | response); | 108 | response); |
diff --git a/doc/examples/simplepost.c b/doc/examples/simplepost.c index 4d42b9a7..8706dba6 100644 --- a/doc/examples/simplepost.c +++ b/doc/examples/simplepost.c | |||
@@ -177,8 +177,11 @@ answer_to_connection (void *cls, struct MHD_Connection *connection, | |||
177 | 177 | ||
178 | if (*upload_data_size != 0) | 178 | if (*upload_data_size != 0) |
179 | { | 179 | { |
180 | MHD_post_process (con_info->postprocessor, upload_data, | 180 | if (MHD_YES != |
181 | *upload_data_size); | 181 | MHD_post_process (con_info->postprocessor, |
182 | upload_data, | ||
183 | *upload_data_size)) | ||
184 | return MHD_NO; | ||
182 | *upload_data_size = 0; | 185 | *upload_data_size = 0; |
183 | 186 | ||
184 | return MHD_YES; | 187 | return MHD_YES; |