From: Christian Grothoff Date: Tue, 9 Feb 2010 21:57:02 +0000 (+0000) Subject: fixing shutdown issue uncovered by ARM test X-Git-Tag: initial-import-from-subversion-38251~22754 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f742e2048502ea164ea399ff9da727393ebcef8c;p=oweals%2Fgnunet.git fixing shutdown issue uncovered by ARM test --- diff --git a/src/util/server.c b/src/util/server.c index 9ce8f3cef..62dea6d90 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -135,17 +135,15 @@ struct GNUNET_SERVER_Handle GNUNET_SCHEDULER_TaskIdentifier listen_task; /** - * Do we ignore messages of types that we do not - * understand or do we require that a handler - * is found (and if not kill the connection)? + * Do we ignore messages of types that we do not understand or do we + * require that a handler is found (and if not kill the connection)? */ int require_found; /** - * Should all of the clients of this server continue - * to process connections as usual even if we get - * a shutdown request? (the listen socket always ignores - * shutdown). + * Should all of the clients of this server continue to process + * connections as usual even if we get a shutdown request? (the + * listen socket always ignores shutdown). */ int clients_ignore_shutdown; @@ -483,7 +481,6 @@ GNUNET_SERVER_create (struct GNUNET_SCHEDULER_Handle *sched, ret->require_found = require_found; if (lsocks != NULL) { - r = GNUNET_NETWORK_fdset_create (); i = 0; while (NULL != ret->listen_sockets[i]) @@ -853,7 +850,15 @@ static void restart_processing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_SERVER_Client *client = cls; + struct GNUNET_SERVER_Handle *server = client->server; + if ( (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) && + ( (server == NULL) || + (GNUNET_NO == server->clients_ignore_shutdown) ) ) + { + shutdown_incoming_processing (client); + return; + } GNUNET_SERVER_client_keep (client); process_client_buffer (client); if (0 == client->suspended)