From 8095b1a1bc73d084d2e0e34a529ea52e17fd7355 Mon Sep 17 00:00:00 2001 From: Elias Summermatter Date: Thu, 18 Feb 2021 16:51:47 +0100 Subject: SetU move check to union --- src/setu/gnunet-service-setu.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/setu/gnunet-service-setu.c') diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c index f06e9cf9b..540628afa 100644 --- a/src/setu/gnunet-service-setu.c +++ b/src/setu/gnunet-service-setu.c @@ -2058,13 +2058,7 @@ check_union_p2p_full_element (void *cls, struct Operation *op = cls; (void) op; - /* 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); - return GNUNET_SYSERR; - } + // FIXME: check that we expect full elements here? return GNUNET_OK; } @@ -2085,6 +2079,16 @@ handle_union_p2p_full_element (void *cls, struct KeyEntry *ke; uint16_t element_size; + + /* 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; + } + op->phase = PHASE_FULL_RECEIVING; element_size = ntohs (emsg->header.size) -- cgit v1.2.3