gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated (94fa99870 -> fb6e2fdd2)


From: gnunet
Subject: [gnunet] branch master updated (94fa99870 -> fb6e2fdd2)
Date: Sat, 29 Aug 2020 23:36:27 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a change to branch master
in repository gnunet.

    from 94fa99870 -mild refactoring of consensus, cleaning up the code a bit
     new 394cacf9f -mild refactoring of consensus, cleaning up the code a bit
     new fb6e2fdd2 -mild refactoring of consensus, cleaning up the code a bit

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/consensus/gnunet-service-consensus.c | 31 +++++++++++++++----------------
 src/consensus/plugin_block_consensus.c   | 13 ++++++-------
 2 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/src/consensus/gnunet-service-consensus.c 
b/src/consensus/gnunet-service-consensus.c
index 3a8356635..587e3685f 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -17,13 +17,11 @@
 
      SPDX-License-Identifier: AGPL3.0-or-later
  */
-
 /**
  * @file consensus/gnunet-service-consensus.c
  * @brief multi-peer set reconciliation
  * @author Florian Dold <flo@dold.me>
  */
-
 #include "platform.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_block_lib.h"
@@ -848,7 +846,8 @@ diff_insert (struct DiffEntry *diff,
     di->element = GNUNET_SET_element_dup (element);
     GNUNET_assert (GNUNET_OK ==
                    GNUNET_CONTAINER_multihashmap_put (diff->changes,
-                                                      &hash, di,
+                                                      &hash,
+                                                      di,
                                                       
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
   }
 
@@ -1011,7 +1010,8 @@ set_result_cb (void *cls,
 
   if (SET_KIND_NONE != setop->output_set.set_kind)
   {
-    output_set = lookup_set (session, &setop->output_set);
+    output_set = lookup_set (session,
+                             &setop->output_set);
     GNUNET_assert (NULL != output_set);
   }
 
@@ -1396,6 +1396,7 @@ commit_set (struct ConsensusSession *session,
   {
     struct GNUNET_SET_Element element;
     struct ConsensusElement ce = { 0 };
+
     ce.marker = CONSENSUS_MARKER_CONTESTED;
     element.data = &ce;
     element.size = sizeof(struct ConsensusElement);
@@ -2192,7 +2193,9 @@ task_start_reconcile (struct TaskEntry *task)
        we clone the input set. */
     if (NULL == lookup_set (session, &setop->output_set))
     {
-      create_set_copy_for_task (task, &setop->input_set, &setop->output_set);
+      create_set_copy_for_task (task,
+                                &setop->input_set,
+                                &setop->output_set);
       return;
     }
   }
@@ -2316,7 +2319,9 @@ task_start_eval_echo (struct TaskEntry *task)
   output_set = lookup_set (session, &sk_out);
   if (NULL == output_set)
   {
-    create_set_copy_for_task (task, &sk_in, &sk_out);
+    create_set_copy_for_task (task,
+                              &sk_in,
+                              &sk_out);
     return;
   }
 
@@ -2324,6 +2329,7 @@ task_start_eval_echo (struct TaskEntry *task)
     // FIXME: should be marked as a shallow copy, so
     // we can destroy everything correctly
     struct SetEntry *last_set = GNUNET_new (struct SetEntry);
+
     last_set->h = output_set->h;
     last_set->key = (struct SetKey) { SET_KIND_LAST_GRADECAST };
     put_set (session, last_set);
@@ -2717,7 +2723,7 @@ set_listen_cb (void *cls,
   task->cls.setop.op = GNUNET_SET_accept (request,
                                           GNUNET_SET_RESULT_SYMMETRIC,
                                           opts,
-                                          set_result_cb,
+                                          &set_result_cb,
                                           task);
 
   /* If the task hasn't been started yet,
@@ -3329,13 +3335,6 @@ handle_client_join (void *cls,
 }
 
 
-static void
-client_insert_done (void *cls)
-{
-  // FIXME: implement
-}
-
-
 /**
  * Called when a client performs an insert operation.
  *
@@ -3400,8 +3399,8 @@ handle_client_insert (void *cls,
 
     GNUNET_SET_add_element (initial_set,
                             &element,
-                            &client_insert_done,
-                            session);
+                            NULL,
+                            NULL);
 #ifdef GNUNET_EXTRA_LOGGING
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "P%u: element %s added\n",
diff --git a/src/consensus/plugin_block_consensus.c 
b/src/consensus/plugin_block_consensus.c
index fb6da5bcd..cdac12ed5 100644
--- a/src/consensus/plugin_block_consensus.c
+++ b/src/consensus/plugin_block_consensus.c
@@ -58,13 +58,12 @@ block_plugin_consensus_evaluate (void *cls,
                                  const void *reply_block,
                                  size_t reply_block_size)
 {
-  if (reply_block_size < sizeof(struct ConsensusElement))
-    return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
-
   const struct ConsensusElement *ce = reply_block;
 
-  if ((0 != ce->marker) ||
-      (0 == ce->payload_type))
+  if (reply_block_size < sizeof(struct ConsensusElement))
+    return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
+  if ( (0 != ce->marker) ||
+       (0 == ce->payload_type) )
     return GNUNET_BLOCK_EVALUATION_OK_MORE;
 
   return GNUNET_BLOCK_evaluate (ctx,
@@ -75,8 +74,8 @@ block_plugin_consensus_evaluate (void *cls,
                                 xquery,
                                 xquery_size,
                                 &ce[1],
-                                reply_block_size - sizeof(struct
-                                                          ConsensusElement));
+                                reply_block_size
+                                - sizeof(struct ConsensusElement));
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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