delay cancelling listen operations to avoid rejecting operations before they had...
authorChristian Grothoff <christian@grothoff.org>
Wed, 4 Oct 2017 11:59:39 +0000 (13:59 +0200)
committerChristian Grothoff <christian@grothoff.org>
Wed, 4 Oct 2017 11:59:39 +0000 (13:59 +0200)
src/include/gnunet_set_service.h
src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
src/scalarproduct/gnunet-service-scalarproduct_alice.c
src/set/gnunet-service-set.c
src/set/test_set_intersection_result_full.c
src/set/test_set_union_result_symmetric.c

index 6e822d82e75b682a89a30158bbdda4b79e5b5afb..dfe9b8954b24542fcd3033395b9e09112afe6ade 100644 (file)
@@ -452,6 +452,8 @@ GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg,
 /**
  * Cancel the given listen operation.  After calling cancel, the
  * listen callback for this listen handle will not be called again.
+ * Note that cancelling a listen operation will automatically reject
+ * all operations that have not yet been accepted.
  *
  * @param lh handle for the listen operation
  */
index c0b33f8efe7ca0f99b1398db90ec6f3dade27a88..57f275c81e4632be1518b5bdfd6903d0e979b398 100644 (file)
@@ -260,8 +260,6 @@ destroy_service_session (struct AliceServiceSession *s)
   }
   if (NULL != s->intersection_listen)
   {
-    LOG (GNUNET_ERROR_TYPE_DEBUG,
-         "Set intersection, listen still up!\n");
     GNUNET_SET_listen_cancel (s->intersection_listen);
     s->intersection_listen = NULL;
   }
@@ -274,8 +272,6 @@ destroy_service_session (struct AliceServiceSession *s)
   }
   if (NULL != s->intersection_set)
   {
-    LOG (GNUNET_ERROR_TYPE_DEBUG,
-         "Set intersection, set still there!\n");
     GNUNET_SET_destroy (s->intersection_set);
     s->intersection_set = NULL;
   }
@@ -809,10 +805,6 @@ cb_intersection_request_alice (void *cls,
     prepare_client_end_notification (s);
     return;
   }
-  GNUNET_SET_destroy (s->intersection_set);
-  s->intersection_set = NULL;
-  GNUNET_SET_listen_cancel (s->intersection_listen);
-  s->intersection_listen = NULL;
 }
 
 
index a55d03900972152185e32e6be70bacada8209c16..fcb1ce0322b6bb1d64699f1dfa4d0d62aac1ee30 100644 (file)
@@ -243,8 +243,6 @@ free_element_cb (void *cls,
 static void
 destroy_service_session (struct AliceServiceSession *s)
 {
-  unsigned int i;
-
   if (GNUNET_YES == s->in_destroy)
     return;
   s->in_destroy = GNUNET_YES;
@@ -285,7 +283,7 @@ destroy_service_session (struct AliceServiceSession *s)
   }
   if (NULL != s->sorted_elements)
   {
-    for (i=0;i<s->used_element_count;i++)
+    for (unsigned int i=0;i<s->used_element_count;i++)
       gcry_mpi_release (s->sorted_elements[i].value);
     GNUNET_free (s->sorted_elements);
     s->sorted_elements = NULL;
@@ -1043,10 +1041,6 @@ cb_intersection_request_alice (void *cls,
     prepare_client_end_notification (s);
     return;
   }
-  GNUNET_SET_destroy (s->intersection_set);
-  s->intersection_set = NULL;
-  GNUNET_SET_listen_cancel (s->intersection_listen);
-  s->intersection_listen = NULL;
 }
 
 
index 617a336618644c6abbdc4897b23325cfc406af2c..42d06b275329d0c67b1eac5405af3fc5609806e6 100644 (file)
@@ -628,7 +628,13 @@ client_disconnect_cb (void *cls,
     GNUNET_CADET_close_port (listener->open_port);
     listener->open_port = NULL;
     while (NULL != (op = listener->op_head))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Destroying incoming operation `%u' from peer `%s'\n",
+                  (unsigned int) op->client_request_id,
+                  GNUNET_i2s (&op->peer));
       incoming_destroy (op);
+    }
     GNUNET_CONTAINER_DLL_remove (listener_head,
                                  listener_tail,
                                  listener);
index a36aae4d5b8a671b0591903e4a59303841c12c50..16de983cf053b67c77d179b9bb56c9798821d2b0 100644 (file)
@@ -131,8 +131,6 @@ listen_cb (void *cls,
               "starting intersection by accepting and committing\n");
   GNUNET_assert (NULL != context_msg);
   GNUNET_assert (ntohs (context_msg->type) == GNUNET_MESSAGE_TYPE_DUMMY);
-  GNUNET_SET_listen_cancel (listen_handle);
-  listen_handle = NULL;
   oh2 = GNUNET_SET_accept (request,
                            GNUNET_SET_RESULT_FULL,
                            (struct GNUNET_SET_Option[]) { 0 },
index f81c7b8f7adcda82d40158bc74b212e731175c9e..3008e5aac09321444fc34773cb8da688aa8c1cb6 100644 (file)
@@ -182,8 +182,6 @@ listen_cb (void *cls,
   GNUNET_assert (ntohs (context_msg->type) == GNUNET_MESSAGE_TYPE_DUMMY);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "listen cb called\n");
-  GNUNET_SET_listen_cancel (listen_handle);
-  listen_handle = NULL;
   oh2 = GNUNET_SET_accept (request,
                            GNUNET_SET_RESULT_SYMMETRIC,
                            (struct GNUNET_SET_Option[]) { 0 },