diff options
-rw-r--r-- | doc/examples/largepost.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c index 6846a536..1edf4d50 100644 --- a/doc/examples/largepost.c +++ b/doc/examples/largepost.c | |||
@@ -138,6 +138,8 @@ iterate_post (void *coninfo_cls, | |||
138 | 138 | ||
139 | if (! con_info->fp) | 139 | if (! con_info->fp) |
140 | { | 140 | { |
141 | if (0 != con_info->answercode) /* something went wrong */ | ||
142 | return MHD_YES; | ||
141 | if (NULL != (fp = fopen (filename, "rb"))) | 143 | if (NULL != (fp = fopen (filename, "rb"))) |
142 | { | 144 | { |
143 | fclose (fp); | 145 | fclose (fp); |
@@ -161,7 +163,7 @@ iterate_post (void *coninfo_cls, | |||
161 | { | 163 | { |
162 | con_info->answerstring = fileioerror; | 164 | con_info->answerstring = fileioerror; |
163 | con_info->answercode = MHD_HTTP_INTERNAL_SERVER_ERROR; | 165 | con_info->answercode = MHD_HTTP_INTERNAL_SERVER_ERROR; |
164 | return MHD_NO; | 166 | return MHD_YES; |
165 | } | 167 | } |
166 | } | 168 | } |
167 | 169 | ||
@@ -325,7 +327,11 @@ main () | |||
325 | MHD_OPTION_NOTIFY_COMPLETED, &request_completed, NULL, | 327 | MHD_OPTION_NOTIFY_COMPLETED, &request_completed, NULL, |
326 | MHD_OPTION_END); | 328 | MHD_OPTION_END); |
327 | if (NULL == daemon) | 329 | if (NULL == daemon) |
328 | return 1; | 330 | { |
331 | fprintf (stderr, | ||
332 | "Failed to start daemon\n"); | ||
333 | return 1; | ||
334 | } | ||
329 | (void) getchar (); | 335 | (void) getchar (); |
330 | MHD_stop_daemon (daemon); | 336 | MHD_stop_daemon (daemon); |
331 | return 0; | 337 | return 0; |