aboutsummaryrefslogtreecommitdiff
path: root/src/rest
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-09 00:29:16 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-09 00:29:16 +0200
commit8547143da77b0bae392758040313762eb60d7e86 (patch)
tree0e277ad44dfeb7a439df8f4d55f90688295e4e3d /src/rest
parent6fc0526b4c2ecb735cf2b697e2fbbed3c35af382 (diff)
downloadgnunet-8547143da77b0bae392758040313762eb60d7e86.tar.gz
gnunet-8547143da77b0bae392758040313762eb60d7e86.zip
adapt code to work with latest MHD API
Diffstat (limited to 'src/rest')
-rw-r--r--src/rest/gnunet-rest-server.c22
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
305static int 305static MHD_RESULT
306post_data_iter (void *cls, 306post_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 */
366static int 366static MHD_RESULT
367create_response (void *cls, 367create_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