filename, emsg);
GNUNET_free (emsg);
}
- pc->top = GNUNET_FS_make_top (h, &GNUNET_FS_publish_signal_suspend_, pc);
+ pc->top = GNUNET_FS_make_top (h,
+ &GNUNET_FS_publish_signal_suspend_,
+ pc);
return GNUNET_OK;
cleanup:
GNUNET_free_non_null (pc->nid);
GNUNET_break (0);
goto cleanup;
}
- uc->top = GNUNET_FS_make_top (h, &GNUNET_FS_unindex_signal_suspend_, uc);
+ uc->top = GNUNET_FS_make_top (h,
+ &GNUNET_FS_unindex_signal_suspend_,
+ uc);
pi.status = GNUNET_FS_STATUS_UNINDEX_RESUME;
pi.value.unindex.specifics.resume.message = uc->emsg;
GNUNET_FS_unindex_make_status_ (&pi, uc,
GNUNET_FS_compute_depth (GNUNET_FS_uri_chk_get_file_size (dc->uri));
if (GNUNET_FS_uri_test_loc (dc->uri))
GNUNET_assert (GNUNET_OK ==
- GNUNET_FS_uri_loc_get_peer_identity (dc->uri, &dc->target));
+ GNUNET_FS_uri_loc_get_peer_identity (dc->uri,
+ &dc->target));
if (NULL == dc->emsg)
{
dc->top_request = read_download_request (rh);
goto cleanup;
}
}
- dn = get_download_sync_filename (dc, dc->serialization, ".dir");
+ dn = get_download_sync_filename (dc,
+ dc->serialization,
+ ".dir");
if (NULL != dn)
{
- if (GNUNET_YES == GNUNET_DISK_directory_test (dn, GNUNET_YES))
+ if (GNUNET_YES ==
+ GNUNET_DISK_directory_test (dn,
+ GNUNET_YES))
GNUNET_DISK_directory_scan (dn,
&deserialize_subdownload,
dc);
dc->search = search;
search->download = dc;
}
- if ((NULL == parent) && (NULL == search))
+ if ( (NULL == parent) &&
+ (NULL == search) )
{
- dc->top =
- GNUNET_FS_make_top (dc->h,
+ dc->top
+ = GNUNET_FS_make_top (dc->h,
&GNUNET_FS_download_signal_suspend_,
dc);
signal_download_resume (dc);
}
GNUNET_free (uris);
- dc->task = GNUNET_SCHEDULER_add_now (&GNUNET_FS_download_start_task_,
- dc);
+ if (NULL == dc->job_queue)
+ dc->task = GNUNET_SCHEDULER_add_now (&GNUNET_FS_download_start_task_,
+ dc);
return;
cleanup:
GNUNET_free_non_null (uris);
"Will try to reconnect in %s\n",
GNUNET_STRINGS_relative_time_to_string (dc->reconnect_backoff,
GNUNET_YES));
+ GNUNET_assert (NULL == dc->job_queue);
dc->task =
GNUNET_SCHEDULER_add_delayed (dc->reconnect_backoff,
&do_reconnect,
struct GNUNET_FS_DownloadContext *dc = cls;
/* clean up state from tree encoder */
- if (dc->task != NULL)
+ if (NULL != dc->task)
{
GNUNET_SCHEDULER_cancel (dc->task);
dc->task = NULL;
* @param block_size size of block (in bytes)
*/
static void
-reconstruct_cb (void *cls, const struct ContentHashKey *chk, uint64_t offset,
- unsigned int depth, enum GNUNET_BLOCK_Type type,
- const void *block, uint16_t block_size)
+reconstruct_cb (void *cls,
+ const struct ContentHashKey *chk,
+ uint64_t offset,
+ unsigned int depth,
+ enum GNUNET_BLOCK_Type type,
+ const void *block,
+ uint16_t block_size)
{
struct GNUNET_FS_DownloadContext *dc = cls;
struct GNUNET_FS_ProgressInfo pi;
"Block %u < %u irrelevant for our range\n",
chld,
dr->children[0]->chk_idx);
- dc->task = GNUNET_SCHEDULER_add_now (&get_next_block, dc);
+ dc->task = GNUNET_SCHEDULER_add_now (&get_next_block,
+ dc);
return; /* irrelevant block */
}
if (chld > dr->children[dr->num_children-1]->chk_idx)
GNUNET_assert (0);
break;
}
- dc->task = GNUNET_SCHEDULER_add_now (&get_next_block, dc);
- if ((dr == dc->top_request) && (dr->state == BRS_DOWNLOAD_UP))
+ dc->task = GNUNET_SCHEDULER_add_now (&get_next_block,
+ dc);
+ if ( (dr == dc->top_request) &&
+ (dr->state == BRS_DOWNLOAD_UP) )
check_completed (dc);
}
&reconstruct_cb,
NULL,
&reconstruct_cont);
- dc->task = GNUNET_SCHEDULER_add_now (&get_next_block, dc);
+ dc->task = GNUNET_SCHEDULER_add_now (&get_next_block,
+ dc);
}
else
{
filename,
(unsigned long long) length,
dc->treedepth);
+ GNUNET_assert (NULL == dc->job_queue);
dc->task = GNUNET_SCHEDULER_add_now (&GNUNET_FS_download_start_task_,
dc);
return dc;
if (NULL != dc->mq)
return; /* already running */
GNUNET_assert (NULL == dc->job_queue);
+ GNUNET_assert (NULL == dc->task);
GNUNET_assert (NULL != dc->active);
dc->job_queue =
GNUNET_FS_queue_ (dc->h,
pi.status = GNUNET_FS_STATUS_DOWNLOAD_ACTIVE;
GNUNET_FS_download_make_status_ (&pi, dc);
+ GNUNET_assert (NULL == dc->task);
dc->job_queue =
GNUNET_FS_queue_ (dc->h,
&activate_fs_download,