static void
start_job (struct GNUNET_FS_QueueEntry *qe)
{
- qe->client = GNUNET_CLIENT_connect (qe->h->sched, "fs", qe->h->cfg);
+ qe->client = GNUNET_CLIENT_connect ("fs", qe->h->cfg);
if (qe->client == NULL)
{
GNUNET_break (0);
run_time);
rst = GNUNET_TIME_absolute_get_remaining (end_time);
restart_at = GNUNET_TIME_relative_min (rst, restart_at);
- if (rst.value > 0)
+ if (rst.rel_value > 0)
continue;
stop_job (qe);
}
- h->queue_job = GNUNET_SCHEDULER_add_delayed (h->sched,
- restart_at,
+ h->queue_job = GNUNET_SCHEDULER_add_delayed (restart_at,
&process_job_queue,
h);
}
h->pending_tail,
qe);
if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
- GNUNET_SCHEDULER_cancel (h->sched,
- h->queue_job);
+ GNUNET_SCHEDULER_cancel (h->queue_job);
h->queue_job
- = GNUNET_SCHEDULER_add_now (h->sched,
- &process_job_queue,
+ = GNUNET_SCHEDULER_add_now (&process_job_queue,
h);
return qe;
}
qh);
GNUNET_free (qh);
if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
- GNUNET_SCHEDULER_cancel (h->sched,
- h->queue_job);
+ GNUNET_SCHEDULER_cancel (h->queue_job);
h->queue_job
- = GNUNET_SCHEDULER_add_now (h->sched,
- &process_job_queue,
+ = GNUNET_SCHEDULER_add_now (&process_job_queue,
h);
}
struct GNUNET_TIME_Relative dur;
dur = GNUNET_TIME_absolute_get_duration (timestamp);
- return GNUNET_BIO_write_int64 (wh, dur.value);
+ return GNUNET_BIO_write_int64 (wh, dur.rel_value);
}
{
struct GNUNET_TIME_Relative dur;
if (GNUNET_OK !=
- GNUNET_BIO_read_int64 (rh, &dur.value))
+ GNUNET_BIO_read_int64 (rh, &dur.rel_value))
return GNUNET_SYSERR;
*timestamp = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get (),
dur);
(GNUNET_YES !=
GNUNET_FS_uri_test_chk (ret->chk_uri)) ) ) ||
(GNUNET_OK !=
- GNUNET_BIO_read_int64 (rh, &ret->expirationTime.value)) ||
+ GNUNET_BIO_read_int64 (rh, &ret->expirationTime.abs_value)) ||
(GNUNET_OK !=
read_start_time (rh, &ret->start_time)) ||
(GNUNET_OK !=
(GNUNET_OK !=
GNUNET_BIO_write_string (wh, chks)) ||
(GNUNET_OK !=
- GNUNET_BIO_write_int64 (wh, fi->expirationTime.value)) ||
+ GNUNET_BIO_write_int64 (wh, fi->expirationTime.abs_value)) ||
(GNUNET_OK !=
write_start_time (wh, fi->start_time)) ||
(GNUNET_OK !=
if ( (0 == (pc->options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) &&
(GNUNET_YES != pc->all_done) )
{
- pc->dsh = GNUNET_DATASTORE_connect (h->cfg,
- h->sched);
+ pc->dsh = GNUNET_DATASTORE_connect (h->cfg);
if (NULL == pc->dsh)
goto cleanup;
}
/* re-start publishing (if needed)... */
if (pc->all_done != GNUNET_YES)
pc->upload_task
- = GNUNET_SCHEDULER_add_with_priority (h->sched,
- GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
+ = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_,
pc);
if (GNUNET_OK !=
switch (uc->state)
{
case UNINDEX_STATE_HASHING:
- uc->fhc = GNUNET_CRYPTO_hash_file (uc->h->sched,
- GNUNET_SCHEDULER_PRIORITY_IDLE,
+ uc->fhc = GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_IDLE,
uc->filename,
HASHING_BLOCKSIZE,
&GNUNET_FS_unindex_process_hash_,
emsg = NULL;
uris = NULL;
download = NULL;
+ update_srch = NULL;
sr = GNUNET_malloc (sizeof (struct GNUNET_FS_SearchResult));
sr->serialization = ser;
if ( (GNUNET_OK !=
GNUNET_free (emsg);
}
}
- GNUNET_free (update_srch);
+ GNUNET_free (update_srch);
}
GNUNET_CONTAINER_multihashmap_put (sc->master_result_map,
&sr->key,
GNUNET_free_non_null (download);
GNUNET_free_non_null (emsg);
GNUNET_free_non_null (uris);
+ GNUNET_free_non_null (update_srch);
if (sr->uri != NULL)
GNUNET_FS_uri_destroy (sr->uri);
if (sr->meta != NULL)
/**
* Setup a connection to the file-sharing service.
*
- * @param sched scheduler to use
* @param cfg configuration to use
* @param client_name unique identifier for this client
* @param upcb function to call to notify about FS actions
* @return NULL on error
*/
struct GNUNET_FS_Handle *
-GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched,
- const struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *client_name,
GNUNET_FS_ProgressCallback upcb,
void *upcb_cls,
va_list ap;
ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Handle));
- ret->sched = sched;
ret->cfg = cfg;
ret->client_name = GNUNET_strdup (client_name);
ret->upcb = upcb;
while (h->top_head != NULL)
h->top_head->ssf (h->top_head->ssf_cls);
if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
- GNUNET_SCHEDULER_cancel (h->sched,
- h->queue_job);
+ GNUNET_SCHEDULER_cancel (h->queue_job);
GNUNET_free (h->client_name);
GNUNET_free (h);
}