gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10264 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r10264 - gnunet/src/util
Date: Tue, 9 Feb 2010 22:57:02 +0100

Author: grothoff
Date: 2010-02-09 22:57:02 +0100 (Tue, 09 Feb 2010)
New Revision: 10264

Modified:
   gnunet/src/util/server.c
Log:
fixing shutdown issue uncovered by ARM test

Modified: gnunet/src/util/server.c
===================================================================
--- gnunet/src/util/server.c    2010-02-09 20:18:04 UTC (rev 10263)
+++ gnunet/src/util/server.c    2010-02-09 21:57:02 UTC (rev 10264)
@@ -135,17 +135,15 @@
   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 @@
   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 @@
 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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]