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 | |
parent | a7fbcf1c827ea25046c9f9e5c4e2a567eba72318 (diff) | |
download | gnunet-8306257cfea6b5ca5d7cd0119b8d1369f422a07f.tar.gz gnunet-8306257cfea6b5ca5d7cd0119b8d1369f422a07f.zip |
-indent
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 3 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 11 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 35 |
3 files changed, 30 insertions, 19 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 0a4c77468..8fb2d2a3a 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -1495,7 +1495,8 @@ peer_transmit_timeout (void *cls, | |||
1495 | GNUNET_assert (0 < cp->ppd.pending_queries--); | 1495 | GNUNET_assert (0 < cp->ppd.pending_queries--); |
1496 | else if (GNUNET_NO == pth->is_query) | 1496 | else if (GNUNET_NO == pth->is_query) |
1497 | GNUNET_assert (0 < cp->ppd.pending_replies--); | 1497 | GNUNET_assert (0 < cp->ppd.pending_replies--); |
1498 | GNUNET_LOAD_update (cp->ppd.transmission_delay, UINT64_MAX); | 1498 | GNUNET_LOAD_update (cp->ppd.transmission_delay, |
1499 | UINT64_MAX); | ||
1499 | if (NULL != cp->cth) | 1500 | if (NULL != cp->cth) |
1500 | { | 1501 | { |
1501 | GNUNET_CORE_notify_transmit_ready_cancel (cp->cth); | 1502 | GNUNET_CORE_notify_transmit_ready_cancel (cp->cth); |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index a9cfefcaa..beb435c0c 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -614,10 +614,11 @@ GSF_plan_add_ (struct GSF_ConnectedPeer *cp, | |||
614 | } | 614 | } |
615 | mpc.merged = GNUNET_NO; | 615 | mpc.merged = GNUNET_NO; |
616 | mpc.pr = pr; | 616 | mpc.pr = pr; |
617 | prd = GSF_pending_request_get_data_ (pr); | ||
617 | GNUNET_CONTAINER_multihashmap_get_multiple (pp->plan_map, | 618 | GNUNET_CONTAINER_multihashmap_get_multiple (pp->plan_map, |
618 | &GSF_pending_request_get_data_ | 619 | &prd->query, |
619 | (pr)->query, | 620 | &merge_pr, |
620 | &merge_pr, &mpc); | 621 | &mpc); |
621 | if (GNUNET_NO != mpc.merged) | 622 | if (GNUNET_NO != mpc.merged) |
622 | return; | 623 | return; |
623 | plan_count++; | 624 | plan_count++; |
@@ -625,7 +626,6 @@ GSF_plan_add_ (struct GSF_ConnectedPeer *cp, | |||
625 | gettext_noop ("# query plan entries"), | 626 | gettext_noop ("# query plan entries"), |
626 | 1, | 627 | 1, |
627 | GNUNET_NO); | 628 | GNUNET_NO); |
628 | prd = GSF_pending_request_get_data_ (pr); | ||
629 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 629 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
630 | "Planning transmission of query `%s' to peer `%s'\n", | 630 | "Planning transmission of query `%s' to peer `%s'\n", |
631 | GNUNET_h2s (&prd->query), | 631 | GNUNET_h2s (&prd->query), |
@@ -648,7 +648,8 @@ GSF_plan_add_ (struct GSF_ConnectedPeer *cp, | |||
648 | get_rp_key (rp), | 648 | get_rp_key (rp), |
649 | rp, | 649 | rp, |
650 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE)); | 650 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE)); |
651 | plan (pp, rp); | 651 | plan (pp, |
652 | rp); | ||
652 | } | 653 | } |
653 | 654 | ||
654 | 655 | ||
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 |