diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-04-11 14:08:30 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-04-11 14:08:30 +0000 |
commit | d4d4393a1607b761d460ff51d865397c0a92942c (patch) | |
tree | 82dda2aec1d1aca6df7141c000c1acb3adea0a75 | |
parent | 5ad31494eb7d5f5589081401533bea60091d206e (diff) |
Added check result of MHD_post_process() in largepost.c
-rw-r--r-- | doc/examples/largepost.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c index 04c7df37..01d005ab 100644 --- a/doc/examples/largepost.c +++ b/doc/examples/largepost.c @@ -65,6 +65,8 @@ const char *servererrorpage = "<html><body>An internal server error has occured.</body></html>"; const char *fileexistspage = "<html><body>This file already exists.</body></html>"; +const char const *postprocerror = + "<html><head><title>Error</title></head><body>Error processing POST data</body></html>"; static int @@ -241,9 +243,14 @@ answer_to_connection (void *cls, if (0 != *upload_data_size) { - MHD_post_process (con_info->postprocessor, - upload_data, - *upload_data_size); + if (MHD_post_process (con_info->postprocessor, + upload_data, + *upload_data_size) != MHD_YES) + { + return send_page (connection, + postprocerror, + MHD_HTTP_BAD_REQUEST); + } *upload_data_size = 0; return MHD_YES; |