From 6063cbea42d6c8a5de4d3b98d47ab60d7cb3311a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 24 Oct 2011 08:39:44 +0000 Subject: [PATCH] fixing 1845 --- src/core/gnunet-service-core_clients.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c index 8f77c62a6..22201514a 100644 --- a/src/core/gnunet-service-core_clients.c +++ b/src/core/gnunet-service-core_clients.c @@ -443,9 +443,16 @@ handle_client_send (void *cls, struct GNUNET_SERVER_Client *client, tc.car = GNUNET_CONTAINER_multihashmap_get (c->requests, &sm->peer.hashPubKey); if (NULL == tc.car) { - /* client did not request transmission first! */ - GNUNET_break (0); - GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); + /* Must have been that we first approved the request, then got disconnected + (which triggered removal of the 'car') and now the client gives us a message + just *before* the client learns about the disconnect. Theoretically, we + might also now be *again* connected. So this can happen (but should be + rare). If it does happen, the message is discarded. */ + GNUNET_STATISTICS_update (GSC_stats, + gettext_noop ("# messages discarded (session disconnected)"), + 1, + GNUNET_NO); + GNUNET_SERVER_receive_done (client, GNUNET_OK); return; } GNUNET_assert (GNUNET_YES == -- 2.25.1