diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-06 01:12:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-06 01:12:57 +0000 |
commit | 9fac6b6eefdc9144053f736fd388cb2199a97046 (patch) | |
tree | 82740a981b7f6ae973d915aa77797acd9db668b2 /src/datastore | |
parent | 23d8d343d5c70481ecf78ec4fafc698907f3e8a9 (diff) | |
download | gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.tar.gz gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.zip |
-removing legacy ifdefs, fixing log statements
Diffstat (limited to 'src/datastore')
-rw-r--r-- | src/datastore/datastore.h | 1 | ||||
-rw-r--r-- | src/datastore/gnunet-service-datastore.c | 52 |
2 files changed, 2 insertions, 51 deletions
diff --git a/src/datastore/datastore.h b/src/datastore/datastore.h index c8b2c722b..87ceb0134 100644 --- a/src/datastore/datastore.h +++ b/src/datastore/datastore.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #ifndef DATASTORE_H | 27 | #ifndef DATASTORE_H |
28 | #define DATASTORE_H | 28 | #define DATASTORE_H |
29 | 29 | ||
30 | #define DEBUG_DATASTORE GNUNET_EXTRA_LOGGING | ||
31 | 30 | ||
32 | #include "gnunet_util_lib.h" | 31 | #include "gnunet_util_lib.h" |
33 | 32 | ||
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 863cd3902..49b9db859 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c | |||
@@ -341,12 +341,10 @@ expired_processor (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
341 | &delete_expired, NULL); | 341 | &delete_expired, NULL); |
342 | return GNUNET_SYSERR; | 342 | return GNUNET_SYSERR; |
343 | } | 343 | } |
344 | #if DEBUG_DATASTORE | ||
345 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
346 | "Deleting content `%s' of type %u that expired %llu ms ago\n", | 345 | "Deleting content `%s' of type %u that expired %llu ms ago\n", |
347 | GNUNET_h2s (key), type, | 346 | GNUNET_h2s (key), type, |
348 | (unsigned long long) (now.abs_value - expiration.abs_value)); | 347 | (unsigned long long) (now.abs_value - expiration.abs_value)); |
349 | #endif | ||
350 | min_expiration = now; | 348 | min_expiration = now; |
351 | GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes expired"), size, | 349 | GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes expired"), size, |
352 | GNUNET_YES); | 350 | GNUNET_YES); |
@@ -405,7 +403,6 @@ quota_processor (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
405 | 403 | ||
406 | if (NULL == key) | 404 | if (NULL == key) |
407 | return GNUNET_SYSERR; | 405 | return GNUNET_SYSERR; |
408 | #if DEBUG_DATASTORE | ||
409 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 406 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
410 | "Deleting %llu bytes of low-priority (%u) content `%s' of type %u at %llu ms prior to expiration (still trying to free another %llu bytes)\n", | 407 | "Deleting %llu bytes of low-priority (%u) content `%s' of type %u at %llu ms prior to expiration (still trying to free another %llu bytes)\n", |
411 | (unsigned long long) (size + GNUNET_DATASTORE_ENTRY_OVERHEAD), | 408 | (unsigned long long) (size + GNUNET_DATASTORE_ENTRY_OVERHEAD), |
@@ -413,7 +410,6 @@ quota_processor (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
413 | GNUNET_h2s (key), type, | 410 | GNUNET_h2s (key), type, |
414 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (expiration).rel_value, | 411 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (expiration).rel_value, |
415 | *need); | 412 | *need); |
416 | #endif | ||
417 | if (size + GNUNET_DATASTORE_ENTRY_OVERHEAD > *need) | 413 | if (size + GNUNET_DATASTORE_ENTRY_OVERHEAD > *need) |
418 | *need = 0; | 414 | *need = 0; |
419 | else | 415 | else |
@@ -447,10 +443,8 @@ manage_space (unsigned long long need) | |||
447 | { | 443 | { |
448 | unsigned long long last; | 444 | unsigned long long last; |
449 | 445 | ||
450 | #if DEBUG_DATASTORE | ||
451 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 446 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
452 | "Asked to free up %llu bytes of cache space\n", need); | 447 | "Asked to free up %llu bytes of cache space\n", need); |
453 | #endif | ||
454 | last = 0; | 448 | last = 0; |
455 | while ((need > 0) && (last != need)) | 449 | while ((need > 0) && (last != need)) |
456 | { | 450 | { |
@@ -513,10 +507,8 @@ transmit (struct GNUNET_SERVER_Client *client, struct GNUNET_MessageHeader *msg) | |||
513 | 507 | ||
514 | if (GNUNET_YES == cleaning_done) | 508 | if (GNUNET_YES == cleaning_done) |
515 | { | 509 | { |
516 | #if DEBUG_DATASTORE | ||
517 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 510 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
518 | "Shutdown in progress, aborting transmission.\n"); | 511 | _("Shutdown in progress, aborting transmission.\n")); |
519 | #endif | ||
520 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 512 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
521 | GNUNET_free (msg); | 513 | GNUNET_free (msg); |
522 | return; | 514 | return; |
@@ -554,11 +546,9 @@ transmit_status (struct GNUNET_SERVER_Client *client, int code, const char *msg) | |||
554 | struct StatusMessage *sm; | 546 | struct StatusMessage *sm; |
555 | size_t slen; | 547 | size_t slen; |
556 | 548 | ||
557 | #if DEBUG_DATASTORE | ||
558 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 549 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
559 | "Transmitting `%s' message with value %d and message `%s'\n", | 550 | "Transmitting `%s' message with value %d and message `%s'\n", |
560 | "STATUS", code, msg != NULL ? msg : "(none)"); | 551 | "STATUS", code, msg != NULL ? msg : "(none)"); |
561 | #endif | ||
562 | slen = (msg == NULL) ? 0 : strlen (msg) + 1; | 552 | slen = (msg == NULL) ? 0 : strlen (msg) + 1; |
563 | sm = GNUNET_malloc (sizeof (struct StatusMessage) + slen); | 553 | sm = GNUNET_malloc (sizeof (struct StatusMessage) + slen); |
564 | sm->header.size = htons (sizeof (struct StatusMessage) + slen); | 554 | sm->header.size = htons (sizeof (struct StatusMessage) + slen); |
@@ -603,10 +593,8 @@ transmit_item (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
603 | if (key == NULL) | 593 | if (key == NULL) |
604 | { | 594 | { |
605 | /* transmit 'DATA_END' */ | 595 | /* transmit 'DATA_END' */ |
606 | #if DEBUG_DATASTORE | ||
607 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' message\n", | 596 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' message\n", |
608 | "DATA_END"); | 597 | "DATA_END"); |
609 | #endif | ||
610 | end = GNUNET_malloc (sizeof (struct GNUNET_MessageHeader)); | 598 | end = GNUNET_malloc (sizeof (struct GNUNET_MessageHeader)); |
611 | end->size = htons (sizeof (struct GNUNET_MessageHeader)); | 599 | end->size = htons (sizeof (struct GNUNET_MessageHeader)); |
612 | end->type = htons (GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END); | 600 | end->type = htons (GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END); |
@@ -630,13 +618,11 @@ transmit_item (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
630 | dm->uid = GNUNET_htonll (uid); | 618 | dm->uid = GNUNET_htonll (uid); |
631 | dm->key = *key; | 619 | dm->key = *key; |
632 | memcpy (&dm[1], data, size); | 620 | memcpy (&dm[1], data, size); |
633 | #if DEBUG_DATASTORE | ||
634 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 621 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
635 | "Transmitting `%s' message for `%s' of type %u with expiration %llu (now: %llu)\n", | 622 | "Transmitting `%s' message for `%s' of type %u with expiration %llu (now: %llu)\n", |
636 | "DATA", GNUNET_h2s (key), type, | 623 | "DATA", GNUNET_h2s (key), type, |
637 | (unsigned long long) expiration.abs_value, | 624 | (unsigned long long) expiration.abs_value, |
638 | (unsigned long long) GNUNET_TIME_absolute_get ().abs_value); | 625 | (unsigned long long) GNUNET_TIME_absolute_get ().abs_value); |
639 | #endif | ||
640 | GNUNET_STATISTICS_update (stats, gettext_noop ("# results found"), 1, | 626 | GNUNET_STATISTICS_update (stats, gettext_noop ("# results found"), 1, |
641 | GNUNET_NO); | 627 | GNUNET_NO); |
642 | transmit (client, &dm->header); | 628 | transmit (client, &dm->header); |
@@ -668,9 +654,7 @@ handle_reserve (void *cls, struct GNUNET_SERVER_Client *client, | |||
668 | uint64_t amount; | 654 | uint64_t amount; |
669 | uint32_t entries; | 655 | uint32_t entries; |
670 | 656 | ||
671 | #if DEBUG_DATASTORE | ||
672 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", "RESERVE"); | 657 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", "RESERVE"); |
673 | #endif | ||
674 | amount = GNUNET_ntohll (msg->amount); | 658 | amount = GNUNET_ntohll (msg->amount); |
675 | entries = ntohl (msg->entries); | 659 | entries = ntohl (msg->entries); |
676 | used = payload + reserved; | 660 | used = payload + reserved; |
@@ -742,10 +726,8 @@ handle_release_reserve (void *cls, struct GNUNET_SERVER_Client *client, | |||
742 | int rid = ntohl (msg->rid); | 726 | int rid = ntohl (msg->rid); |
743 | unsigned long long rem; | 727 | unsigned long long rem; |
744 | 728 | ||
745 | #if DEBUG_DATASTORE | ||
746 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", | 729 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", |
747 | "RELEASE_RESERVE"); | 730 | "RELEASE_RESERVE"); |
748 | #endif | ||
749 | next = reservations; | 731 | next = reservations; |
750 | prev = NULL; | 732 | prev = NULL; |
751 | while (NULL != (pos = next)) | 733 | while (NULL != (pos = next)) |
@@ -764,11 +746,9 @@ handle_release_reserve (void *cls, struct GNUNET_SERVER_Client *client, | |||
764 | reserved -= rem; | 746 | reserved -= rem; |
765 | GNUNET_STATISTICS_set (stats, gettext_noop ("# reserved"), reserved, | 747 | GNUNET_STATISTICS_set (stats, gettext_noop ("# reserved"), reserved, |
766 | GNUNET_NO); | 748 | GNUNET_NO); |
767 | #if DEBUG_DATASTORE | ||
768 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 749 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
769 | "Returning %llu remaining reserved bytes to storage pool\n", | 750 | "Returning %llu remaining reserved bytes to storage pool\n", |
770 | rem); | 751 | rem); |
771 | #endif | ||
772 | GNUNET_free (pos); | 752 | GNUNET_free (pos); |
773 | transmit_status (client, GNUNET_OK, NULL); | 753 | transmit_status (client, GNUNET_OK, NULL); |
774 | return; | 754 | return; |
@@ -854,11 +834,9 @@ execute_put (struct GNUNET_SERVER_Client *client, const struct DataMessage *dm) | |||
854 | GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes stored"), size, | 834 | GNUNET_STATISTICS_update (stats, gettext_noop ("# bytes stored"), size, |
855 | GNUNET_YES); | 835 | GNUNET_YES); |
856 | GNUNET_CONTAINER_bloomfilter_add (filter, &dm->key); | 836 | GNUNET_CONTAINER_bloomfilter_add (filter, &dm->key); |
857 | #if DEBUG_DATASTORE | ||
858 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 837 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
859 | "Successfully stored %u bytes of type %u under key `%s'\n", | 838 | "Successfully stored %u bytes of type %u under key `%s'\n", |
860 | size, ntohl (dm->type), GNUNET_h2s (&dm->key)); | 839 | size, ntohl (dm->type), GNUNET_h2s (&dm->key)); |
861 | #endif | ||
862 | } | 840 | } |
863 | transmit_status (client, ret, msg); | 841 | transmit_status (client, ret, msg); |
864 | GNUNET_free_non_null (msg); | 842 | GNUNET_free_non_null (msg); |
@@ -914,10 +892,8 @@ check_present (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
914 | (0 == | 892 | (0 == |
915 | memcmp (&dm[1], data, size)))) | 893 | memcmp (&dm[1], data, size)))) |
916 | { | 894 | { |
917 | #if DEBUG_MYSQL | ||
918 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 895 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
919 | "Result already present in datastore\n"); | 896 | "Result already present in datastore\n"); |
920 | #endif | ||
921 | /* FIXME: change API to allow increasing 'replication' counter */ | 897 | /* FIXME: change API to allow increasing 'replication' counter */ |
922 | if ((ntohl (dm->priority) > 0) || | 898 | if ((ntohl (dm->priority) > 0) || |
923 | (GNUNET_TIME_absolute_ntoh (dm->expiration).abs_value > | 899 | (GNUNET_TIME_absolute_ntoh (dm->expiration).abs_value > |
@@ -963,11 +939,9 @@ handle_put (void *cls, struct GNUNET_SERVER_Client *client, | |||
963 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 939 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
964 | return; | 940 | return; |
965 | } | 941 | } |
966 | #if DEBUG_DATASTORE | ||
967 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 942 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
968 | "Processing `%s' request for `%s' of type %u\n", "PUT", | 943 | "Processing `%s' request for `%s' of type %u\n", "PUT", |
969 | GNUNET_h2s (&dm->key), ntohl (dm->type)); | 944 | GNUNET_h2s (&dm->key), ntohl (dm->type)); |
970 | #endif | ||
971 | rid = ntohl (dm->rid); | 945 | rid = ntohl (dm->rid); |
972 | size = ntohl (dm->size); | 946 | size = ntohl (dm->size); |
973 | if (rid > 0) | 947 | if (rid > 0) |
@@ -1026,11 +1000,9 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client, | |||
1026 | return; | 1000 | return; |
1027 | } | 1001 | } |
1028 | msg = (const struct GetMessage *) message; | 1002 | msg = (const struct GetMessage *) message; |
1029 | #if DEBUG_DATASTORE | ||
1030 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1003 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1031 | "Processing `%s' request for `%s' of type %u\n", "GET", | 1004 | "Processing `%s' request for `%s' of type %u\n", "GET", |
1032 | GNUNET_h2s (&msg->key), ntohl (msg->type)); | 1005 | GNUNET_h2s (&msg->key), ntohl (msg->type)); |
1033 | #endif | ||
1034 | GNUNET_STATISTICS_update (stats, gettext_noop ("# GET requests received"), 1, | 1006 | GNUNET_STATISTICS_update (stats, gettext_noop ("# GET requests received"), 1, |
1035 | GNUNET_NO); | 1007 | GNUNET_NO); |
1036 | GNUNET_SERVER_client_keep (client); | 1008 | GNUNET_SERVER_client_keep (client); |
@@ -1038,11 +1010,9 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client, | |||
1038 | (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (filter, &msg->key))) | 1010 | (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (filter, &msg->key))) |
1039 | { | 1011 | { |
1040 | /* don't bother database... */ | 1012 | /* don't bother database... */ |
1041 | #if DEBUG_DATASTORE | ||
1042 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1013 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1043 | "Empty result set for `%s' request for `%s' (bloomfilter).\n", | 1014 | "Empty result set for `%s' request for `%s' (bloomfilter).\n", |
1044 | "GET", GNUNET_h2s (&msg->key)); | 1015 | "GET", GNUNET_h2s (&msg->key)); |
1045 | #endif | ||
1046 | GNUNET_STATISTICS_update (stats, | 1016 | GNUNET_STATISTICS_update (stats, |
1047 | gettext_noop | 1017 | gettext_noop |
1048 | ("# requests filtered by bloomfilter"), 1, | 1018 | ("# requests filtered by bloomfilter"), 1, |
@@ -1077,10 +1047,8 @@ handle_update (void *cls, struct GNUNET_SERVER_Client *client, | |||
1077 | 1, GNUNET_NO); | 1047 | 1, GNUNET_NO); |
1078 | msg = (const struct UpdateMessage *) message; | 1048 | msg = (const struct UpdateMessage *) message; |
1079 | emsg = NULL; | 1049 | emsg = NULL; |
1080 | #if DEBUG_DATASTORE | ||
1081 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request for %llu\n", | 1050 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request for %llu\n", |
1082 | "UPDATE", (unsigned long long) GNUNET_ntohll (msg->uid)); | 1051 | "UPDATE", (unsigned long long) GNUNET_ntohll (msg->uid)); |
1083 | #endif | ||
1084 | ret = | 1052 | ret = |
1085 | plugin->api->update (plugin->api->cls, GNUNET_ntohll (msg->uid), | 1053 | plugin->api->update (plugin->api->cls, GNUNET_ntohll (msg->uid), |
1086 | (int32_t) ntohl (msg->priority), | 1054 | (int32_t) ntohl (msg->priority), |
@@ -1101,10 +1069,8 @@ static void | |||
1101 | handle_get_replication (void *cls, struct GNUNET_SERVER_Client *client, | 1069 | handle_get_replication (void *cls, struct GNUNET_SERVER_Client *client, |
1102 | const struct GNUNET_MessageHeader *message) | 1070 | const struct GNUNET_MessageHeader *message) |
1103 | { | 1071 | { |
1104 | #if DEBUG_DATASTORE | ||
1105 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", | 1072 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", |
1106 | "GET_REPLICATION"); | 1073 | "GET_REPLICATION"); |
1107 | #endif | ||
1108 | GNUNET_STATISTICS_update (stats, | 1074 | GNUNET_STATISTICS_update (stats, |
1109 | gettext_noop | 1075 | gettext_noop |
1110 | ("# GET REPLICATION requests received"), 1, | 1076 | ("# GET REPLICATION requests received"), 1, |
@@ -1136,10 +1102,8 @@ handle_get_zero_anonymity (void *cls, struct GNUNET_SERVER_Client *client, | |||
1136 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1102 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1137 | return; | 1103 | return; |
1138 | } | 1104 | } |
1139 | #if DEBUG_DATASTORE | ||
1140 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", | 1105 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", |
1141 | "GET_ZERO_ANONYMITY"); | 1106 | "GET_ZERO_ANONYMITY"); |
1142 | #endif | ||
1143 | GNUNET_STATISTICS_update (stats, | 1107 | GNUNET_STATISTICS_update (stats, |
1144 | gettext_noop | 1108 | gettext_noop |
1145 | ("# GET ZERO ANONYMITY requests received"), 1, | 1109 | ("# GET ZERO ANONYMITY requests received"), 1, |
@@ -1165,19 +1129,15 @@ remove_callback (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
1165 | 1129 | ||
1166 | if (key == NULL) | 1130 | if (key == NULL) |
1167 | { | 1131 | { |
1168 | #if DEBUG_DATASTORE | ||
1169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1132 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1170 | "No further matches for `%s' request.\n", "REMOVE"); | 1133 | "No further matches for `%s' request.\n", "REMOVE"); |
1171 | #endif | ||
1172 | transmit_status (client, GNUNET_NO, _("Content not found")); | 1134 | transmit_status (client, GNUNET_NO, _("Content not found")); |
1173 | GNUNET_SERVER_client_drop (client); | 1135 | GNUNET_SERVER_client_drop (client); |
1174 | return GNUNET_OK; /* last item */ | 1136 | return GNUNET_OK; /* last item */ |
1175 | } | 1137 | } |
1176 | #if DEBUG_DATASTORE | ||
1177 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1138 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1178 | "Item %llu matches `%s' request for key `%s' and type %u.\n", | 1139 | "Item %llu matches `%s' request for key `%s' and type %u.\n", |
1179 | (unsigned long long) uid, "REMOVE", GNUNET_h2s (key), type); | 1140 | (unsigned long long) uid, "REMOVE", GNUNET_h2s (key), type); |
1180 | #endif | ||
1181 | GNUNET_STATISTICS_update (stats, | 1141 | GNUNET_STATISTICS_update (stats, |
1182 | gettext_noop ("# bytes removed (explicit request)"), | 1142 | gettext_noop ("# bytes removed (explicit request)"), |
1183 | size, GNUNET_YES); | 1143 | size, GNUNET_YES); |
@@ -1208,11 +1168,9 @@ handle_remove (void *cls, struct GNUNET_SERVER_Client *client, | |||
1208 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1168 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1209 | return; | 1169 | return; |
1210 | } | 1170 | } |
1211 | #if DEBUG_DATASTORE | ||
1212 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1171 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1213 | "Processing `%s' request for `%s' of type %u\n", "REMOVE", | 1172 | "Processing `%s' request for `%s' of type %u\n", "REMOVE", |
1214 | GNUNET_h2s (&dm->key), ntohl (dm->type)); | 1173 | GNUNET_h2s (&dm->key), ntohl (dm->type)); |
1215 | #endif | ||
1216 | GNUNET_STATISTICS_update (stats, gettext_noop ("# REMOVE requests received"), | 1174 | GNUNET_STATISTICS_update (stats, gettext_noop ("# REMOVE requests received"), |
1217 | 1, GNUNET_NO); | 1175 | 1, GNUNET_NO); |
1218 | GNUNET_SERVER_client_keep (client); | 1176 | GNUNET_SERVER_client_keep (client); |
@@ -1234,9 +1192,7 @@ static void | |||
1234 | handle_drop (void *cls, struct GNUNET_SERVER_Client *client, | 1192 | handle_drop (void *cls, struct GNUNET_SERVER_Client *client, |
1235 | const struct GNUNET_MessageHeader *message) | 1193 | const struct GNUNET_MessageHeader *message) |
1236 | { | 1194 | { |
1237 | #if DEBUG_DATASTORE | ||
1238 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", "DROP"); | 1195 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing `%s' request\n", "DROP"); |
1239 | #endif | ||
1240 | do_drop = GNUNET_YES; | 1196 | do_drop = GNUNET_YES; |
1241 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1197 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1242 | } | 1198 | } |
@@ -1287,11 +1243,9 @@ process_stat_in (void *cls, const char *subsystem, const char *name, | |||
1287 | GNUNET_assert (stats_worked == GNUNET_NO); | 1243 | GNUNET_assert (stats_worked == GNUNET_NO); |
1288 | stats_worked = GNUNET_YES; | 1244 | stats_worked = GNUNET_YES; |
1289 | payload += value; | 1245 | payload += value; |
1290 | #if DEBUG_SQLITE | ||
1291 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1246 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1292 | "Notification from statistics about existing payload (%llu), new payload is %llu\n", | 1247 | "Notification from statistics about existing payload (%llu), new payload is %llu\n", |
1293 | abs_value, payload); | 1248 | value, payload); |
1294 | #endif | ||
1295 | return GNUNET_OK; | 1249 | return GNUNET_OK; |
1296 | } | 1250 | } |
1297 | 1251 | ||
@@ -1348,10 +1302,8 @@ load_plugin () | |||
1348 | static void | 1302 | static void |
1349 | unload_plugin (struct DatastorePlugin *plug) | 1303 | unload_plugin (struct DatastorePlugin *plug) |
1350 | { | 1304 | { |
1351 | #if DEBUG_DATASTORE | ||
1352 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1305 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1353 | "Datastore service is unloading plugin...\n"); | 1306 | "Datastore service is unloading plugin...\n"); |
1354 | #endif | ||
1355 | GNUNET_break (NULL == GNUNET_PLUGIN_unload (plug->lib_name, plug->api)); | 1307 | GNUNET_break (NULL == GNUNET_PLUGIN_unload (plug->lib_name, plug->api)); |
1356 | GNUNET_free (plug->lib_name); | 1308 | GNUNET_free (plug->lib_name); |
1357 | GNUNET_free (plug->short_name); | 1309 | GNUNET_free (plug->short_name); |