diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-24 14:07:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-24 14:07:52 +0000 |
commit | 84123de1ed06270c74a771ec7f91627adc79c404 (patch) | |
tree | 31da48a0a094901d7eb085612689e45d90313ac1 /src | |
parent | 658c3cf583b0c09e55c41a78a9ec8dbe28cb515e (diff) | |
download | gnunet-84123de1ed06270c74a771ec7f91627adc79c404.tar.gz gnunet-84123de1ed06270c74a771ec7f91627adc79c404.zip |
fix http server shutdown sequence
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 96f79e482..e542c29b8 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -774,8 +774,8 @@ http_server_plugin_send (void *cls, | |||
774 | */ | 774 | */ |
775 | static int | 775 | static int |
776 | destroy_session_shutdown_cb (void *cls, | 776 | destroy_session_shutdown_cb (void *cls, |
777 | const struct GNUNET_PeerIdentity *peer, | 777 | const struct GNUNET_PeerIdentity *peer, |
778 | void *value) | 778 | void *value) |
779 | { | 779 | { |
780 | struct GNUNET_ATS_Session *s = value; | 780 | struct GNUNET_ATS_Session *s = value; |
781 | struct ServerRequest *sc_send; | 781 | struct ServerRequest *sc_send; |
@@ -1851,9 +1851,12 @@ server_access_cb (void *cls, | |||
1851 | else | 1851 | else |
1852 | { | 1852 | { |
1853 | /* delay processing */ | 1853 | /* delay processing */ |
1854 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1854 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1855 | "Session %p / Connection %p: no inbound bandwidth available! Next read was delayed by %s\n", | 1855 | "Session %p / Connection %p: no inbound bandwidth available! Next read was delayed by %s\n", |
1856 | s, sc, GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES)); | 1856 | s, |
1857 | sc, | ||
1858 | GNUNET_STRINGS_relative_time_to_string (delay, | ||
1859 | GNUNET_YES)); | ||
1857 | GNUNET_assert(s->server_recv->mhd_conn == mhd_connection); | 1860 | GNUNET_assert(s->server_recv->mhd_conn == mhd_connection); |
1858 | MHD_suspend_connection (s->server_recv->mhd_conn); | 1861 | MHD_suspend_connection (s->server_recv->mhd_conn); |
1859 | if (NULL == s->recv_wakeup_task) | 1862 | if (NULL == s->recv_wakeup_task) |
@@ -3170,16 +3173,6 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
3170 | 3173 | ||
3171 | /* Stop to report addresses to transport service */ | 3174 | /* Stop to report addresses to transport service */ |
3172 | server_stop_report_addresses (plugin); | 3175 | server_stop_report_addresses (plugin); |
3173 | if (NULL != plugin->server_v4) | ||
3174 | { | ||
3175 | MHD_stop_daemon (plugin->server_v4); | ||
3176 | plugin->server_v4 = NULL; | ||
3177 | } | ||
3178 | if (NULL != plugin->server_v6) | ||
3179 | { | ||
3180 | MHD_stop_daemon (plugin->server_v6); | ||
3181 | plugin->server_v6 = NULL; | ||
3182 | } | ||
3183 | if (NULL != plugin->server_v4_task) | 3176 | if (NULL != plugin->server_v4_task) |
3184 | { | 3177 | { |
3185 | GNUNET_SCHEDULER_cancel (plugin->server_v4_task); | 3178 | GNUNET_SCHEDULER_cancel (plugin->server_v4_task); |
@@ -3201,6 +3194,16 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) | |||
3201 | plugin); | 3194 | plugin); |
3202 | GNUNET_CONTAINER_multipeermap_destroy (plugin->sessions); | 3195 | GNUNET_CONTAINER_multipeermap_destroy (plugin->sessions); |
3203 | plugin->sessions = NULL; | 3196 | plugin->sessions = NULL; |
3197 | if (NULL != plugin->server_v4) | ||
3198 | { | ||
3199 | MHD_stop_daemon (plugin->server_v4); | ||
3200 | plugin->server_v4 = NULL; | ||
3201 | } | ||
3202 | if (NULL != plugin->server_v6) | ||
3203 | { | ||
3204 | MHD_stop_daemon (plugin->server_v6); | ||
3205 | plugin->server_v6 = NULL; | ||
3206 | } | ||
3204 | /* Clean up */ | 3207 | /* Clean up */ |
3205 | GNUNET_free_non_null (plugin->external_hostname); | 3208 | GNUNET_free_non_null (plugin->external_hostname); |
3206 | GNUNET_free_non_null (plugin->ext_addr); | 3209 | GNUNET_free_non_null (plugin->ext_addr); |