X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Fgnunet-service-fs_pe.c;h=ed59c59e603e3e7d6f2066764c83bf85939decc1;hb=da712d081fd688d09a683a8faeb5c84c5c07aa9f;hp=6797a13fbd47994d3f62e1e1ad92e1eb25b81255;hpb=86d7f49fc64f0c766d4bec6b3f34879f108fc8a9;p=oweals%2Fgnunet.git diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 6797a13fb..ed59c59e6 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c @@ -24,221 +24,607 @@ * @author Christian Grothoff */ #include "platform.h" +#include "gnunet-service-fs.h" #include "gnunet-service-fs_cp.h" #include "gnunet-service-fs_pe.h" +#include "gnunet-service-fs_pr.h" + /** - * Hash map from peer identities to GNUNET_CONTAINER_Heap's with - * pending requests as entries. + * List of GSF_PendingRequests this request plan + * participates with. */ -static struct GNUNET_CONTAINER_MultiHashMap *plans; +struct PendingRequestList; /** - * Get the size of the request queue for the given peer. - * - * @param cp connected peer to query - * @return number of entries in this peer's request queue + * DLL of request plans a particular pending request is + * involved with. */ -static struct GNUNET_CONTAINER_Heap * -get_heap (const struct GSF_ConnectedPeer *cp) +struct GSF_RequestPlanReference { - struct GNUNET_CONTAINER_Heap *h; - struct GNUNET_PeerIdentity id; - GSF_connected_peer_get_identity_ (cp, &id); - return GNUNET_CONTAINER_multihashmap_get (plans, - &id.hashPubKey); -} + /** + * This is a doubly-linked list. + */ + struct GSF_RequestPlanReference *next; + + /** + * This is a doubly-linked list. + */ + struct GSF_RequestPlanReference *prev; + + /** + * Associated request plan. + */ + struct GSF_RequestPlan *rp; + + /** + * Corresponding PendingRequestList. + */ + struct PendingRequestList *prl; +}; /** - * Create a new query plan entry. - * - * @param cp peer with the entry - * @param pr request with the entry - * @param weight determines position of the entry in the cp queue, - * lower weights are earlier in the queue + * List of GSF_PendingRequests this request plan + * participates with. */ -void -GSF_plan_add_ (const struct GSF_ConnectedPeer *cp, - struct GSF_PendingRequest *pr, - GNUNET_CONTAINER_HeapCostType weight) +struct PendingRequestList { - struct GNUNET_PeerIdentity id; - struct GNUNET_CONTAINER_Heap *h; + + /** + * This is a doubly-linked list. + */ + struct PendingRequestList *next; + + /** + * This is a doubly-linked list. + */ + struct PendingRequestList *prev; + + /** + * Array of associated pending requests. + */ struct GSF_PendingRequest *pr; - GSF_connected_peer_get_identity_ (cp, &id); - h = GNUNET_CONTAINER_multihashmap_get (plans, - &id.hashPubKey); - if (NULL == h) - { - h = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); - GNUNET_CONTAINER_multihashmap_put (plans, - &id.hashPubKey, - h, - GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); - } - GNUNET_CONTAINER_heap_insert (h, - pr, - weight); -} + /** + * Corresponding GSF_RequestPlanReference. + */ + struct GSF_RequestPlanReference *rpr; + +}; /** - * Notify the plan about a peer being no longer available; - * destroy all entries associated with this peer. - * - * @param cp connected peer + * Information we keep per request per peer. This is a doubly-linked + * list (with head and tail in the 'struct GSF_PendingRequestData') + * with one entry in each heap of each 'struct PeerPlan'. Each + * entry tracks information relevant for this request and this peer. */ -void -GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp) +struct GSF_RequestPlan { - struct GNUNET_PeerIdentity id; - struct GNUNET_CONTAINER_Heap *h; - struct GSF_PendingRequest *pr; - GSF_connected_peer_get_identity_ (cp, &id); - h = GNUNET_CONTAINER_multihashmap_get (plans, - &id.hashPubKey); - GNUNET_CONTAINER_multihashmap_remove (plans, - &id.hashPubKey, - h); - GNUNET_CONTAINER_heap_destroy (h); -} + /** + * This is a doubly-linked list. + */ + struct GSF_RequestPlan *next; + + /** + * This is a doubly-linked list. + */ + struct GSF_RequestPlan *prev; + + /** + * Heap node associated with this request and this peer. + */ + struct GNUNET_CONTAINER_HeapNode *hn; + + /** + * Head of list of associated pending requests. + */ + struct PendingRequestList *prl_head; + + /** + * Tail of list of associated pending requests. + */ + struct PendingRequestList *prl_tail; + + /** + * Earliest time we'd be happy to (re)transmit this request. + */ + struct GNUNET_TIME_Absolute earliest_transmission; + + /** + * When was the last time we transmitted this request to this peer? 0 for never. + */ + struct GNUNET_TIME_Absolute last_transmission; + + /** + * Current priority for this request for this target. + */ + uint64_t priority; + + /** + * How often did we transmit this request to this peer? + */ + unsigned int transmission_counter; + +}; /** - * Closure for 'find_request'. + * Transmission plan for a peer. */ -struct FindRequestClosure +struct PeerPlan { /** - * Place to store the node that was found (NULL for none). + * Heap with pending queries (struct GSF_RequestPlan), higher weights mean higher priority. + */ + struct GNUNET_CONTAINER_Heap *priority_heap; + + /** + * Heap with pending queries (struct GSF_RequestPlan), by transmission time, lowest first. */ - struct GNUNET_CONTAINER_HeapNode *node; + struct GNUNET_CONTAINER_Heap *delay_heap; /** - * Value we're looking for + * Current transmission request handle. */ - const struct GSF_PendingRequest *pr; + struct GSF_PeerTransmitHandle *pth; + + /** + * Peer for which this is the plan. + */ + struct GSF_ConnectedPeer *cp; + + /** + * Current task for executing the plan. + */ + GNUNET_SCHEDULER_TaskIdentifier task; }; /** - * Find a heap node where the value matches the - * pending request given in the closure. + * Hash map from peer identities to PeerPlans. + */ +static struct GNUNET_CONTAINER_MultiHashMap *plans; + +/** + * Sum of all transmission counters (equals total delay for all plan entries). + */ +static unsigned long long total_delay; + +/** + * Number of plan entries. + */ +static unsigned long long plan_count; + + +/** + * Figure out when and how to transmit to the given peer. * - * @param cls the 'struct FindRequestClosure' - * @param node heap structure we're looking for on a match - * @param element the pending request stored in the heap - * @param cost weight of the request - * @return GNUNET_YES to continue looking + * @param cls the 'struct GSF_ConnectedPeer' for transmission + * @param tc scheduler context */ -static int -find_request (void *cls, - struct GNUNET_CONTAINER_HeapNode *node, - void *element, - GNUNET_CONTAINER_HeapCostType cost) +static void +schedule_peer_transmission (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); + + +/** + * Insert the given request plan into the heap with the appropriate weight. + * + * @param pp associated peer's plan + * @param rp request to plan + */ +static void +plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp) { - struct FindRequestClosure *frc = cls; - struct GSF_PendingRequest *pr = element; + struct GSF_PendingRequestData *prd; + struct GNUNET_TIME_Relative delay; + + GNUNET_STATISTICS_set (GSF_stats, + gettext_noop ("# average retransmission delay (ms)"), + total_delay * 1000LL / plan_count, GNUNET_NO); + prd = GSF_pending_request_get_data_ (rp->prl_head->pr); + // FIXME: calculate 'rp->priority'! + if (rp->transmission_counter < 32) + delay = + GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, + 1LL << rp->transmission_counter); + else + delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, UINT_MAX); + rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay); +#if DEBUG_FS + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Earliest (re)transmission for `%s' in %us\n", + GNUNET_h2s (&prd->query), rp->transmission_counter); +#endif + + GNUNET_assert (rp->hn == NULL); + if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value + == 0) + rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); + else + rp->hn = + GNUNET_CONTAINER_heap_insert (pp->delay_heap, rp, + rp->earliest_transmission.abs_value); + if (GNUNET_SCHEDULER_NO_TASK != pp->task) + GNUNET_SCHEDULER_cancel (pp->task); + pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp); +} - if (pr == frc->pr) - { - frc->node = node; - return GNUNET_NO; - } - return GNUNET_YES; + +/** + * Get the pending request with the highest TTL from the given plan. + * + * @param rp plan to investigate + * @return pending request with highest TTL + */ +struct GSF_PendingRequest * +get_latest (const struct GSF_RequestPlan *rp) +{ + struct GSF_PendingRequest *ret; + struct PendingRequestList *prl; + + prl = rp->prl_head; + ret = prl->pr; + prl = prl->next; + while (NULL != prl) + { + if (GSF_pending_request_get_data_ (prl->pr)->ttl.abs_value > + GSF_pending_request_get_data_ (ret)->ttl.abs_value) + ret = prl->pr; + prl = prl->next; + } + return ret; } /** - * Remove the given request from all heaps. * + * Function called to get a message for transmission. * - * @param cls 'struct GSF_PendingRequest' to purge - * @param key identity of the peer we're currently looking at (unused) - * @param value request heap for the given peer to search for the 'cls' - * @return GNUNET_OK (continue iteration) + * @param cls closure + * @param buf_size number of bytes available in buf + * @param buf where to copy the message, NULL on error (peer disconnect) + * @return number of bytes copied to 'buf', can be 0 (without indicating an error) */ -static int -remove_request (void *cls, - const GNUNET_HashCode *key, - void *value) +static size_t +transmit_message_callback (void *cls, size_t buf_size, void *buf) { - const struct GSF_PendingRequest *pr = cls; - struct GNUNET_CONTAINER_Heap *h = value; - struct FindRequestClosure frc; + struct PeerPlan *pp = cls; + struct GSF_RequestPlan *rp; + size_t msize; + + pp->pth = NULL; + if (NULL == buf) + { + /* failed, try again... */ + pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp); + return 0; + } + rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap); + if (NULL == rp) + { + pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp); + return 0; + } + msize = GSF_pending_request_get_message_ (get_latest (rp), buf_size, buf); + if (msize > buf_size) + { + /* buffer to small (message changed), try again */ + pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp); + return 0; + } + /* remove from root, add again elsewhere... */ + GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->priority_heap)); + rp->hn = NULL; + rp->last_transmission = GNUNET_TIME_absolute_get (); + rp->transmission_counter++; + total_delay++; +#if DEBUG_FS + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Executing plan %p executed %u times, planning retransmission\n", + rp, rp->transmission_counter); +#endif + plan (pp, rp); + GNUNET_STATISTICS_update (GSF_stats, + gettext_noop + ("# queries messages sent to other peers"), 1, + GNUNET_NO); + return msize; +} + - frc.pr = pr; - do +/** + * Figure out when and how to transmit to the given peer. + * + * @param cls the 'struct PeerPlan' + * @param tc scheduler context + */ +static void +schedule_peer_transmission (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc) +{ + struct PeerPlan *pp = cls; + struct GSF_RequestPlan *rp; + size_t msize; + + pp->task = GNUNET_SCHEDULER_NO_TASK; + if (pp->pth != NULL) + { + GSF_peer_transmit_cancel_ (pp->pth); + pp->pth = NULL; + } + /* move ready requests to priority queue */ + while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && + (GNUNET_TIME_absolute_get_remaining + (rp->earliest_transmission).rel_value == 0)) + { + GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap)); + rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); + } + if (0 == GNUNET_CONTAINER_heap_get_size (pp->priority_heap)) + { + /* priority heap (still) empty, check for delay... */ + rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap); + if (NULL == rp) { - frc.node = NULL; - GNUNET_CONTAINER_heap_iterate (h, &find_request, &frc); - if (frc.node != NULL) - GNUNET_CONTAINER_heap_remove_node (h, frc.node); +#if DEBUG_FS + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No active requests for plan %p.\n", + pp); +#endif + return; /* both queues empty */ } - while (NULL != frc.node); - return GNUNET_OK; +#if DEBUG_FS + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Sleeping for %llu ms before retrying requests on plan %p.\n", + (unsigned long long) + GNUNET_TIME_absolute_get_remaining + (rp->earliest_transmission).rel_value, pp); +#endif + pp->task = + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining + (rp->earliest_transmission), + &schedule_peer_transmission, pp); + return; + } + /* process from priority heap */ + rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap); +#if DEBUG_FS > 1 + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Executing query plan %p\n", rp); +#endif + GNUNET_assert (NULL != rp); + msize = GSF_pending_request_get_message_ (get_latest (rp), 0, NULL); + pp->pth = + GSF_peer_transmit_ (pp->cp, GNUNET_YES, rp->priority, + GNUNET_TIME_UNIT_FOREVER_REL, msize, + &transmit_message_callback, pp); + GNUNET_assert (NULL != pp->pth); } /** - * Notify the plan about a request being done; destroy all entries - * associated with this request. Note that this implementation is - * currently terribly inefficient (O(n)) and could instead be done in - * O(1). But for now, I first want to see it work correctly... + * Closure for 'merge_pr'. + */ +struct MergeContext +{ + + struct GSF_PendingRequest *pr; + + int merged; + +}; + + +/** + * Iterator that checks if an equivalent request is already + * present for this peer. * - * @param pr request that is done + * @param cls closure + * @param node internal node of the heap (ignored) + * @param element request plan stored at the node + * @param cost cost associated with the node (ignored) + * @return GNUNET_YES if we should continue to iterate, + * GNUNET_NO if not (merge success) */ -void -GSF_plan_notify_request_done_ (const struct GSF_PendingRequest *pr) +static int +merge_pr (void *cls, struct GNUNET_CONTAINER_HeapNode *node, void *element, + GNUNET_CONTAINER_HeapCostType cost) { - GNUNET_CONTAINER_multihashmap_iterate (plans, - &remove_request, - (void*) pr); + struct MergeContext *mpr = cls; + struct GSF_RequestPlan *rp = element; + struct GSF_PendingRequestData *prd; + struct GSF_RequestPlanReference *rpr; + struct PendingRequestList *prl; + struct GSF_PendingRequest *latest; + + if (GNUNET_OK != + GSF_pending_request_is_compatible_ (mpr->pr, rp->prl_head->pr)) + return GNUNET_YES; + /* merge new request with existing request plan */ + rpr = GNUNET_malloc (sizeof (struct GSF_RequestPlanReference)); + prl = GNUNET_malloc (sizeof (struct PendingRequestList)); + rpr->rp = rp; + rpr->prl = prl; + prl->rpr = rpr; + prl->pr = mpr->pr; + prd = GSF_pending_request_get_data_ (mpr->pr); + GNUNET_CONTAINER_DLL_insert (prd->rpr_head, prd->rpr_tail, rpr); + GNUNET_CONTAINER_DLL_insert (rp->prl_head, rp->prl_tail, prl); + mpr->merged = GNUNET_YES; + GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# requests merged"), 1, + GNUNET_NO); + latest = get_latest (rp); + if (GSF_pending_request_get_data_ (latest)->ttl.abs_value < + prd->ttl.abs_value) + { + GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# requests refreshed"), + 1, GNUNET_NO); + rp->transmission_counter = 0; /* reset */ + } + return GNUNET_NO; } /** - * Get the lowest-weight entry for the respective peer - * from the plan. Removes the entry from the plan's queue. + * Create a new query plan entry. * - * @param cp connected peer to query for the next request - * @return NULL if the queue for this peer is empty + * @param cp peer with the entry + * @param pr request with the entry */ -struct GSF_PendingRequest * -GSF_plan_get_ (const struct GSF_ConnectedPeer *cp) +void +GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr) { - struct GNUNET_CONTAINER_Heap *h; - struct GSF_PendingRequest *pr; - - h = get_heap (cp); - if (NULL == h) - return NULL; - return GNUNET_CONTAINER_heap_remove_root (h); + struct GNUNET_PeerIdentity id; + struct PeerPlan *pp; + struct GSF_PendingRequestData *prd; + struct GSF_RequestPlan *rp; + struct GSF_RequestPlanReference *rpr; + struct PendingRequestList *prl; + struct MergeContext mpc; + + GNUNET_assert (NULL != cp); + GSF_connected_peer_get_identity_ (cp, &id); + pp = GNUNET_CONTAINER_multihashmap_get (plans, &id.hashPubKey); + if (NULL == pp) + { + pp = GNUNET_malloc (sizeof (struct PeerPlan)); + pp->priority_heap = + GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MAX); + pp->delay_heap = + GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); + pp->cp = cp; + GNUNET_CONTAINER_multihashmap_put (plans, &id.hashPubKey, pp, + GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); + } + mpc.merged = GNUNET_NO; + mpc.pr = pr; + /* FIXME: O(n) call here, LRN reports this is a performance + problem. Try using hash map!? */ + GNUNET_CONTAINER_heap_iterate (pp->priority_heap, &merge_pr, &mpc); + if (mpc.merged != GNUNET_NO) + return; + GNUNET_CONTAINER_heap_iterate (pp->delay_heap, &merge_pr, &mpc); + if (mpc.merged != GNUNET_NO) + return; + plan_count++; + GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# query plan entries"), 1, + GNUNET_NO); + prd = GSF_pending_request_get_data_ (pr); +#if DEBUG_FS + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Planning transmission of query `%s' to peer `%s'\n", + GNUNET_h2s (&prd->query), GNUNET_i2s (&id)); +#endif + rp = GNUNET_malloc (sizeof (struct GSF_RequestPlan)); + rpr = GNUNET_malloc (sizeof (struct GSF_RequestPlanReference)); + prl = GNUNET_malloc (sizeof (struct PendingRequestList)); + rpr->rp = rp; + rpr->prl = prl; + prl->rpr = rpr; + prl->pr = pr; + GNUNET_CONTAINER_DLL_insert (prd->rpr_head, prd->rpr_tail, rpr); + GNUNET_CONTAINER_DLL_insert (rp->prl_head, rp->prl_tail, prl); + plan (pp, rp); } /** - * Get the size of the request queue for the given peer. + * Notify the plan about a peer being no longer available; + * destroy all entries associated with this peer. * - * @param cp connected peer to query - * @return number of entries in this peer's request queue + * @param cp connected peer */ -unsigned int -GSF_plan_size_ (const struct GSF_ConnectedPeer *cp) +void +GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp) { - struct GNUNET_CONTAINER_Heap *h; + struct GNUNET_PeerIdentity id; + struct PeerPlan *pp; + struct GSF_RequestPlan *rp; + struct GSF_PendingRequestData *prd; + struct PendingRequestList *prl; - h = get_heap (cp); - if (NULL == h) - return 0; - return GNUNET_CONTAINER_heap_get_size (h); + GSF_connected_peer_get_identity_ (cp, &id); + pp = GNUNET_CONTAINER_multihashmap_get (plans, &id.hashPubKey); + if (NULL == pp) + return; /* nothing was ever planned for this peer */ + GNUNET_assert (GNUNET_YES == + GNUNET_CONTAINER_multihashmap_remove (plans, &id.hashPubKey, + pp)); + if (NULL != pp->pth) + GSF_peer_transmit_cancel_ (pp->pth); + if (GNUNET_SCHEDULER_NO_TASK != pp->task) + { + GNUNET_SCHEDULER_cancel (pp->task); + pp->task = GNUNET_SCHEDULER_NO_TASK; + } + while (NULL != (rp = GNUNET_CONTAINER_heap_remove_root (pp->priority_heap))) + { + while (NULL != (prl = rp->prl_head)) + { + GNUNET_CONTAINER_DLL_remove (rp->prl_head, rp->prl_tail, prl); + prd = GSF_pending_request_get_data_ (prl->pr); + GNUNET_CONTAINER_DLL_remove (prd->rpr_head, prd->rpr_tail, prl->rpr); + GNUNET_free (prl->rpr); + GNUNET_free (prl); + } + GNUNET_free (rp); + } + GNUNET_CONTAINER_heap_destroy (pp->priority_heap); + while (NULL != (rp = GNUNET_CONTAINER_heap_remove_root (pp->delay_heap))) + { + while (NULL != (prl = rp->prl_head)) + { + GNUNET_CONTAINER_DLL_remove (rp->prl_head, rp->prl_tail, prl); + prd = GSF_pending_request_get_data_ (prl->pr); + GNUNET_CONTAINER_DLL_remove (prd->rpr_head, prd->rpr_tail, prl->rpr); + GNUNET_free (prl->rpr); + GNUNET_free (prl); + } + GNUNET_free (rp); + } + GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# query plan entries"), + plan_count, GNUNET_NO); + + GNUNET_CONTAINER_heap_destroy (pp->delay_heap); + GNUNET_free (pp); } +/** + * Notify the plan about a request being done; destroy all entries + * associated with this request. + * + * @param pr request that is done + */ +void +GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr) +{ + struct GSF_RequestPlan *rp; + struct GSF_PendingRequestData *prd; + struct GSF_RequestPlanReference *rpr; + + prd = GSF_pending_request_get_data_ (pr); + while (NULL != (rpr = prd->rpr_head)) + { + GNUNET_CONTAINER_DLL_remove (prd->rpr_head, prd->rpr_tail, rpr); + rp = rpr->rp; + GNUNET_CONTAINER_DLL_remove (rp->prl_head, rp->prl_tail, rpr->prl); + GNUNET_free (rpr->prl); + GNUNET_free (rpr); + if (rp->prl_head == 0) + { + GNUNET_CONTAINER_heap_remove_node (rp->hn); + plan_count--; + GNUNET_free (rp); + } + } + GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# query plan entries"), + plan_count, GNUNET_NO); +} + /** * Initialize plan subsystem. @@ -256,8 +642,7 @@ GSF_plan_init () void GSF_plan_done () { - GNUNET_assert (0 == - GNUNET_CONTAINER_multihashmap_get_size (plans)); + GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (plans)); GNUNET_CONTAINER_multihashmap_destroy (plans); }