aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/examples/largepost.c11
-rw-r--r--doc/examples/simplepost.c7
-rw-r--r--src/examples/post_example.c19
-rw-r--r--src/examples/timeout.c11
4 files changed, 32 insertions, 16 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;
diff --git a/src/examples/post_example.c b/src/examples/post_example.c
index 5bd88773..f6823e38 100644
--- a/src/examples/post_example.c
+++ b/src/examples/post_example.c
@@ -205,12 +205,13 @@ get_session (struct MHD_Connection *connection)
205 * @param mime mime type to use 205 * @param mime mime type to use
206 * @param session session information 206 * @param session session information
207 * @param connection connection to process 207 * @param connection connection to process
208 * @param MHD_YES on success, MHD_NO on failure 208 * @param #MHD_YES on success, #MHD_NO on failure
209 */ 209 */
210typedef enum MHD_Result (*PageHandler)(const void *cls, 210typedef enum MHD_Result
211 const char *mime, 211(*PageHandler)(const void *cls,
212 struct Session *session, 212 const char *mime,
213 struct MHD_Connection *connection); 213 struct Session *session,
214 struct MHD_Connection *connection);
214 215
215 216
216/** 217/**
@@ -633,9 +634,11 @@ create_response (void *cls,
633 if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) 634 if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
634 { 635 {
635 /* evaluate POST data */ 636 /* evaluate POST data */
636 MHD_post_process (request->pp, 637 if (MHD_YES !=
637 upload_data, 638 MHD_post_process (request->pp,
638 *upload_data_size); 639 upload_data,
640 *upload_data_size))
641 return MHD_NO;
639 if (0 != *upload_data_size) 642 if (0 != *upload_data_size)
640 { 643 {
641 *upload_data_size = 0; 644 *upload_data_size = 0;
diff --git a/src/examples/timeout.c b/src/examples/timeout.c
index dacc93fd..714cf074 100644
--- a/src/examples/timeout.c
+++ b/src/examples/timeout.c
@@ -53,9 +53,14 @@ answer_to_connection (void *cls,
53 53
54 response = MHD_create_response_from_buffer_static (strlen (page), 54 response = MHD_create_response_from_buffer_static (strlen (page),
55 (const void *) page); 55 (const void *) page);
56 MHD_add_response_header (response, 56 if (MHD_YES !=
57 MHD_HTTP_HEADER_CONTENT_TYPE, 57 MHD_add_response_header (response,
58 "text/html"); 58 MHD_HTTP_HEADER_CONTENT_TYPE,
59 "text/html"))
60 {
61 fprintf (stderr,
62 "Failed to set content type header!\n");
63 }
59 ret = MHD_queue_response (connection, 64 ret = MHD_queue_response (connection,
60 MHD_HTTP_OK, 65 MHD_HTTP_OK,
61 response); 66 response);