aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-18 12:58:40 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-18 12:58:40 +0000
commitcd28dbfbcb9ffafed0b117a872351b8ff87e7652 (patch)
tree89e610d17ff8209e2325ed907a1402c3fc518854 /src/fs
parente1305cd6ace80bf28dad2d9eb83d4bc3d9ebf594 (diff)
downloadgnunet-cd28dbfbcb9ffafed0b117a872351b8ff87e7652.tar.gz
gnunet-cd28dbfbcb9ffafed0b117a872351b8ff87e7652.zip
logging
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_publish.c49
-rw-r--r--src/fs/test_gnunet_fs_rec_data.conf1
2 files changed, 49 insertions, 1 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index e2404647c..d693fe6ee 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -304,6 +304,11 @@ publish_kblocks_cont (void *cls,
304 304
305 if (NULL != emsg) 305 if (NULL != emsg)
306 { 306 {
307#if DEBUG_PUBLISH
308 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
309 "Error uploading KSK blocks: %s\n",
310 emsg);
311#end
307 signal_publish_error (p, pc, emsg); 312 signal_publish_error (p, pc, emsg);
308 GNUNET_FS_file_information_sync_ (p); 313 GNUNET_FS_file_information_sync_ (p);
309 GNUNET_FS_publish_sync_ (pc); 314 GNUNET_FS_publish_sync_ (pc);
@@ -314,6 +319,10 @@ publish_kblocks_cont (void *cls,
314 pc); 319 pc);
315 return; 320 return;
316 } 321 }
322#if DEBUG_PUBLISH
323 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
324 "KSK blocks published, moving on to next file\n");
325#endif
317 if (NULL != p->dir) 326 if (NULL != p->dir)
318 signal_publish_completion (p, pc); 327 signal_publish_completion (p, pc);
319 /* move on to next file */ 328 /* move on to next file */
@@ -400,7 +409,7 @@ encode_cont (void *cls,
400 struct GNUNET_FS_FileInformation *p; 409 struct GNUNET_FS_FileInformation *p;
401 struct GNUNET_FS_ProgressInfo pi; 410 struct GNUNET_FS_ProgressInfo pi;
402 char *emsg; 411 char *emsg;
403 412
404 p = sc->fi_pos; 413 p = sc->fi_pos;
405 GNUNET_FS_tree_encoder_finish (p->te, 414 GNUNET_FS_tree_encoder_finish (p->te,
406 &p->chk_uri, 415 &p->chk_uri,
@@ -408,6 +417,11 @@ encode_cont (void *cls,
408 p->te = NULL; 417 p->te = NULL;
409 if (NULL != emsg) 418 if (NULL != emsg)
410 { 419 {
420#if DEBUG_PUBLISH
421 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
422 "Error during tree walk: %s\n",
423 emsg);
424#end
411 GNUNET_asprintf (&p->emsg, 425 GNUNET_asprintf (&p->emsg,
412 _("Upload failed: %s"), 426 _("Upload failed: %s"),
413 emsg); 427 emsg);
@@ -417,6 +431,10 @@ encode_cont (void *cls,
417 pi.value.publish.specifics.error.message = p->emsg; 431 pi.value.publish.specifics.error.message = p->emsg;
418 p->client_info = GNUNET_FS_publish_make_status_ (&pi, sc, p, 0); 432 p->client_info = GNUNET_FS_publish_make_status_ (&pi, sc, p, 0);
419 } 433 }
434#if DEBUG_PUBLISH
435 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
436 "Finished with tree encoder\n");
437#endif
420 /* continue with main */ 438 /* continue with main */
421 sc->upload_task 439 sc->upload_task
422 = GNUNET_SCHEDULER_add_with_priority (sc->h->sched, 440 = GNUNET_SCHEDULER_add_with_priority (sc->h->sched,
@@ -455,6 +473,10 @@ block_proc (void *cls,
455 p = sc->fi_pos; 473 p = sc->fi_pos;
456 if (NULL == sc->dsh) 474 if (NULL == sc->dsh)
457 { 475 {
476#if DEBUG_PUBLISH
477 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
478 "Waiting for datastore connection\n");
479#endif
458 sc->upload_task 480 sc->upload_task
459 = GNUNET_SCHEDULER_add_with_priority (sc->h->sched, 481 = GNUNET_SCHEDULER_add_with_priority (sc->h->sched,
460 GNUNET_SCHEDULER_PRIORITY_BACKGROUND, 482 GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
@@ -575,6 +597,10 @@ publish_content (struct GNUNET_FS_PublishContext *sc)
575 { 597 {
576 if (p->is_directory) 598 if (p->is_directory)
577 { 599 {
600#if DEBUG_PUBLISH
601 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
602 "Creating directory\n");
603#endif
578 db = GNUNET_FS_directory_builder_create (p->meta); 604 db = GNUNET_FS_directory_builder_create (p->meta);
579 dirpos = p->data.dir.entries; 605 dirpos = p->data.dir.entries;
580 while (NULL != dirpos) 606 while (NULL != dirpos)
@@ -620,6 +646,10 @@ publish_content (struct GNUNET_FS_PublishContext *sc)
620 size = (p->is_directory) 646 size = (p->is_directory)
621 ? p->data.dir.dir_size 647 ? p->data.dir.dir_size
622 : p->data.file.file_size; 648 : p->data.file.file_size;
649#if DEBUG_PUBLISH
650 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
651 "Creating tree encoder\n");
652#endif
623 p->te = GNUNET_FS_tree_encoder_create (sc->h, 653 p->te = GNUNET_FS_tree_encoder_create (sc->h,
624 size, 654 size,
625 sc, 655 sc,
@@ -629,6 +659,10 @@ publish_content (struct GNUNET_FS_PublishContext *sc)
629 &encode_cont); 659 &encode_cont);
630 660
631 } 661 }
662#if DEBUG_PUBLISH
663 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
664 "Processing next block from tree\n");
665#endif
632 GNUNET_FS_tree_encoder_next (p->te); 666 GNUNET_FS_tree_encoder_next (p->te);
633} 667}
634 668
@@ -820,6 +854,10 @@ GNUNET_FS_publish_main_ (void *cls,
820 p = pc->fi_pos; 854 p = pc->fi_pos;
821 if (NULL == p) 855 if (NULL == p)
822 { 856 {
857#if DEBUG_PUBLISH
858 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
859 "Upload complete, now publishing SKS and KSK blocks.\n");
860#endif
823 /* upload of entire hierarchy complete, 861 /* upload of entire hierarchy complete,
824 publish namespace entries */ 862 publish namespace entries */
825 GNUNET_FS_publish_sync_ (pc); 863 GNUNET_FS_publish_sync_ (pc);
@@ -839,6 +877,11 @@ GNUNET_FS_publish_main_ (void *cls,
839 /* abort on error */ 877 /* abort on error */
840 if (NULL != p->emsg) 878 if (NULL != p->emsg)
841 { 879 {
880#if DEBUG_PUBLISH
881 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
882 "Error uploading: %s\n",
883 p->emsg);
884#endif
842 /* error with current file, abort all 885 /* error with current file, abort all
843 related files as well! */ 886 related files as well! */
844 while (NULL != p->dir) 887 while (NULL != p->dir)
@@ -872,6 +915,10 @@ GNUNET_FS_publish_main_ (void *cls,
872 /* handle completion */ 915 /* handle completion */
873 if (NULL != p->chk_uri) 916 if (NULL != p->chk_uri)
874 { 917 {
918#if DEBUG_PUBLISH
919 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
920 "File upload complete, now publishing KSK blocks.\n");
921#endif
875 GNUNET_FS_publish_sync_ (pc); 922 GNUNET_FS_publish_sync_ (pc);
876 /* upload of "p" complete, publish KBlocks! */ 923 /* upload of "p" complete, publish KBlocks! */
877 if (p->keywords != NULL) 924 if (p->keywords != NULL)
diff --git a/src/fs/test_gnunet_fs_rec_data.conf b/src/fs/test_gnunet_fs_rec_data.conf
index 519ddb1d5..ad4b8cbcb 100644
--- a/src/fs/test_gnunet_fs_rec_data.conf
+++ b/src/fs/test_gnunet_fs_rec_data.conf
@@ -19,6 +19,7 @@ HOSTNAME = localhost
19DEFAULTSERVICES = 19DEFAULTSERVICES =
20 20
21[datastore] 21[datastore]
22PORT = 44472
22# DEBUG = YES 23# DEBUG = YES
23 24
24[statistics] 25[statistics]