diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-02-27 01:18:54 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-02-27 01:19:18 +0100 |
commit | 6da407ad72fdca282094ccdb5558ece9638e3bd3 (patch) | |
tree | 9b93ef7431143588be591e97f2bb0409ff4493ef /src/set/gnunet-service-set_union.c | |
parent | 3112e64ef06f71b06e9f047f2c6dd1be0941a565 (diff) | |
download | gnunet-6da407ad72fdca282094ccdb5558ece9638e3bd3.tar.gz gnunet-6da407ad72fdca282094ccdb5558ece9638e3bd3.zip |
include set size in result callback, needed by consensus
Diffstat (limited to 'src/set/gnunet-service-set_union.c')
-rw-r--r-- | src/set/gnunet-service-set_union.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index 5037b7bfd..82c45453d 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c | |||
@@ -1285,6 +1285,7 @@ send_client_element (struct Operation *op, | |||
1285 | rm->result_status = htons (status); | 1285 | rm->result_status = htons (status); |
1286 | rm->request_id = htonl (op->spec->client_request_id); | 1286 | rm->request_id = htonl (op->spec->client_request_id); |
1287 | rm->element_type = element->element_type; | 1287 | rm->element_type = element->element_type; |
1288 | rm->current_size = GNUNET_htonll (GNUNET_CONTAINER_multihashmap32_size (op->state->key_to_element)); | ||
1288 | GNUNET_memcpy (&rm[1], element->data, element->size); | 1289 | GNUNET_memcpy (&rm[1], element->data, element->size); |
1289 | GNUNET_MQ_send (op->spec->set->client_mq, ev); | 1290 | GNUNET_MQ_send (op->spec->set->client_mq, ev); |
1290 | } | 1291 | } |
@@ -1307,6 +1308,7 @@ send_done_and_destroy (void *cls) | |||
1307 | rm->request_id = htonl (op->spec->client_request_id); | 1308 | rm->request_id = htonl (op->spec->client_request_id); |
1308 | rm->result_status = htons (GNUNET_SET_STATUS_DONE); | 1309 | rm->result_status = htons (GNUNET_SET_STATUS_DONE); |
1309 | rm->element_type = htons (0); | 1310 | rm->element_type = htons (0); |
1311 | rm->current_size = GNUNET_htonll (GNUNET_CONTAINER_multihashmap32_size (op->state->key_to_element)); | ||
1310 | GNUNET_MQ_send (op->spec->set->client_mq, ev); | 1312 | GNUNET_MQ_send (op->spec->set->client_mq, ev); |
1311 | /* Will also call the union-specific cancel function. */ | 1313 | /* Will also call the union-specific cancel function. */ |
1312 | _GSS_operation_destroy (op, GNUNET_YES); | 1314 | _GSS_operation_destroy (op, GNUNET_YES); |
@@ -1969,8 +1971,8 @@ union_evaluate (struct Operation *op, | |||
1969 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1971 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1970 | "sent op request without context message\n"); | 1972 | "sent op request without context message\n"); |
1971 | 1973 | ||
1972 | op->state->initial_size = GNUNET_CONTAINER_multihashmap_size (op->spec->set->content->elements); | ||
1973 | initialize_key_to_element (op); | 1974 | initialize_key_to_element (op); |
1975 | op->state->initial_size = GNUNET_CONTAINER_multihashmap32_size (op->state->key_to_element); | ||
1974 | } | 1976 | } |
1975 | 1977 | ||
1976 | 1978 | ||
@@ -2000,8 +2002,8 @@ union_accept (struct Operation *op) | |||
2000 | op->state->se = strata_estimator_dup (op->spec->set->state->se); | 2002 | op->state->se = strata_estimator_dup (op->spec->set->state->se); |
2001 | op->state->demanded_hashes = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); | 2003 | op->state->demanded_hashes = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); |
2002 | op->state->salt_receive = op->state->salt_send = 42; | 2004 | op->state->salt_receive = op->state->salt_send = 42; |
2003 | op->state->initial_size = GNUNET_CONTAINER_multihashmap_size (op->spec->set->content->elements); | ||
2004 | initialize_key_to_element (op); | 2005 | initialize_key_to_element (op); |
2006 | op->state->initial_size = GNUNET_CONTAINER_multihashmap32_size (op->state->key_to_element); | ||
2005 | /* kick off the operation */ | 2007 | /* kick off the operation */ |
2006 | send_strata_estimator (op); | 2008 | send_strata_estimator (op); |
2007 | } | 2009 | } |