diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-07-15 14:19:38 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-07-15 14:19:38 +0200 |
commit | febfb2408227b432e0455f62590cda628323437a (patch) | |
tree | ecfd4e0e79f96acae764b0d08630dbddda5d6806 /src/rest | |
parent | eefd54e14a36b9b52b6a6a69224b26093ae5eba8 (diff) | |
download | gnunet-febfb2408227b432e0455f62590cda628323437a.tar.gz gnunet-febfb2408227b432e0455f62590cda628323437a.zip |
enable suspend resume for REST
Diffstat (limited to 'src/rest')
-rw-r--r-- | src/rest/gnunet-rest-server.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index 6b89d19fe..b0b25f308 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c | |||
@@ -199,6 +199,7 @@ plugin_callback (void *cls, struct MHD_Response *resp, int status) | |||
199 | struct MhdConnectionHandle *handle = cls; | 199 | struct MhdConnectionHandle *handle = cls; |
200 | handle->status = status; | 200 | handle->status = status; |
201 | handle->response = resp; | 201 | handle->response = resp; |
202 | MHD_resume_connection (handle->con); | ||
202 | run_mhd_now (); | 203 | run_mhd_now (); |
203 | } | 204 | } |
204 | 205 | ||
@@ -433,11 +434,14 @@ create_response (void *cls, | |||
433 | } | 434 | } |
434 | MHD_destroy_post_processor (con_handle->pp); | 435 | MHD_destroy_post_processor (con_handle->pp); |
435 | 436 | ||
437 | //Suspend connection until plugin is done | ||
438 | MHD_suspend_connection (con_handle->con); | ||
436 | con_handle->state = GN_REST_STATE_PROCESSING; | 439 | con_handle->state = GN_REST_STATE_PROCESSING; |
437 | con_handle->plugin->process_request (rest_conndata_handle, | 440 | con_handle->plugin->process_request (rest_conndata_handle, |
438 | &plugin_callback, | 441 | &plugin_callback, |
439 | con_handle); | 442 | con_handle); |
440 | *upload_data_size = 0; | 443 | *upload_data_size = 0; |
444 | return MHD_YES; | ||
441 | } | 445 | } |
442 | if (NULL != con_handle->response) | 446 | if (NULL != con_handle->response) |
443 | { | 447 | { |
@@ -979,7 +983,7 @@ run (void *cls, | |||
979 | return; | 983 | return; |
980 | } | 984 | } |
981 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service listens on port %llu\n", port); | 985 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service listens on port %llu\n", port); |
982 | httpd = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_NO_LISTEN_SOCKET, | 986 | httpd = MHD_start_daemon (MHD_USE_DEBUG | MHD_USE_NO_LISTEN_SOCKET | MHD_ALLOW_SUSPEND_RESUME, |
983 | 0, | 987 | 0, |
984 | NULL, | 988 | NULL, |
985 | NULL, | 989 | NULL, |