aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-09-14 13:44:56 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-09-14 13:44:56 +0000
commita181b48c4201a8868287eb9c55869efd483d2c4f (patch)
tree72fdaf3970a68052b749d44733aefacb2ec37bd7 /src/transport/plugin_transport_http_server.c
parent3dc71e42c0e9433f21bfa26da6fcd71a400b00b6 (diff)
downloadgnunet-a181b48c4201a8868287eb9c55869efd483d2c4f.tar.gz
gnunet-a181b48c4201a8868287eb9c55869efd483d2c4f.zip
- shutdown fix
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index f04933f83..6effb30e2 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -213,6 +213,11 @@ struct HTTP_Server_Plugin
213 unsigned int cur_connections; 213 unsigned int cur_connections;
214 214
215 /** 215 /**
216 * Did we immediately end the session in disconnect_cb
217 */
218 int in_shutdown;
219
220 /**
216 * External hostname the plugin can be connected to, can be different to 221 * External hostname the plugin can be connected to, can be different to
217 * the host's FQDN, used e.g. for reverse proxying 222 * the host's FQDN, used e.g. for reverse proxying
218 */ 223 */
@@ -1584,6 +1589,9 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
1584 1589
1585 struct GNUNET_TIME_Relative tv; 1590 struct GNUNET_TIME_Relative tv;
1586 1591
1592 if (GNUNET_YES == plugin->in_shutdown)
1593 return GNUNET_SCHEDULER_NO_TASK;
1594
1587 ret = GNUNET_SCHEDULER_NO_TASK; 1595 ret = GNUNET_SCHEDULER_NO_TASK;
1588 FD_ZERO (&rs); 1596 FD_ZERO (&rs);
1589 FD_ZERO (&ws); 1597 FD_ZERO (&ws);
@@ -1598,11 +1606,10 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
1598 { 1606 {
1599 if (timeout != last_timeout) 1607 if (timeout != last_timeout)
1600 { 1608 {
1601#if VERBOSE_SERVER 1609
1602 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 1610 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
1603 "SELECT Timeout changed from %llu to %llu\n", 1611 "SELECT Timeout changed from %llu to %llu\n",
1604 last_timeout, timeout); 1612 last_timeout, timeout);
1605#endif
1606 last_timeout = timeout; 1613 last_timeout = timeout;
1607 } 1614 }
1608 tv.rel_value = (uint64_t) timeout; 1615 tv.rel_value = (uint64_t) timeout;
@@ -2710,7 +2717,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
2710 GNUNET_free (api); 2717 GNUNET_free (api);
2711 return NULL; 2718 return NULL;
2712 } 2719 }
2713 2720 plugin->in_shutdown = GNUNET_YES;
2714 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 2721 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
2715 _("Shutting down plugin `%s'\n"), 2722 _("Shutting down plugin `%s'\n"),
2716 plugin->name); 2723 plugin->name);
@@ -2757,7 +2764,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
2757 if ((GNUNET_YES == pos->session_passed) && (GNUNET_NO == pos->session_ended)) 2764 if ((GNUNET_YES == pos->session_passed) && (GNUNET_NO == pos->session_ended))
2758 { 2765 {
2759 /* Notify transport immediately that this session is invalid */ 2766 /* Notify transport immediately that this session is invalid */
2760 pos->session_ended = GNUNET_YES; 2767 pos->session_ended = GNUNET_YES;
2761 plugin->env->session_end (plugin->env->cls, &pos->target, pos); 2768 plugin->env->session_end (plugin->env->cls, &pos->target, pos);
2762 } 2769 }
2763 2770