diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-25 23:09:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-25 23:09:35 +0000 |
commit | 8306257cfea6b5ca5d7cd0119b8d1369f422a07f (patch) | |
tree | b03ed2088d0c63cbef168c32541d6b003d39d01d /src/fs/gnunet-service-fs_pr.c | |
parent | a7fbcf1c827ea25046c9f9e5c4e2a567eba72318 (diff) | |
download | gnunet-8306257cfea6b5ca5d7cd0119b8d1369f422a07f.tar.gz gnunet-8306257cfea6b5ca5d7cd0119b8d1369f422a07f.zip |
-indent
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 187687f17..298532520 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -431,7 +431,6 @@ GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, | |||
431 | } | 431 | } |
432 | 432 | ||
433 | 433 | ||
434 | |||
435 | /** | 434 | /** |
436 | * Update a given pending request with additional replies | 435 | * Update a given pending request with additional replies |
437 | * that have been seen. | 436 | * that have been seen. |
@@ -468,17 +467,22 @@ GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | |||
468 | /* we're not the initiator, but the initiator did not give us | 467 | /* we're not the initiator, but the initiator did not give us |
469 | * any bloom-filter, so we need to create one on-the-fly */ | 468 | * any bloom-filter, so we need to create one on-the-fly */ |
470 | pr->mingle = | 469 | pr->mingle = |
471 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX); | 470 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, |
471 | UINT32_MAX); | ||
472 | pr->bf = | 472 | pr->bf = |
473 | GNUNET_BLOCK_construct_bloomfilter (pr->mingle, replies_seen, | 473 | GNUNET_BLOCK_construct_bloomfilter (pr->mingle, |
474 | replies_seen, | ||
474 | replies_seen_count); | 475 | replies_seen_count); |
475 | } | 476 | } |
476 | else | 477 | else |
477 | { | 478 | { |
478 | for (i = 0; i < pr->replies_seen_count; i++) | 479 | for (i = 0; i < pr->replies_seen_count; i++) |
479 | { | 480 | { |
480 | GNUNET_BLOCK_mingle_hash (&replies_seen[i], pr->mingle, &mhash); | 481 | GNUNET_BLOCK_mingle_hash (&replies_seen[i], |
481 | GNUNET_CONTAINER_bloomfilter_add (pr->bf, &mhash); | 482 | pr->mingle, |
483 | &mhash); | ||
484 | GNUNET_CONTAINER_bloomfilter_add (pr->bf, | ||
485 | &mhash); | ||
482 | } | 486 | } |
483 | } | 487 | } |
484 | } | 488 | } |
@@ -517,7 +521,8 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
517 | if (buf_size > 0) | 521 | if (buf_size > 0) |
518 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 522 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
519 | "Building request message for `%s' of type %d\n", | 523 | "Building request message for `%s' of type %d\n", |
520 | GNUNET_h2s (&pr->public_data.query), pr->public_data.type); | 524 | GNUNET_h2s (&pr->public_data.query), |
525 | pr->public_data.type); | ||
521 | k = 0; | 526 | k = 0; |
522 | bm = 0; | 527 | bm = 0; |
523 | do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY)); | 528 | do_route = (0 == (pr->public_data.options & GSF_PRO_FORWARD_ONLY)); |
@@ -587,7 +592,9 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
587 | * @return #GNUNET_YES (we should continue to iterate) | 592 | * @return #GNUNET_YES (we should continue to iterate) |
588 | */ | 593 | */ |
589 | static int | 594 | static int |
590 | clean_request (void *cls, const struct GNUNET_HashCode *key, void *value) | 595 | clean_request (void *cls, |
596 | const struct GNUNET_HashCode *key, | ||
597 | void *value) | ||
591 | { | 598 | { |
592 | struct GSF_PendingRequest *pr = value; | 599 | struct GSF_PendingRequest *pr = value; |
593 | GSF_LocalLookupContinuation cont; | 600 | GSF_LocalLookupContinuation cont; |
@@ -711,7 +718,7 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, | |||
711 | * Iterate over all pending requests. | 718 | * Iterate over all pending requests. |
712 | * | 719 | * |
713 | * @param it function to call for each request | 720 | * @param it function to call for each request |
714 | * @param cls closure for it | 721 | * @param cls closure for @a it |
715 | */ | 722 | */ |
716 | void | 723 | void |
717 | GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls) | 724 | GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls) |
@@ -1272,11 +1279,12 @@ GSF_cadet_lookup_ (struct GSF_PendingRequest *pr) | |||
1272 | /** | 1279 | /** |
1273 | * Task that issues a warning if the datastore lookup takes too long. | 1280 | * Task that issues a warning if the datastore lookup takes too long. |
1274 | * | 1281 | * |
1275 | * @param cls the 'struct GSF_PendingRequest' | 1282 | * @param cls the `struct GSF_PendingRequest` |
1276 | * @param tc task context | 1283 | * @param tc task context |
1277 | */ | 1284 | */ |
1278 | static void | 1285 | static void |
1279 | warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1286 | warn_delay_task (void *cls, |
1287 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1280 | { | 1288 | { |
1281 | struct GSF_PendingRequest *pr = cls; | 1289 | struct GSF_PendingRequest *pr = cls; |
1282 | 1290 | ||
@@ -1294,11 +1302,12 @@ warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1294 | /** | 1302 | /** |
1295 | * Task that issues a warning if the datastore lookup takes too long. | 1303 | * Task that issues a warning if the datastore lookup takes too long. |
1296 | * | 1304 | * |
1297 | * @param cls the 'struct GSF_PendingRequest' | 1305 | * @param cls the `struct GSF_PendingRequest` |
1298 | * @param tc task context | 1306 | * @param tc task context |
1299 | */ | 1307 | */ |
1300 | static void | 1308 | static void |
1301 | odc_warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1309 | odc_warn_delay_task (void *cls, |
1310 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1302 | { | 1311 | { |
1303 | struct GSF_PendingRequest *pr = cls; | 1312 | struct GSF_PendingRequest *pr = cls; |
1304 | 1313 | ||
@@ -1489,7 +1498,7 @@ process_local_reply (void *cls, | |||
1489 | /* max queue size */ , | 1498 | /* max queue size */ , |
1490 | GNUNET_TIME_UNIT_FOREVER_REL, | 1499 | GNUNET_TIME_UNIT_FOREVER_REL, |
1491 | &process_local_reply, pr); | 1500 | &process_local_reply, pr); |
1492 | if (pr->qe == NULL) | 1501 | if (NULL == pr->qe) |
1493 | { | 1502 | { |
1494 | GNUNET_STATISTICS_update (GSF_stats, | 1503 | GNUNET_STATISTICS_update (GSF_stats, |
1495 | gettext_noop | 1504 | gettext_noop |