diff options
Diffstat (limited to 'src/rest/gnunet-rest-server.c')
-rw-r--r-- | src/rest/gnunet-rest-server.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index 02a2c6daf..30eade623 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <microhttpd.h> | 27 | #include <microhttpd.h> |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "gnunet_rest_plugin.h" | 29 | #include "gnunet_rest_plugin.h" |
30 | 30 | #include "gnunet_mhd_compat.h" | |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * Default Socks5 listen port. | 33 | * Default Socks5 listen port. |
@@ -302,7 +302,7 @@ url_iterator (void *cls, | |||
302 | } | 302 | } |
303 | 303 | ||
304 | 304 | ||
305 | static int | 305 | static MHD_RESULT |
306 | post_data_iter (void *cls, | 306 | post_data_iter (void *cls, |
307 | enum MHD_ValueKind kind, | 307 | enum MHD_ValueKind kind, |
308 | const char *key, | 308 | const char *key, |
@@ -359,11 +359,11 @@ post_data_iter (void *cls, | |||
359 | * @a upload_data provided; the method must update this | 359 | * @a upload_data provided; the method must update this |
360 | * value to the number of bytes NOT processed; | 360 | * value to the number of bytes NOT processed; |
361 | * @param con_cls pointer to location where we store the 'struct Request' | 361 | * @param con_cls pointer to location where we store the 'struct Request' |
362 | * @return MHD_YES if the connection was handled successfully, | 362 | * @return #MHD_YES if the connection was handled successfully, |
363 | * MHD_NO if the socket must be closed due to a serious | 363 | * #MHD_NO if the socket must be closed due to a serious |
364 | * error while handling the request | 364 | * error while handling the request |
365 | */ | 365 | */ |
366 | static int | 366 | static MHD_RESULT |
367 | create_response (void *cls, | 367 | create_response (void *cls, |
368 | struct MHD_Connection *con, | 368 | struct MHD_Connection *con, |
369 | const char *url, | 369 | const char *url, |
@@ -430,7 +430,7 @@ create_response (void *cls, | |||
430 | rest_conndata_handle); | 430 | rest_conndata_handle); |
431 | con_handle->pp = MHD_create_post_processor (con, | 431 | con_handle->pp = MHD_create_post_processor (con, |
432 | 65536, | 432 | 65536, |
433 | post_data_iter, | 433 | &post_data_iter, |
434 | rest_conndata_handle); | 434 | rest_conndata_handle); |
435 | if (*upload_data_size) | 435 | if (*upload_data_size) |
436 | { | 436 | { |
@@ -509,9 +509,13 @@ create_response (void *cls, | |||
509 | allow_headers); | 509 | allow_headers); |
510 | } | 510 | } |
511 | run_mhd_now (); | 511 | run_mhd_now (); |
512 | int ret = MHD_queue_response (con, con_handle->status, con_handle->response); | 512 | { |
513 | cleanup_handle (con_handle); | 513 | MHD_RESULT ret = MHD_queue_response (con, |
514 | return ret; | 514 | con_handle->status, |
515 | con_handle->response); | ||
516 | cleanup_handle (con_handle); | ||
517 | return ret; | ||
518 | } | ||
515 | } | 519 | } |
516 | 520 | ||
517 | 521 | ||