aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pr.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-02-15 14:01:44 +0000
committerChristian Grothoff <christian@grothoff.org>2011-02-15 14:01:44 +0000
commit0ad72d359ab3ea5f232f4a8a0eb04700e8c84b49 (patch)
tree6a08051f08ff896ed9d61e80c8b74a1d282f8539 /src/fs/gnunet-service-fs_pr.c
parente3d12cb6fa5ddfb181dcade2e06888619f384457 (diff)
downloadgnunet-0ad72d359ab3ea5f232f4a8a0eb04700e8c84b49.tar.gz
gnunet-0ad72d359ab3ea5f232f4a8a0eb04700e8c84b49.zip
stuff
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r--src/fs/gnunet-service-fs_pr.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index d2248989f..4dc00f54c 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -615,7 +615,6 @@ update_request_performance_data (struct ProcessReplyClosure *prq,
615} 615}
616 616
617 617
618
619/** 618/**
620 * We have received a reply; handle it! 619 * We have received a reply; handle it!
621 * 620 *
@@ -663,30 +662,13 @@ process_reply (void *cls,
663 break; 662 break;
664 case GNUNET_BLOCK_EVALUATION_OK_LAST: 663 case GNUNET_BLOCK_EVALUATION_OK_LAST:
665 update_request_performance_data (prq, pr); 664 update_request_performance_data (prq, pr);
666 /* FIXME: adapt code to new API! */
667 while (NULL != pr->pending_head)
668 destroy_pending_message_list_entry (pr->pending_head);
669 if (pr->qe != NULL)
670 {
671 if (pr->client_request_list != NULL)
672 GNUNET_SERVER_receive_done (pr->client_request_list->client_list->client,
673 GNUNET_YES);
674 GNUNET_DATASTORE_cancel (pr->qe);
675 pr->qe = NULL;
676 }
677 pr->do_remove = GNUNET_YES;
678 if (pr->task != GNUNET_SCHEDULER_NO_TASK)
679 {
680 GNUNET_SCHEDULER_cancel (pr->task);
681 pr->task = GNUNET_SCHEDULER_NO_TASK;
682 }
683 GNUNET_break (GNUNET_YES ==
684 GNUNET_CONTAINER_multihashmap_remove (query_request_map,
685 key,
686 pr));
687 GNUNET_LOAD_update (rt_entry_lifetime, 665 GNUNET_LOAD_update (rt_entry_lifetime,
688 GNUNET_TIME_absolute_get_duration (pr->start_time).rel_value); 666 GNUNET_TIME_absolute_get_duration (pr->start_time).rel_value);
689 break; 667 /* pass on to other peers / local clients */
668 pr->rh (pr->rh_cls, pr, prq->data, prq->size, GNUNET_NO);
669 /* destroy request, we're done */
670 GSF_pending_request_cancel_ (pr);
671 return GNUNET_YES;
690 case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: 672 case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
691 GNUNET_STATISTICS_update (stats, 673 GNUNET_STATISTICS_update (stats,
692 gettext_noop ("# duplicate replies discarded (bloomfilter)"), 674 gettext_noop ("# duplicate replies discarded (bloomfilter)"),
@@ -741,7 +723,7 @@ process_reply (void *cls,
741 pr->results_found++; 723 pr->results_found++;
742 prq->request_found = GNUNET_YES; 724 prq->request_found = GNUNET_YES;
743 /* finally, pass on to other peers / local clients */ 725 /* finally, pass on to other peers / local clients */
744 pr->rh (pr->rh_cls, pr, prq->data, prq->size); 726 pr->rh (pr->rh_cls, pr, prq->data, prq->size, GNUNET_YES);
745 return GNUNET_YES; 727 return GNUNET_YES;
746} 728}
747 729
@@ -975,6 +957,7 @@ void
975GSF_pending_request_init_ () 957GSF_pending_request_init_ ()
976{ 958{
977 pr_map = GNUNET_CONTAINER_multihashmap_create (32 * 1024); 959 pr_map = GNUNET_CONTAINER_multihashmap_create (32 * 1024);
960 requests_by_expiration_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
978} 961}
979 962
980 963
@@ -989,6 +972,8 @@ GSF_pending_request_done_ ()
989 NULL); 972 NULL);
990 GNUNET_CONTAINER_multihashmap_destroy (pr_map); 973 GNUNET_CONTAINER_multihashmap_destroy (pr_map);
991 pr_map = NULL; 974 pr_map = NULL;
975 GNUNET_CONTAINER_heap_destroy (requests_by_expiration_heap);
976 requests_by_expiration_heap = NULL;
992} 977}
993 978
994 979