diff options
author | Elias Summermatter <elias.summermatter@seccom.ch> | 2021-03-18 18:44:46 +0100 |
---|---|---|
committer | Elias Summermatter <elias.summermatter@seccom.ch> | 2021-03-18 18:44:46 +0100 |
commit | 7d85c27e9b61ac900932337c9ec6a72c6326f6fc (patch) | |
tree | 253bfe29b05f81992b6d4eb6929ce4befaa672b5 | |
parent | 8cd1e1929db7206937491100a9101022f02d7d64 (diff) | |
download | gnunet-7d85c27e9b61ac900932337c9ec6a72c6326f6fc.tar.gz gnunet-7d85c27e9b61ac900932337c9ec6a72c6326f6fc.zip |
Fixed setu tests and state maschine
-rw-r--r-- | src/setu/gnunet-service-setu.c | 25 |
1 files 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, | |||
2080 | uint16_t element_size; | 2080 | uint16_t element_size; |
2081 | 2081 | ||
2082 | 2082 | ||
2083 | if(PHASE_EXPECT_IBF == op->phase) { | ||
2084 | op->phase = PHASE_FULL_RECEIVING; | ||
2085 | } | ||
2086 | |||
2087 | |||
2088 | |||
2083 | /* Allow only receiving of full element message if in expect IBF or in PHASE_FULL_RECEIVING state */ | 2089 | /* Allow only receiving of full element message if in expect IBF or in PHASE_FULL_RECEIVING state */ |
2084 | if ( (PHASE_EXPECT_IBF != op->phase) && | 2090 | if ((PHASE_FULL_RECEIVING != op->phase) && |
2085 | (PHASE_FULL_RECEIVING != op->phase) ) | 2091 | (PHASE_FULL_SENDING != op->phase)) |
2086 | { | 2092 | { |
2087 | GNUNET_break_op (0); | 2093 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2088 | fail_union_operation (op); | 2094 | "Handle full element phase is %u\n", |
2089 | return; | 2095 | (unsigned) op->phase); |
2090 | } | 2096 | GNUNET_break_op (0); |
2097 | fail_union_operation (op); | ||
2098 | return; | ||
2099 | } | ||
2100 | |||
2091 | 2101 | ||
2092 | op->phase = PHASE_FULL_RECEIVING; | ||
2093 | 2102 | ||
2094 | element_size = ntohs (emsg->header.size) | 2103 | element_size = ntohs (emsg->header.size) |
2095 | - sizeof(struct GNUNET_SETU_ElementMessage); | 2104 | - sizeof(struct GNUNET_SETU_ElementMessage); |