* @file fs/gnunet-auto-share.c
* @brief automatically publish files on GNUnet
* @author Christian Grothoff
- *
+ *
* TODO:
* - support loading meta data / keywords from resource file
* - add stability timer (a la buildbot)
while (n-- > 0)
{
if ( (GNUNET_OK !=
- GNUNET_BIO_read_string (rh, "filename", &fn, 1024)) ||
+ GNUNET_BIO_read_string (rh, "filename", &fn, 1024)) ||
(GNUNET_OK !=
GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) )
goto error;
wi,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
}
- if (GNUNET_OK ==
+ if (GNUNET_OK ==
GNUNET_BIO_read_close (rh, &emsg))
return;
rh = NULL;
"Saving serialization ID of file `%s' with value `%s'\n",
wi->filename,
GNUNET_h2s (&wi->id));
- if ( (GNUNET_OK !=
+ if ( (GNUNET_OK !=
GNUNET_BIO_write_string (wh, wi->filename)) ||
(GNUNET_OK !=
GNUNET_BIO_write (wh,
{
GNUNET_break (0);
GNUNET_OS_process_kill (publish_proc, SIGKILL);
- type = GNUNET_OS_PROCESS_SIGNALED;
+ type = GNUNET_OS_PROCESS_SIGNALED;
}
GNUNET_OS_process_destroy (publish_proc);
publish_proc = NULL;
wi);
}
save_state ();
- schedule_next_task ();
+ schedule_next_task ();
}
static char content_prio[20];
static char repl_level[20];
struct WorkItem *wi;
- const struct GNUNET_DISK_FileHandle *pr;
+ const struct GNUNET_DISK_FileHandle *pr;
int argc;
run_task = GNUNET_SCHEDULER_NO_TASK;
/* use hash here to make hierarchical structure distinct from
all files on the same level */
GNUNET_CRYPTO_hash (fx, sizeof (fx), &ft);
- /* use XOR here so that order of the files in the directory
+ /* use XOR here so that order of the files in the directory
does not matter! */
GNUNET_CRYPTO_hash_xor (&ft, id, id);
return GNUNET_OK;
work_tail,
wi);
if (GNUNET_YES == do_shutdown)
- return GNUNET_SYSERR;
+ return GNUNET_SYSERR;
return GNUNET_OK;
}
struct GNUNET_TIME_Relative delay;
if (GNUNET_YES == do_shutdown)
- return;
+ return;
if (NULL == work_head)
{
/* delay by at most 4h, at least 1s, and otherwise in between depending
{
/* check arguments */
if ((args[0] == NULL) || (args[1] != NULL) ||
- (GNUNET_YES != GNUNET_DISK_directory_test (args[0])))
+ (GNUNET_YES != GNUNET_DISK_directory_test (args[0], GNUNET_YES)))
{
printf (_("You must specify one and only one directory name for automatic publication.\n"));
ret = -1;
load_state ();
run_task = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE,
&scan, NULL);
-
+
kill_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_stop_task,
NULL);
* @param cls NULL (unused)
* @param key key of the item in the map (unused)
* @param value the 'struct WorkItem' to free
- * @return GNUNET_OK to continue to iterate
+ * @return GNUNET_OK to continue to iterate
*/
static int
free_item (void *cls,
*/
int
main (int argc, char *const *argv)
-{
+{
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'a', "anonymity", "LEVEL",
gettext_noop ("set the desired LEVEL of sender-anonymity"),
sigpipe = NULL;
GNUNET_free (cfg_filename);
cfg_filename = NULL;
+ GNUNET_free ((void*) argv);
return ok;
}