diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-02-09 21:57:02 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-02-09 21:57:02 +0000 |
commit | f742e2048502ea164ea399ff9da727393ebcef8c (patch) | |
tree | 533dee13bbb78e0f818f0c951f6ccb90b654bfe8 /src/util | |
parent | 386b2b80afcdf906a38c06e96bfea2d5bd70d0c9 (diff) | |
download | gnunet-f742e2048502ea164ea399ff9da727393ebcef8c.tar.gz gnunet-f742e2048502ea164ea399ff9da727393ebcef8c.zip |
fixing shutdown issue uncovered by ARM test
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/server.c | 21 |
1 files changed, 13 insertions, 8 deletions
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 | |||
135 | GNUNET_SCHEDULER_TaskIdentifier listen_task; | 135 | GNUNET_SCHEDULER_TaskIdentifier listen_task; |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * Do we ignore messages of types that we do not | 138 | * Do we ignore messages of types that we do not understand or do we |
139 | * understand or do we require that a handler | 139 | * require that a handler is found (and if not kill the connection)? |
140 | * is found (and if not kill the connection)? | ||
141 | */ | 140 | */ |
142 | int require_found; | 141 | int require_found; |
143 | 142 | ||
144 | /** | 143 | /** |
145 | * Should all of the clients of this server continue | 144 | * Should all of the clients of this server continue to process |
146 | * to process connections as usual even if we get | 145 | * connections as usual even if we get a shutdown request? (the |
147 | * a shutdown request? (the listen socket always ignores | 146 | * listen socket always ignores shutdown). |
148 | * shutdown). | ||
149 | */ | 147 | */ |
150 | int clients_ignore_shutdown; | 148 | int clients_ignore_shutdown; |
151 | 149 | ||
@@ -483,7 +481,6 @@ GNUNET_SERVER_create (struct GNUNET_SCHEDULER_Handle *sched, | |||
483 | ret->require_found = require_found; | 481 | ret->require_found = require_found; |
484 | if (lsocks != NULL) | 482 | if (lsocks != NULL) |
485 | { | 483 | { |
486 | |||
487 | r = GNUNET_NETWORK_fdset_create (); | 484 | r = GNUNET_NETWORK_fdset_create (); |
488 | i = 0; | 485 | i = 0; |
489 | while (NULL != ret->listen_sockets[i]) | 486 | while (NULL != ret->listen_sockets[i]) |
@@ -853,7 +850,15 @@ static void | |||
853 | restart_processing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 850 | restart_processing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
854 | { | 851 | { |
855 | struct GNUNET_SERVER_Client *client = cls; | 852 | struct GNUNET_SERVER_Client *client = cls; |
853 | struct GNUNET_SERVER_Handle *server = client->server; | ||
856 | 854 | ||
855 | if ( (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) && | ||
856 | ( (server == NULL) || | ||
857 | (GNUNET_NO == server->clients_ignore_shutdown) ) ) | ||
858 | { | ||
859 | shutdown_incoming_processing (client); | ||
860 | return; | ||
861 | } | ||
857 | GNUNET_SERVER_client_keep (client); | 862 | GNUNET_SERVER_client_keep (client); |
858 | process_client_buffer (client); | 863 | process_client_buffer (client); |
859 | if (0 == client->suspended) | 864 | if (0 == client->suspended) |