gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r32279 - gnunet/src/set


From: gnunet
Subject: [GNUnet-SVN] r32279 - gnunet/src/set
Date: Mon, 10 Feb 2014 19:07:10 +0100

Author: dold
Date: 2014-02-10 19:07:10 +0100 (Mon, 10 Feb 2014)
New Revision: 32279

Modified:
   gnunet/src/set/gnunet-service-set.c
Log:
- don't kill clients if the set operation has already been destroyed


Modified: gnunet/src/set/gnunet-service-set.c
===================================================================
--- gnunet/src/set/gnunet-service-set.c 2014-02-10 17:50:14 UTC (rev 32278)
+++ gnunet/src/set/gnunet-service-set.c 2014-02-10 18:07:10 UTC (rev 32279)
@@ -1100,32 +1100,41 @@
   struct Operation *op;
 
   msg = (const struct GNUNET_SET_AcceptRejectMessage *) mh;
-  op = get_incoming (ntohl (msg->accept_reject_id));
 
-  // incoming operation does not exist
-  if (NULL == op)
+  // client without a set requested an operation
+  set = set_get (client);
+
+  if (NULL == set)
   {
     GNUNET_break (0);
     GNUNET_SERVER_client_disconnect (client);
     return;
   }
 
+  op = get_incoming (ntohl (msg->accept_reject_id));
+
+  /* it is not an error if the set op does not exist -- it may
+   * have been destroyed when the partner peer disconnected. */
+  if (NULL == op)
+  {
+    struct GNUNET_SET_ResultMessage *result_message;
+    struct GNUNET_MQ_Envelope *ev;
+    ev = GNUNET_MQ_msg (result_message, GNUNET_MESSAGE_TYPE_SET_RESULT);
+    result_message->request_id = msg->request_id;
+    result_message->element_type = 0;
+    result_message->result_status = htons (GNUNET_SET_STATUS_FAILURE);
+    GNUNET_MQ_send (set->client_mq, ev);
+    GNUNET_SERVER_receive_done (client, GNUNET_OK);
+    return;
+  }
+
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "client accepting %u\n",
               ntohl (msg->accept_reject_id));
 
   GNUNET_assert (GNUNET_YES == op->is_incoming);
 
-  // client without a set requested an operation
-  set = set_get (client);
 
-  if (NULL == set)
-  {
-    GNUNET_break (0);
-    GNUNET_SERVER_client_disconnect (client);
-    return;
-  }
-
   op->spec->set = set;
 
   incoming_retire (op);




reply via email to

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