summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-24 14:07:52 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-24 14:07:52 +0000
commit84123de1ed06270c74a771ec7f91627adc79c404 (patch)
tree31da48a0a094901d7eb085612689e45d90313ac1 /src/transport/plugin_transport_http_server.c
parent658c3cf583b0c09e55c41a78a9ec8dbe28cb515e (diff)
fix http server shutdown sequence
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c33
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,
*/
static int
destroy_session_shutdown_cb (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- void *value)
+ const struct GNUNET_PeerIdentity *peer,
+ void *value)
{
struct GNUNET_ATS_Session *s = value;
struct ServerRequest *sc_send;
@@ -1851,9 +1851,12 @@ server_access_cb (void *cls,
else
{
/* delay processing */
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
- "Session %p / Connection %p: no inbound bandwidth available! Next read was delayed by %s\n",
- s, sc, GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Session %p / Connection %p: no inbound bandwidth available! Next read was delayed by %s\n",
+ s,
+ sc,
+ GNUNET_STRINGS_relative_time_to_string (delay,
+ GNUNET_YES));
GNUNET_assert(s->server_recv->mhd_conn == mhd_connection);
MHD_suspend_connection (s->server_recv->mhd_conn);
if (NULL == s->recv_wakeup_task)
@@ -3170,16 +3173,6 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
/* Stop to report addresses to transport service */
server_stop_report_addresses (plugin);
- if (NULL != plugin->server_v4)
- {
- MHD_stop_daemon (plugin->server_v4);
- plugin->server_v4 = NULL;
- }
- if (NULL != plugin->server_v6)
- {
- MHD_stop_daemon (plugin->server_v6);
- plugin->server_v6 = NULL;
- }
if (NULL != plugin->server_v4_task)
{
GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
@@ -3201,6 +3194,16 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
plugin);
GNUNET_CONTAINER_multipeermap_destroy (plugin->sessions);
plugin->sessions = NULL;
+ if (NULL != plugin->server_v4)
+ {
+ MHD_stop_daemon (plugin->server_v4);
+ plugin->server_v4 = NULL;
+ }
+ if (NULL != plugin->server_v6)
+ {
+ MHD_stop_daemon (plugin->server_v6);
+ plugin->server_v6 = NULL;
+ }
/* Clean up */
GNUNET_free_non_null (plugin->external_hostname);
GNUNET_free_non_null (plugin->ext_addr);