diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-07 19:10:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-07 19:10:51 +0000 |
commit | cd0ad4c559f9338eec2a152ded51d16e021eca06 (patch) | |
tree | 151c7e7b1483f4b50411e1fd30be1091cc7480bd /src/set | |
parent | 71c9ff44f0b1b1f6c3dc72e945644e47ab5ab921 (diff) | |
download | gnunet-cd0ad4c559f9338eec2a152ded51d16e021eca06.tar.gz gnunet-cd0ad4c559f9338eec2a152ded51d16e021eca06.zip |
-indentation and comment fixes
Diffstat (limited to 'src/set')
-rw-r--r-- | src/set/gnunet-service-set_union.c | 30 | ||||
-rw-r--r-- | src/set/set_api.c | 3 |
2 files changed, 21 insertions, 12 deletions
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index 5696f632c..2ca57ab6d 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c | |||
@@ -234,8 +234,7 @@ struct SetState | |||
234 | * @param cls closure | 234 | * @param cls closure |
235 | * @param key current key code | 235 | * @param key current key code |
236 | * @param value value in the hash map | 236 | * @param value value in the hash map |
237 | * @return #GNUNET_YES if we should continue to | 237 | * @return #GNUNET_YES if we should continue to iterate, |
238 | * iterate, | ||
239 | * #GNUNET_NO if not. | 238 | * #GNUNET_NO if not. |
240 | */ | 239 | */ |
241 | static int | 240 | static int |
@@ -546,6 +545,7 @@ prepare_ibf (struct Operation *op, | |||
546 | if (NULL == op->state->key_to_element) | 545 | if (NULL == op->state->key_to_element) |
547 | { | 546 | { |
548 | unsigned int len; | 547 | unsigned int len; |
548 | |||
549 | len = GNUNET_CONTAINER_multihashmap_size (op->spec->set->elements); | 549 | len = GNUNET_CONTAINER_multihashmap_size (op->spec->set->elements); |
550 | op->state->key_to_element = GNUNET_CONTAINER_multihashmap32_create (len + 1); | 550 | op->state->key_to_element = GNUNET_CONTAINER_multihashmap32_create (len + 1); |
551 | GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->elements, | 551 | GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->elements, |
@@ -592,8 +592,9 @@ send_ibf (struct Operation *op, | |||
592 | if (buckets_in_message > MAX_BUCKETS_PER_MESSAGE) | 592 | if (buckets_in_message > MAX_BUCKETS_PER_MESSAGE) |
593 | buckets_in_message = MAX_BUCKETS_PER_MESSAGE; | 593 | buckets_in_message = MAX_BUCKETS_PER_MESSAGE; |
594 | 594 | ||
595 | ev = GNUNET_MQ_msg_extra (msg, buckets_in_message * IBF_BUCKET_SIZE, | 595 | ev = GNUNET_MQ_msg_extra (msg, |
596 | GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF); | 596 | buckets_in_message * IBF_BUCKET_SIZE, |
597 | GNUNET_MESSAGE_TYPE_SET_UNION_P2P_IBF); | ||
597 | msg->reserved = 0; | 598 | msg->reserved = 0; |
598 | msg->order = ibf_order; | 599 | msg->order = ibf_order; |
599 | msg->offset = htons (buckets_sent); | 600 | msg->offset = htons (buckets_sent); |
@@ -627,7 +628,8 @@ send_strata_estimator (struct Operation *op) | |||
627 | SE_STRATA_COUNT * IBF_BUCKET_SIZE * SE_IBF_SIZE, | 628 | SE_STRATA_COUNT * IBF_BUCKET_SIZE * SE_IBF_SIZE, |
628 | GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SE); | 629 | GNUNET_MESSAGE_TYPE_SET_UNION_P2P_SE); |
629 | strata_estimator_write (op->state->se, &strata_msg[1]); | 630 | strata_estimator_write (op->state->se, &strata_msg[1]); |
630 | GNUNET_MQ_send (op->mq, ev); | 631 | GNUNET_MQ_send (op->mq, |
632 | ev); | ||
631 | op->state->phase = PHASE_EXPECT_IBF; | 633 | op->state->phase = PHASE_EXPECT_IBF; |
632 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 634 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
633 | "sent SE, expecting IBF\n"); | 635 | "sent SE, expecting IBF\n"); |
@@ -1065,13 +1067,15 @@ send_remaining_elements (void *cls) | |||
1065 | struct GNUNET_MQ_Envelope *ev; | 1067 | struct GNUNET_MQ_Envelope *ev; |
1066 | struct GNUNET_SET_ResultMessage *rm; | 1068 | struct GNUNET_SET_ResultMessage *rm; |
1067 | struct GNUNET_SET_Element *element; | 1069 | struct GNUNET_SET_Element *element; |
1068 | element = &ke->element->element; | ||
1069 | 1070 | ||
1071 | element = &ke->element->element; | ||
1070 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1072 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1071 | "sending element (size %u) to client (full set)\n", | 1073 | "sending element (size %u) to client (full set)\n", |
1072 | element->size); | 1074 | element->size); |
1073 | GNUNET_assert (0 != op->spec->client_request_id); | 1075 | GNUNET_assert (0 != op->spec->client_request_id); |
1074 | ev = GNUNET_MQ_msg_extra (rm, element->size, GNUNET_MESSAGE_TYPE_SET_RESULT); | 1076 | ev = GNUNET_MQ_msg_extra (rm, |
1077 | element->size, | ||
1078 | GNUNET_MESSAGE_TYPE_SET_RESULT); | ||
1075 | if (NULL == ev) | 1079 | if (NULL == ev) |
1076 | { | 1080 | { |
1077 | GNUNET_MQ_discard (ev); | 1081 | GNUNET_MQ_discard (ev); |
@@ -1280,7 +1284,8 @@ union_evaluate (struct Operation *op, | |||
1280 | } | 1284 | } |
1281 | msg->operation = htonl (GNUNET_SET_OPERATION_UNION); | 1285 | msg->operation = htonl (GNUNET_SET_OPERATION_UNION); |
1282 | msg->app_id = op->spec->app_id; | 1286 | msg->app_id = op->spec->app_id; |
1283 | GNUNET_MQ_send (op->mq, ev); | 1287 | GNUNET_MQ_send (op->mq, |
1288 | ev); | ||
1284 | 1289 | ||
1285 | if (NULL != opaque_context) | 1290 | if (NULL != opaque_context) |
1286 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1291 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1429,14 +1434,17 @@ union_peer_disconnect (struct Operation *op) | |||
1429 | struct GNUNET_MQ_Envelope *ev; | 1434 | struct GNUNET_MQ_Envelope *ev; |
1430 | struct GNUNET_SET_ResultMessage *msg; | 1435 | struct GNUNET_SET_ResultMessage *msg; |
1431 | 1436 | ||
1432 | ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_RESULT); | 1437 | ev = GNUNET_MQ_msg (msg, |
1438 | GNUNET_MESSAGE_TYPE_SET_RESULT); | ||
1433 | msg->request_id = htonl (op->spec->client_request_id); | 1439 | msg->request_id = htonl (op->spec->client_request_id); |
1434 | msg->result_status = htons (GNUNET_SET_STATUS_FAILURE); | 1440 | msg->result_status = htons (GNUNET_SET_STATUS_FAILURE); |
1435 | msg->element_type = htons (0); | 1441 | msg->element_type = htons (0); |
1436 | GNUNET_MQ_send (op->spec->set->client_mq, ev); | 1442 | GNUNET_MQ_send (op->spec->set->client_mq, |
1443 | ev); | ||
1437 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1444 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1438 | "other peer disconnected prematurely\n"); | 1445 | "other peer disconnected prematurely\n"); |
1439 | _GSS_operation_destroy (op, GNUNET_YES); | 1446 | _GSS_operation_destroy (op, |
1447 | GNUNET_YES); | ||
1440 | return; | 1448 | return; |
1441 | } | 1449 | } |
1442 | // else: the session has already been concluded | 1450 | // else: the session has already been concluded |
diff --git a/src/set/set_api.c b/src/set/set_api.c index 390d35e5f..ad46fe9db 100644 --- a/src/set/set_api.c +++ b/src/set/set_api.c | |||
@@ -324,7 +324,8 @@ handle_result (void *cls, | |||
324 | { | 324 | { |
325 | /* status is not #GNUNET_SET_STATUS_OK => there's no attached element, | 325 | /* status is not #GNUNET_SET_STATUS_OK => there's no attached element, |
326 | * and this is the last result message we get */ | 326 | * and this is the last result message we get */ |
327 | GNUNET_MQ_assoc_remove (set->mq, ntohl (msg->request_id)); | 327 | GNUNET_MQ_assoc_remove (set->mq, |
328 | ntohl (msg->request_id)); | ||
328 | GNUNET_CONTAINER_DLL_remove (set->ops_head, | 329 | GNUNET_CONTAINER_DLL_remove (set->ops_head, |
329 | set->ops_tail, | 330 | set->ops_tail, |
330 | oh); | 331 | oh); |