From 7d85c27e9b61ac900932337c9ec6a72c6326f6fc Mon Sep 17 00:00:00 2001 From: Elias Summermatter Date: Thu, 18 Mar 2021 18:44:46 +0100 Subject: Fixed setu tests and state maschine --- src/setu/gnunet-service-setu.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c index 91a5f45a2..f6ccc94d1 100644 --- a/src/setu/gnunet-service-setu.c +++ b/src/setu/gnunet-service-setu.c @@ -2080,16 +2080,25 @@ handle_union_p2p_full_element (void *cls, uint16_t element_size; + if(PHASE_EXPECT_IBF == op->phase) { + op->phase = PHASE_FULL_RECEIVING; + } + + + /* Allow only receiving of full element message if in expect IBF or in PHASE_FULL_RECEIVING state */ - if ( (PHASE_EXPECT_IBF != op->phase) && - (PHASE_FULL_RECEIVING != op->phase) ) - { - GNUNET_break_op (0); - fail_union_operation (op); - return; - } + if ((PHASE_FULL_RECEIVING != op->phase) && + (PHASE_FULL_SENDING != op->phase)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Handle full element phase is %u\n", + (unsigned) op->phase); + GNUNET_break_op (0); + fail_union_operation (op); + return; + } + - op->phase = PHASE_FULL_RECEIVING; element_size = ntohs (emsg->header.size) - sizeof(struct GNUNET_SETU_ElementMessage); -- cgit v1.2.3