diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-30 09:18:59 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-30 09:18:59 +0000 |
commit | 3056a8d79ddf74b3b3097455323fd5bb531bd87f (patch) | |
tree | a485278f8a256704a6b96fd90ab5d345aac986c2 /src/namestore | |
parent | feebaa1b4e5236d837d7f9e55562426b70fadf5a (diff) | |
download | gnunet-3056a8d79ddf74b3b3097455323fd5bb531bd87f.tar.gz gnunet-3056a8d79ddf74b3b3097455323fd5bb531bd87f.zip |
-more logging
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 9 | ||||
-rw-r--r-- | src/namestore/plugin_namestore_sqlite.c | 13 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 266af5a20..ea5ad6cd0 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -422,6 +422,9 @@ handle_lookup_block (void *cls, | |||
422 | if (0 == ret) | 422 | if (0 == ret) |
423 | { | 423 | { |
424 | /* no records match at all, generate empty response */ | 424 | /* no records match at all, generate empty response */ |
425 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
426 | "Sending empty `%s' message\n", | ||
427 | "NAMESTORE_LOOKUP_BLOCK_RESPONSE"); | ||
425 | memset (&zir_end, 0, sizeof (zir_end)); | 428 | memset (&zir_end, 0, sizeof (zir_end)); |
426 | zir_end.gns_header.header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE); | 429 | zir_end.gns_header.header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_BLOCK_RESPONSE); |
427 | zir_end.gns_header.header.size = htons (sizeof (struct LookupBlockResponseMessage)); | 430 | zir_end.gns_header.header.size = htons (sizeof (struct LookupBlockResponseMessage)); |
@@ -467,7 +470,6 @@ handle_block_cache (void *cls, | |||
467 | } | 470 | } |
468 | rp_msg = (const struct BlockCacheMessage *) message; | 471 | rp_msg = (const struct BlockCacheMessage *) message; |
469 | esize = ntohs (rp_msg->gns_header.header.size) - sizeof (struct BlockCacheMessage); | 472 | esize = ntohs (rp_msg->gns_header.header.size) - sizeof (struct BlockCacheMessage); |
470 | |||
471 | block = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_Block) + esize); | 473 | block = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_Block) + esize); |
472 | block->signature = rp_msg->signature; | 474 | block->signature = rp_msg->signature; |
473 | block->derived_key = rp_msg->derived_key; | 475 | block->derived_key = rp_msg->derived_key; |
@@ -537,8 +539,9 @@ send_lookup_response (struct GNUNET_SERVER_NotificationContext *nc, | |||
537 | rd_ser = &name_tmp[name_len]; | 539 | rd_ser = &name_tmp[name_len]; |
538 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_ser); | 540 | GNUNET_NAMESTORE_records_serialize (rd_count, rd, rd_ser_len, rd_ser); |
539 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 541 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
540 | "Sending `%s' message with size %u\n", | 542 | "Sending `%s' message with %u records and size %u\n", |
541 | "RECORD_RESULT", | 543 | "RECORD_RESULT", |
544 | rd_count, | ||
542 | msg_size); | 545 | msg_size); |
543 | GNUNET_SERVER_notification_context_unicast (nc, | 546 | GNUNET_SERVER_notification_context_unicast (nc, |
544 | client, | 547 | client, |
@@ -651,7 +654,7 @@ handle_record_store (void *cls, | |||
651 | res = GSN_database->store_records (GSN_database->cls, | 654 | res = GSN_database->store_records (GSN_database->cls, |
652 | &rp_msg->private_key, | 655 | &rp_msg->private_key, |
653 | conv_name, | 656 | conv_name, |
654 | rd_count, rd); | 657 | rd_count, rd); |
655 | if (GNUNET_OK == res) | 658 | if (GNUNET_OK == res) |
656 | { | 659 | { |
657 | struct ZoneMonitor *zm; | 660 | struct ZoneMonitor *zm; |
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index 6551dd4a2..04291cd69 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -480,6 +480,9 @@ namestore_sqlite_cache_block (void *cls, | |||
480 | return GNUNET_SYSERR; | 480 | return GNUNET_SYSERR; |
481 | 481 | ||
482 | } | 482 | } |
483 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
484 | "Caching block under derived key `%s'\n", | ||
485 | GNUNET_h2s (&query)); | ||
483 | n = sqlite3_step (plugin->cache_block); | 486 | n = sqlite3_step (plugin->cache_block); |
484 | if (SQLITE_OK != sqlite3_reset (plugin->cache_block)) | 487 | if (SQLITE_OK != sqlite3_reset (plugin->cache_block)) |
485 | LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, | 488 | LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, |
@@ -534,7 +537,6 @@ namestore_sqlite_lookup_block (void *cls, | |||
534 | "sqlite3_reset"); | 537 | "sqlite3_reset"); |
535 | return GNUNET_SYSERR; | 538 | return GNUNET_SYSERR; |
536 | } | 539 | } |
537 | |||
538 | ret = GNUNET_NO; | 540 | ret = GNUNET_NO; |
539 | if (SQLITE_ROW == (sret = sqlite3_step (plugin->lookup_block))) | 541 | if (SQLITE_ROW == (sret = sqlite3_step (plugin->lookup_block))) |
540 | { | 542 | { |
@@ -550,6 +552,9 @@ namestore_sqlite_lookup_block (void *cls, | |||
550 | } | 552 | } |
551 | else | 553 | else |
552 | { | 554 | { |
555 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
556 | "Found block under derived key `%s'\n", | ||
557 | GNUNET_h2s (query)); | ||
553 | iter (iter_cls, block); | 558 | iter (iter_cls, block); |
554 | ret = GNUNET_YES; | 559 | ret = GNUNET_YES; |
555 | } | 560 | } |
@@ -561,6 +566,12 @@ namestore_sqlite_lookup_block (void *cls, | |||
561 | LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR, "sqlite_step"); | 566 | LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR, "sqlite_step"); |
562 | ret = GNUNET_SYSERR; | 567 | ret = GNUNET_SYSERR; |
563 | } | 568 | } |
569 | else | ||
570 | { | ||
571 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
572 | "No block found under derived key `%s'\n", | ||
573 | GNUNET_h2s (query)); | ||
574 | } | ||
564 | } | 575 | } |
565 | if (SQLITE_OK != sqlite3_reset (plugin->lookup_block)) | 576 | if (SQLITE_OK != sqlite3_reset (plugin->lookup_block)) |
566 | LOG_SQLITE (plugin, | 577 | LOG_SQLITE (plugin, |