diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-10-17 14:59:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-10-17 14:59:27 +0000 |
commit | 731a1206abe078241f75ecf7cb77f47a80324f16 (patch) | |
tree | 0d47b57644616fa212c4a39cc3e5becff5d4481f /src/fs/gnunet-service-fs_pe.c | |
parent | 9b0ff6f40e7cf7992eeace8b38f7db23addcdb3f (diff) | |
download | gnunet-731a1206abe078241f75ecf7cb77f47a80324f16.tar.gz gnunet-731a1206abe078241f75ecf7cb77f47a80324f16.zip |
-fixing plan_map over-eager interning as reported by mwachs
Diffstat (limited to 'src/fs/gnunet-service-fs_pe.c')
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 6a82720de..1c058eefa 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -220,6 +220,12 @@ static unsigned long long plan_count; | |||
220 | 220 | ||
221 | /** | 221 | /** |
222 | * Return the query (key in the plan_map) for the given request plan. | 222 | * Return the query (key in the plan_map) for the given request plan. |
223 | * Note that this key may change as there can be multiple pending | ||
224 | * requests for the same key and we just return _one_ of them; this | ||
225 | * particular one might complete while another one might still be | ||
226 | * active, hence the lifetime of the returned hash code is NOT | ||
227 | * necessarily identical to that of the 'struct GSF_RequestPlan' | ||
228 | * given. | ||
223 | * | 229 | * |
224 | * @param rp a request plan | 230 | * @param rp a request plan |
225 | * @return the associated query | 231 | * @return the associated query |
@@ -572,7 +578,7 @@ GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr) | |||
572 | if (NULL == pp) | 578 | if (NULL == pp) |
573 | { | 579 | { |
574 | pp = GNUNET_malloc (sizeof (struct PeerPlan)); | 580 | pp = GNUNET_malloc (sizeof (struct PeerPlan)); |
575 | pp->plan_map = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_YES); | 581 | pp->plan_map = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); |
576 | pp->priority_heap = | 582 | pp->priority_heap = |
577 | GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MAX); | 583 | GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MAX); |
578 | pp->delay_heap = | 584 | pp->delay_heap = |
@@ -742,8 +748,7 @@ GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr) | |||
742 | plan_count--; | 748 | plan_count--; |
743 | GNUNET_break (GNUNET_YES == | 749 | GNUNET_break (GNUNET_YES == |
744 | GNUNET_CONTAINER_multihashmap_remove (rp->pp->plan_map, | 750 | GNUNET_CONTAINER_multihashmap_remove (rp->pp->plan_map, |
745 | &GSF_pending_request_get_data_ | 751 | get_rp_key (rp), |
746 | (rpr->prl->pr)->query, | ||
747 | rp)); | 752 | rp)); |
748 | GNUNET_free (rp); | 753 | GNUNET_free (rp); |
749 | } | 754 | } |