GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
fh = NULL;
if ( (dc->old_file_size > off) &&
- (dc->filename != NULL) )
- {
- fh = GNUNET_DISK_file_open (dc->filename,
- GNUNET_DISK_OPEN_READ,
- GNUNET_DISK_PERM_NONE);
- }
+ (dc->filename != NULL) )
+ fh = GNUNET_DISK_file_open (dc->filename,
+ GNUNET_DISK_OPEN_READ,
+ GNUNET_DISK_PERM_NONE);
if ( (fh != NULL) &&
(off ==
GNUNET_DISK_file_seek (fh,
{
GNUNET_break_op (0);
}
+ GNUNET_break (GNUNET_OK == GNUNET_DISK_file_close (fh));
return;
}
}
struct GNUNET_FS_ProgressInfo pi;
GNUNET_assert (NULL != client);
+ GNUNET_assert (dc->client == NULL);
+ GNUNET_assert (dc->th == NULL);
dc->client = client;
GNUNET_CLIENT_receive (client,
&receive_results,
GNUNET_CONTAINER_multihashmap_iterate (dc->active,
&retry_entry,
dc);
- if ( (dc->th == NULL) &&
- (dc->client != NULL) )
- dc->th = GNUNET_CLIENT_notify_transmit_ready (dc->client,
- sizeof (struct SearchMessage),
- GNUNET_CONSTANTS_SERVICE_TIMEOUT,
- GNUNET_NO,
- &transmit_download_request,
- dc);
+ dc->th = GNUNET_CLIENT_notify_transmit_ready (dc->client,
+ sizeof (struct SearchMessage),
+ GNUNET_CONSTANTS_SERVICE_TIMEOUT,
+ GNUNET_NO,
+ &transmit_download_request,
+ dc);
}
"Download tree has depth %u\n",
dc->treedepth);
#endif
+ if (parent == NULL)
+ {
+ dc->top = GNUNET_FS_make_top (dc->h,
+ &GNUNET_FS_download_signal_suspend_,
+ dc);
+ }
pi.status = GNUNET_FS_STATUS_DOWNLOAD_START;
pi.value.download.specifics.start.meta = meta;
GNUNET_FS_download_make_status_ (&pi, dc);
1 /* 0 == CHK, 1 == top */);
GNUNET_FS_download_sync_ (dc);
GNUNET_FS_download_start_downloading_ (dc);
- if (parent == NULL)
- dc->top = GNUNET_FS_make_top (dc->h,
- &GNUNET_FS_download_signal_suspend_,
- dc);
-
return dc;
}
void
GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc)
{
+ GNUNET_assert (dc->job_queue == NULL);
dc->job_queue = GNUNET_FS_queue_ (dc->h,
&activate_fs_download,
&deactivate_fs_download,