aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pr.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-10-26 00:53:32 +0000
committerChristian Grothoff <christian@grothoff.org>2015-10-26 00:53:32 +0000
commit6342157c3068d482f7f8c02b7229e80eba2c94dc (patch)
tree3c5b9f1af6637e05471ca3cfae2b268e08f00b2b /src/fs/gnunet-service-fs_pr.c
parent0cd7408a37d1daefc6394027247b10d0efaae1a3 (diff)
downloadgnunet-6342157c3068d482f7f8c02b7229e80eba2c94dc.tar.gz
gnunet-6342157c3068d482f7f8c02b7229e80eba2c94dc.zip
potential fix for #4024
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r--src/fs/gnunet-service-fs_pr.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 21b00e80e..fe3f939f9 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -628,7 +628,9 @@ clean_request (void *cls,
628 if (NULL != (cont = pr->llc_cont)) 628 if (NULL != (cont = pr->llc_cont))
629 { 629 {
630 pr->llc_cont = NULL; 630 pr->llc_cont = NULL;
631 cont (pr->llc_cont_cls, pr, pr->local_result); 631 cont (pr->llc_cont_cls,
632 pr,
633 pr->local_result);
632 } 634 }
633 GSF_plan_notify_request_done_ (pr); 635 GSF_plan_notify_request_done_ (pr);
634 GNUNET_free_non_null (pr->replies_seen); 636 GNUNET_free_non_null (pr->replies_seen);
@@ -666,7 +668,8 @@ clean_request (void *cls,
666 &pr->public_data.query, 668 &pr->public_data.query,
667 pr)); 669 pr));
668 GNUNET_STATISTICS_update (GSF_stats, 670 GNUNET_STATISTICS_update (GSF_stats,
669 gettext_noop ("# Pending requests active"), -1, 671 gettext_noop ("# Pending requests active"),
672 -1,
670 GNUNET_NO); 673 GNUNET_NO);
671 GNUNET_free (pr); 674 GNUNET_free (pr);
672 return GNUNET_YES; 675 return GNUNET_YES;
@@ -687,7 +690,7 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr,
687 690
688 if (NULL == pr_map) 691 if (NULL == pr_map)
689 return; /* already cleaned up! */ 692 return; /* already cleaned up! */
690 if (GNUNET_YES != full_cleanup) 693 if (GNUNET_NO == full_cleanup)
691 { 694 {
692 /* make request inactive (we're no longer interested in more results), 695 /* make request inactive (we're no longer interested in more results),
693 * but do NOT remove from our data-structures, we still need it there 696 * but do NOT remove from our data-structures, we still need it there
@@ -1234,10 +1237,10 @@ cadet_reply_proc (void *cls,
1234 /* retry -- without delay, as this is non-anonymous 1237 /* retry -- without delay, as this is non-anonymous
1235 and cadet/cadet connect will take some time anyway */ 1238 and cadet/cadet connect will take some time anyway */
1236 pr->cadet_request = GSF_cadet_query (pr->public_data.target, 1239 pr->cadet_request = GSF_cadet_query (pr->public_data.target,
1237 &pr->public_data.query, 1240 &pr->public_data.query,
1238 pr->public_data.type, 1241 pr->public_data.type,
1239 &cadet_reply_proc, 1242 &cadet_reply_proc,
1240 pr); 1243 pr);
1241 return; 1244 return;
1242 } 1245 }
1243 if (GNUNET_YES != 1246 if (GNUNET_YES !=
@@ -1286,10 +1289,10 @@ GSF_cadet_lookup_ (struct GSF_PendingRequest *pr)
1286 if (NULL != pr->cadet_request) 1289 if (NULL != pr->cadet_request)
1287 return; 1290 return;
1288 pr->cadet_request = GSF_cadet_query (pr->public_data.target, 1291 pr->cadet_request = GSF_cadet_query (pr->public_data.target,
1289 &pr->public_data.query, 1292 &pr->public_data.query,
1290 pr->public_data.type, 1293 pr->public_data.type,
1291 &cadet_reply_proc, 1294 &cadet_reply_proc,
1292 pr); 1295 pr);
1293} 1296}
1294 1297
1295 1298
@@ -1840,6 +1843,19 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1840 1843
1841 1844
1842/** 1845/**
1846 * Check if the given request is still active.
1847 *
1848 * @param pr pending request
1849 * @return #GNUNET_YES if the request is still active
1850 */
1851int
1852GSF_pending_request_test_active_ (struct GSF_PendingRequest *pr)
1853{
1854 return (NULL != pr->rh) ? GNUNET_YES : GNUNET_NO;
1855}
1856
1857
1858/**
1843 * Setup the subsystem. 1859 * Setup the subsystem.
1844 */ 1860 */
1845void 1861void
@@ -1868,7 +1884,9 @@ GSF_pending_request_init_ ()
1868void 1884void
1869GSF_pending_request_done_ () 1885GSF_pending_request_done_ ()
1870{ 1886{
1871 GNUNET_CONTAINER_multihashmap_iterate (pr_map, &clean_request, NULL); 1887 GNUNET_CONTAINER_multihashmap_iterate (pr_map,
1888 &clean_request,
1889 NULL);
1872 GNUNET_CONTAINER_multihashmap_destroy (pr_map); 1890 GNUNET_CONTAINER_multihashmap_destroy (pr_map);
1873 pr_map = NULL; 1891 pr_map = NULL;
1874 GNUNET_CONTAINER_heap_destroy (requests_by_expiration_heap); 1892 GNUNET_CONTAINER_heap_destroy (requests_by_expiration_heap);