aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-25 22:58:01 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-25 22:58:01 +0100
commit2b33fde2a4f976581695ba6009b0a892caf78b19 (patch)
tree1ee79fee6f1226861f49d207f96c98dbc0b5ce5a /src/fs/fs_api.c
parent8f5f7f7885237771d88cce717d508b97d79f6b6e (diff)
downloadgnunet-2b33fde2a4f976581695ba6009b0a892caf78b19.tar.gz
gnunet-2b33fde2a4f976581695ba6009b0a892caf78b19.zip
do not start download twice
Diffstat (limited to 'src/fs/fs_api.c')
-rw-r--r--src/fs/fs_api.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 7e769483b..c1ed9521b 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -1647,7 +1647,9 @@ deserialize_publish_file (void *cls,
1647 filename, emsg); 1647 filename, emsg);
1648 GNUNET_free (emsg); 1648 GNUNET_free (emsg);
1649 } 1649 }
1650 pc->top = GNUNET_FS_make_top (h, &GNUNET_FS_publish_signal_suspend_, pc); 1650 pc->top = GNUNET_FS_make_top (h,
1651 &GNUNET_FS_publish_signal_suspend_,
1652 pc);
1651 return GNUNET_OK; 1653 return GNUNET_OK;
1652cleanup: 1654cleanup:
1653 GNUNET_free_non_null (pc->nid); 1655 GNUNET_free_non_null (pc->nid);
@@ -2278,7 +2280,9 @@ deserialize_unindex_file (void *cls,
2278 GNUNET_break (0); 2280 GNUNET_break (0);
2279 goto cleanup; 2281 goto cleanup;
2280 } 2282 }
2281 uc->top = GNUNET_FS_make_top (h, &GNUNET_FS_unindex_signal_suspend_, uc); 2283 uc->top = GNUNET_FS_make_top (h,
2284 &GNUNET_FS_unindex_signal_suspend_,
2285 uc);
2282 pi.status = GNUNET_FS_STATUS_UNINDEX_RESUME; 2286 pi.status = GNUNET_FS_STATUS_UNINDEX_RESUME;
2283 pi.value.unindex.specifics.resume.message = uc->emsg; 2287 pi.value.unindex.specifics.resume.message = uc->emsg;
2284 GNUNET_FS_unindex_make_status_ (&pi, uc, 2288 GNUNET_FS_unindex_make_status_ (&pi, uc,
@@ -2806,7 +2810,8 @@ deserialize_download (struct GNUNET_FS_Handle *h,
2806 GNUNET_FS_compute_depth (GNUNET_FS_uri_chk_get_file_size (dc->uri)); 2810 GNUNET_FS_compute_depth (GNUNET_FS_uri_chk_get_file_size (dc->uri));
2807 if (GNUNET_FS_uri_test_loc (dc->uri)) 2811 if (GNUNET_FS_uri_test_loc (dc->uri))
2808 GNUNET_assert (GNUNET_OK == 2812 GNUNET_assert (GNUNET_OK ==
2809 GNUNET_FS_uri_loc_get_peer_identity (dc->uri, &dc->target)); 2813 GNUNET_FS_uri_loc_get_peer_identity (dc->uri,
2814 &dc->target));
2810 if (NULL == dc->emsg) 2815 if (NULL == dc->emsg)
2811 { 2816 {
2812 dc->top_request = read_download_request (rh); 2817 dc->top_request = read_download_request (rh);
@@ -2816,10 +2821,14 @@ deserialize_download (struct GNUNET_FS_Handle *h,
2816 goto cleanup; 2821 goto cleanup;
2817 } 2822 }
2818 } 2823 }
2819 dn = get_download_sync_filename (dc, dc->serialization, ".dir"); 2824 dn = get_download_sync_filename (dc,
2825 dc->serialization,
2826 ".dir");
2820 if (NULL != dn) 2827 if (NULL != dn)
2821 { 2828 {
2822 if (GNUNET_YES == GNUNET_DISK_directory_test (dn, GNUNET_YES)) 2829 if (GNUNET_YES ==
2830 GNUNET_DISK_directory_test (dn,
2831 GNUNET_YES))
2823 GNUNET_DISK_directory_scan (dn, 2832 GNUNET_DISK_directory_scan (dn,
2824 &deserialize_subdownload, 2833 &deserialize_subdownload,
2825 dc); 2834 dc);
@@ -2836,17 +2845,19 @@ deserialize_download (struct GNUNET_FS_Handle *h,
2836 dc->search = search; 2845 dc->search = search;
2837 search->download = dc; 2846 search->download = dc;
2838 } 2847 }
2839 if ((NULL == parent) && (NULL == search)) 2848 if ( (NULL == parent) &&
2849 (NULL == search) )
2840 { 2850 {
2841 dc->top = 2851 dc->top
2842 GNUNET_FS_make_top (dc->h, 2852 = GNUNET_FS_make_top (dc->h,
2843 &GNUNET_FS_download_signal_suspend_, 2853 &GNUNET_FS_download_signal_suspend_,
2844 dc); 2854 dc);
2845 signal_download_resume (dc); 2855 signal_download_resume (dc);
2846 } 2856 }
2847 GNUNET_free (uris); 2857 GNUNET_free (uris);
2848 dc->task = GNUNET_SCHEDULER_add_now (&GNUNET_FS_download_start_task_, 2858 if (NULL == dc->job_queue)
2849 dc); 2859 dc->task = GNUNET_SCHEDULER_add_now (&GNUNET_FS_download_start_task_,
2860 dc);
2850 return; 2861 return;
2851cleanup: 2862cleanup:
2852 GNUNET_free_non_null (uris); 2863 GNUNET_free_non_null (uris);