fixing 1845
authorChristian Grothoff <christian@grothoff.org>
Mon, 24 Oct 2011 08:39:44 +0000 (08:39 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 24 Oct 2011 08:39:44 +0000 (08:39 +0000)
src/core/gnunet-service-core_clients.c

index 8f77c62a6c9544b5f2e4af852817dc9067b3df70..22201514a1fbf579df7b7b74e25be98eb1184169 100644 (file)
@@ -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 ==