aboutsummaryrefslogtreecommitdiff
path: root/src/set/gnunet-service-set.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-30 08:17:37 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-30 08:17:37 +0000
commit95f9076a2139f5fb042b944a0658b6cda2fa35db (patch)
treeb0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/set/gnunet-service-set.c
parent7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff)
downloadgnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.tar.gz
gnunet-95f9076a2139f5fb042b944a0658b6cda2fa35db.zip
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/set/gnunet-service-set.c')
-rw-r--r--src/set/gnunet-service-set.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c
index e9555928a..2aad60309 100644
--- a/src/set/gnunet-service-set.c
+++ b/src/set/gnunet-service-set.c
@@ -1710,7 +1710,6 @@ handle_client_accept (void *cls,
1710 * Called to clean up, after a shutdown has been requested. 1710 * Called to clean up, after a shutdown has been requested.
1711 * 1711 *
1712 * @param cls closure 1712 * @param cls closure
1713 * @param tc context information (why was this task triggered now)
1714 */ 1713 */
1715static void 1714static void
1716shutdown_task (void *cls) 1715shutdown_task (void *cls)
@@ -1740,7 +1739,6 @@ shutdown_task (void *cls)
1740 * - we suggested an operation to our listener, 1739 * - we suggested an operation to our listener,
1741 * but did not receive a response in time 1740 * but did not receive a response in time
1742 * - we got the channel from a peer but no #GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST 1741 * - we got the channel from a peer but no #GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST
1743 * - shutdown (obviously)
1744 * 1742 *
1745 * @param cls channel context 1743 * @param cls channel context
1746 * @param tc context information (why was this task triggered now) 1744 * @param tc context information (why was this task triggered now)
@@ -1749,13 +1747,9 @@ static void
1749incoming_timeout_cb (void *cls) 1747incoming_timeout_cb (void *cls)
1750{ 1748{
1751 struct Operation *incoming = cls; 1749 struct Operation *incoming = cls;
1752 const struct GNUNET_SCHEDULER_TaskContext *tc;
1753 1750
1754 incoming->timeout_task = NULL; 1751 incoming->timeout_task = NULL;
1755 GNUNET_assert (GNUNET_YES == incoming->is_incoming); 1752 GNUNET_assert (GNUNET_YES == incoming->is_incoming);
1756 tc = GNUNET_SCHEDULER_get_task_context ();
1757 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1758 return;
1759 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1753 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1760 "Remote peer's incoming request timed out\n"); 1754 "Remote peer's incoming request timed out\n");
1761 incoming_destroy (incoming); 1755 incoming_destroy (incoming);
@@ -1997,8 +1991,7 @@ run (void *cls,
1997 static const uint32_t cadet_ports[] = {GNUNET_APPLICATION_TYPE_SET, 0}; 1991 static const uint32_t cadet_ports[] = {GNUNET_APPLICATION_TYPE_SET, 0};
1998 1992
1999 configuration = cfg; 1993 configuration = cfg;
2000 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 1994 GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
2001 &shutdown_task, NULL);
2002 GNUNET_SERVER_disconnect_notify (server, 1995 GNUNET_SERVER_disconnect_notify (server,
2003 &handle_client_disconnect, NULL); 1996 &handle_client_disconnect, NULL);
2004 GNUNET_SERVER_add_handlers (server, 1997 GNUNET_SERVER_add_handlers (server,