gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: DCE, set message UUID to in


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: DCE, set message UUID to incrementing counter
Date: Sun, 05 May 2019 12:10:20 +0200

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new b84057d75 DCE, set message UUID to incrementing counter
b84057d75 is described below

commit b84057d7593651e16a161de9f2ec51f93c98589d
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun May 5 12:10:01 2019 +0200

    DCE, set message UUID to incrementing counter
---
 src/transport/gnunet-service-tng.c | 51 ++++++++++++++------------------------
 1 file changed, 19 insertions(+), 32 deletions(-)

diff --git a/src/transport/gnunet-service-tng.c 
b/src/transport/gnunet-service-tng.c
index b217c8aa9..443c7f245 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -297,18 +297,6 @@ struct AcknowledgementUUIDP
 };
 
 
-/**
- * Unique identifier we attach to a message.
- */
-struct FragmentUUIDP
-{
-  /**
-   * Unique value identifying a fragment, in NBO.
-   */
-  uint32_t uuid GNUNET_PACKED;
-};
-
-
 /**
  * Type of a nonce used for challenges.
  */
@@ -526,6 +514,16 @@ struct TransportFragmentBoxMessage
    */
   struct GNUNET_MessageHeader header;
 
+  /**
+   * Offset of this fragment in the overall message.
+   */
+  uint16_t frag_off GNUNET_PACKED;
+
+  /**
+   * Total size of the message that is being fragmented.
+   */
+  uint16_t msg_size GNUNET_PACKED;
+
   /**
    * Unique ID of this fragment (and fragment transmission!). Will
    * change even if a fragement is retransmitted to make each
@@ -540,16 +538,6 @@ struct TransportFragmentBoxMessage
    * belong to.  Must be the same for all fragments.
    */
   struct MessageUUIDP msg_uuid;
-
-  /**
-   * Offset of this fragment in the overall message.
-   */
-  uint16_t frag_off GNUNET_PACKED;
-
-  /**
-   * Total size of the message that is being fragmented.
-   */
-  uint16_t msg_size GNUNET_PACKED;
 };
 
 
@@ -1617,13 +1605,6 @@ struct ReassemblyContext
    */
   uint8_t *bitfield;
 
-  /**
-   * Task for sending ACK. We may send ACKs either because of hitting
-   * the @e extra_acks limit, or based on time and @e num_acks.  This
-   * task is for the latter case.
-   */
-  struct GNUNET_SCHEDULER_Task *ack_task;
-
   /**
    * At what time will we give up reassembly of this message?
    */
@@ -1739,6 +1720,12 @@ struct Neighbour
    */
   struct GNUNET_TIME_Absolute last_dv_learn_monotime;
 
+  /**
+   * Used to generate unique UUIDs for messages that are being
+   * fragmented.
+   */
+  uint64_t message_uuid_ctr;
+
   /**
    * Do we have the lastest value for @e last_dv_learn_monotime from
    * PEERSTORE yet, or are we still waiting for a reply of PEERSTORE?
@@ -7253,9 +7240,7 @@ set_pending_message_uuid (struct PendingMessage *pm)
 {
   if (pm->msg_uuid_set)
     return;
-  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
-                              &pm->msg_uuid,
-                              sizeof (pm->msg_uuid));
+  pm->msg_uuid.uuid = pm->target->message_uuid_ctr++;
   pm->msg_uuid_set = GNUNET_YES;
 }
 
@@ -8240,6 +8225,8 @@ handle_add_queue_message (void *cls,
   if (NULL == neighbour)
   {
     neighbour = GNUNET_new (struct Neighbour);
+    neighbour->message_uuid_ctr =
+      GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX);
     neighbour->pid = aqm->receiver;
     GNUNET_assert (GNUNET_OK ==
                    GNUNET_CONTAINER_multipeermap_put (

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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