diff options
Diffstat (limited to 'src/fs/gnunet-auto-share.c')
-rw-r--r-- | src/fs/gnunet-auto-share.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index 86cab5593..b001cb58c 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c | |||
@@ -21,7 +21,7 @@ | |||
21 | * @file fs/gnunet-auto-share.c | 21 | * @file fs/gnunet-auto-share.c |
22 | * @brief automatically publish files on GNUnet | 22 | * @brief automatically publish files on GNUnet |
23 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
24 | * | 24 | * |
25 | * TODO: | 25 | * TODO: |
26 | * - support loading meta data / keywords from resource file | 26 | * - support loading meta data / keywords from resource file |
27 | * - add stability timer (a la buildbot) | 27 | * - add stability timer (a la buildbot) |
@@ -204,7 +204,7 @@ load_state () | |||
204 | while (n-- > 0) | 204 | while (n-- > 0) |
205 | { | 205 | { |
206 | if ( (GNUNET_OK != | 206 | if ( (GNUNET_OK != |
207 | GNUNET_BIO_read_string (rh, "filename", &fn, 1024)) || | 207 | GNUNET_BIO_read_string (rh, "filename", &fn, 1024)) || |
208 | (GNUNET_OK != | 208 | (GNUNET_OK != |
209 | GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) ) | 209 | GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) ) |
210 | goto error; | 210 | goto error; |
@@ -224,7 +224,7 @@ load_state () | |||
224 | wi, | 224 | wi, |
225 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | 225 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
226 | } | 226 | } |
227 | if (GNUNET_OK == | 227 | if (GNUNET_OK == |
228 | GNUNET_BIO_read_close (rh, &emsg)) | 228 | GNUNET_BIO_read_close (rh, &emsg)) |
229 | return; | 229 | return; |
230 | rh = NULL; | 230 | rh = NULL; |
@@ -259,7 +259,7 @@ write_item (void *cls, | |||
259 | "Saving serialization ID of file `%s' with value `%s'\n", | 259 | "Saving serialization ID of file `%s' with value `%s'\n", |
260 | wi->filename, | 260 | wi->filename, |
261 | GNUNET_h2s (&wi->id)); | 261 | GNUNET_h2s (&wi->id)); |
262 | if ( (GNUNET_OK != | 262 | if ( (GNUNET_OK != |
263 | GNUNET_BIO_write_string (wh, wi->filename)) || | 263 | GNUNET_BIO_write_string (wh, wi->filename)) || |
264 | (GNUNET_OK != | 264 | (GNUNET_OK != |
265 | GNUNET_BIO_write (wh, | 265 | GNUNET_BIO_write (wh, |
@@ -381,7 +381,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
381 | { | 381 | { |
382 | GNUNET_break (0); | 382 | GNUNET_break (0); |
383 | GNUNET_OS_process_kill (publish_proc, SIGKILL); | 383 | GNUNET_OS_process_kill (publish_proc, SIGKILL); |
384 | type = GNUNET_OS_PROCESS_SIGNALED; | 384 | type = GNUNET_OS_PROCESS_SIGNALED; |
385 | } | 385 | } |
386 | GNUNET_OS_process_destroy (publish_proc); | 386 | GNUNET_OS_process_destroy (publish_proc); |
387 | publish_proc = NULL; | 387 | publish_proc = NULL; |
@@ -415,7 +415,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
415 | wi); | 415 | wi); |
416 | } | 416 | } |
417 | save_state (); | 417 | save_state (); |
418 | schedule_next_task (); | 418 | schedule_next_task (); |
419 | } | 419 | } |
420 | 420 | ||
421 | 421 | ||
@@ -452,7 +452,7 @@ work (void *cls, | |||
452 | static char content_prio[20]; | 452 | static char content_prio[20]; |
453 | static char repl_level[20]; | 453 | static char repl_level[20]; |
454 | struct WorkItem *wi; | 454 | struct WorkItem *wi; |
455 | const struct GNUNET_DISK_FileHandle *pr; | 455 | const struct GNUNET_DISK_FileHandle *pr; |
456 | int argc; | 456 | int argc; |
457 | 457 | ||
458 | run_task = GNUNET_SCHEDULER_NO_TASK; | 458 | run_task = GNUNET_SCHEDULER_NO_TASK; |
@@ -553,7 +553,7 @@ determine_id (void *cls, | |||
553 | /* use hash here to make hierarchical structure distinct from | 553 | /* use hash here to make hierarchical structure distinct from |
554 | all files on the same level */ | 554 | all files on the same level */ |
555 | GNUNET_CRYPTO_hash (fx, sizeof (fx), &ft); | 555 | GNUNET_CRYPTO_hash (fx, sizeof (fx), &ft); |
556 | /* use XOR here so that order of the files in the directory | 556 | /* use XOR here so that order of the files in the directory |
557 | does not matter! */ | 557 | does not matter! */ |
558 | GNUNET_CRYPTO_hash_xor (&ft, id, id); | 558 | GNUNET_CRYPTO_hash_xor (&ft, id, id); |
559 | return GNUNET_OK; | 559 | return GNUNET_OK; |
@@ -613,7 +613,7 @@ add_file (void *cls, | |||
613 | work_tail, | 613 | work_tail, |
614 | wi); | 614 | wi); |
615 | if (GNUNET_YES == do_shutdown) | 615 | if (GNUNET_YES == do_shutdown) |
616 | return GNUNET_SYSERR; | 616 | return GNUNET_SYSERR; |
617 | return GNUNET_OK; | 617 | return GNUNET_OK; |
618 | } | 618 | } |
619 | 619 | ||
@@ -645,7 +645,7 @@ schedule_next_task () | |||
645 | struct GNUNET_TIME_Relative delay; | 645 | struct GNUNET_TIME_Relative delay; |
646 | 646 | ||
647 | if (GNUNET_YES == do_shutdown) | 647 | if (GNUNET_YES == do_shutdown) |
648 | return; | 648 | return; |
649 | if (NULL == work_head) | 649 | if (NULL == work_head) |
650 | { | 650 | { |
651 | /* delay by at most 4h, at least 1s, and otherwise in between depending | 651 | /* delay by at most 4h, at least 1s, and otherwise in between depending |
@@ -694,7 +694,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
694 | load_state (); | 694 | load_state (); |
695 | run_task = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, | 695 | run_task = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, |
696 | &scan, NULL); | 696 | &scan, NULL); |
697 | 697 | ||
698 | kill_task = | 698 | kill_task = |
699 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_stop_task, | 699 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_stop_task, |
700 | NULL); | 700 | NULL); |
@@ -707,7 +707,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
707 | * @param cls NULL (unused) | 707 | * @param cls NULL (unused) |
708 | * @param key key of the item in the map (unused) | 708 | * @param key key of the item in the map (unused) |
709 | * @param value the 'struct WorkItem' to free | 709 | * @param value the 'struct WorkItem' to free |
710 | * @return GNUNET_OK to continue to iterate | 710 | * @return GNUNET_OK to continue to iterate |
711 | */ | 711 | */ |
712 | static int | 712 | static int |
713 | free_item (void *cls, | 713 | free_item (void *cls, |
@@ -731,7 +731,7 @@ free_item (void *cls, | |||
731 | */ | 731 | */ |
732 | int | 732 | int |
733 | main (int argc, char *const *argv) | 733 | main (int argc, char *const *argv) |
734 | { | 734 | { |
735 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 735 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
736 | {'a', "anonymity", "LEVEL", | 736 | {'a', "anonymity", "LEVEL", |
737 | gettext_noop ("set the desired LEVEL of sender-anonymity"), | 737 | gettext_noop ("set the desired LEVEL of sender-anonymity"), |