[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: Setu integrated new phase full receiving
From: |
gnunet |
Subject: |
[gnunet] branch master updated: Setu integrated new phase full receiving as described in rfc draft |
Date: |
Wed, 17 Feb 2021 18:02:00 +0100 |
This is an automated email from the git hooks/post-receive script.
elias-summermatter pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 08adc88b4 Setu integrated new phase full receiving as described in rfc
draft
08adc88b4 is described below
commit 08adc88b441694e02c3e440836e4ff9585cf3f88
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Wed Feb 17 18:00:43 2021 +0100
Setu integrated new phase full receiving as described in rfc draft
---
src/setu/gnunet-service-setu.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index 7ddece8e8..9ec482559 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -138,6 +138,12 @@ enum UnionOperationPhase
* that the local peer is missing.
*/
PHASE_FULL_SENDING,
+
+ /**
+ * Phase that receives full set first and then sends elements that are
+ * the local peer missing
+ */
+ PHASE_FULL_RECEIVING
};
@@ -1448,7 +1454,7 @@ handle_union_p2p_strata_estimator (void *cls,
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Telling other peer that we expect its full set\n");
- op->phase = PHASE_EXPECT_IBF;
+ op->phase = PHASE_FULL_RECEIVING;
ev = GNUNET_MQ_msg_header (
GNUNET_MESSAGE_TYPE_SETU_P2P_REQUEST_FULL);
GNUNET_MQ_send (op->mq,
@@ -2051,6 +2057,12 @@ check_union_p2p_full_element (void *cls,
{
struct Operation *op = cls;
+ // Allow only receiving of full element message if in expect IBF or in
PHASE_FULL_RECEIVING state
+ if ( op->phase != PHASE_EXPECT_IBF && op->phase != PHASE_FULL_RECEIVING ) {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+
(void) op;
// FIXME: check that we expect full elements here?
return GNUNET_OK;
@@ -2072,6 +2084,8 @@ handle_union_p2p_full_element (void *cls,
struct KeyEntry *ke;
uint16_t element_size;
+ op->phase = PHASE_FULL_RECEIVING;
+
element_size = ntohs (emsg->header.size)
- sizeof(struct GNUNET_SETU_ElementMessage);
ee = GNUNET_malloc (sizeof(struct ElementEntry) + element_size);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: Setu integrated new phase full receiving as described in rfc draft,
gnunet <=