diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-10 13:38:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-10 13:38:45 +0000 |
commit | 0e20b185f69cff0f1a29dcc902e94ee2f414cf56 (patch) | |
tree | 4af4c278d6b283f19cff1ff7d99f3b9754b18619 /src/datastore | |
parent | aa332fdba373e28ac6b290238bd92ae0ad7f0535 (diff) | |
download | gnunet-0e20b185f69cff0f1a29dcc902e94ee2f414cf56.tar.gz gnunet-0e20b185f69cff0f1a29dcc902e94ee2f414cf56.zip |
use LOG macro in datastore_api.c
Diffstat (limited to 'src/datastore')
-rw-r--r-- | src/datastore/datastore_api.c | 146 |
1 files changed, 68 insertions, 78 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index f8826ce66..3ab3d2503 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include "gnunet_statistics_service.h" | 31 | #include "gnunet_statistics_service.h" |
32 | #include "datastore.h" | 32 | #include "datastore.h" |
33 | 33 | ||
34 | #define LOG(kind,...) GNUNET_log_from (kind, "datastore-api",__VA_ARGS__) | ||
35 | |||
34 | /** | 36 | /** |
35 | * If a client stopped asking for more results, how many more do | 37 | * If a client stopped asking for more results, how many more do |
36 | * we receive from the DB before killing the connection? Trade-off | 38 | * we receive from the DB before killing the connection? Trade-off |
@@ -283,8 +285,8 @@ transmit_drop (void *cls, size_t size, void *buf) | |||
283 | 285 | ||
284 | if (buf == NULL) | 286 | if (buf == NULL) |
285 | { | 287 | { |
286 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 288 | LOG (GNUNET_ERROR_TYPE_WARNING, |
287 | _("Failed to transmit request to drop database.\n")); | 289 | _("Failed to transmit request to drop database.\n")); |
288 | GNUNET_DATASTORE_disconnect (h, GNUNET_NO); | 290 | GNUNET_DATASTORE_disconnect (h, GNUNET_NO); |
289 | return 0; | 291 | return 0; |
290 | } | 292 | } |
@@ -310,7 +312,7 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop) | |||
310 | struct GNUNET_DATASTORE_QueueEntry *qe; | 312 | struct GNUNET_DATASTORE_QueueEntry *qe; |
311 | 313 | ||
312 | #if DEBUG_DATASTORE | 314 | #if DEBUG_DATASTORE |
313 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Datastore disconnect\n"); | 315 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Datastore disconnect\n"); |
314 | #endif | 316 | #endif |
315 | if (NULL != h->th) | 317 | if (NULL != h->th) |
316 | { | 318 | { |
@@ -372,8 +374,7 @@ timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
372 | qe->task = GNUNET_SCHEDULER_NO_TASK; | 374 | qe->task = GNUNET_SCHEDULER_NO_TASK; |
373 | GNUNET_assert (qe->was_transmitted == GNUNET_NO); | 375 | GNUNET_assert (qe->was_transmitted == GNUNET_NO); |
374 | #if DEBUG_DATASTORE | 376 | #if DEBUG_DATASTORE |
375 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 377 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Timeout of request in datastore queue\n"); |
376 | "Timeout of request in datastore queue\n"); | ||
377 | #endif | 378 | #endif |
378 | qe->response_proc (qe->h, NULL); | 379 | qe->response_proc (qe->h, NULL); |
379 | } | 380 | } |
@@ -455,8 +456,7 @@ make_queue_entry (struct GNUNET_DATASTORE_Handle *h, size_t msize, | |||
455 | /* move 'pos' element to head so that it will be | 456 | /* move 'pos' element to head so that it will be |
456 | * killed on 'NULL' call below */ | 457 | * killed on 'NULL' call below */ |
457 | #if DEBUG_DATASTORE | 458 | #if DEBUG_DATASTORE |
458 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 459 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Dropping request from datastore queue\n"); |
459 | "Dropping request from datastore queue\n"); | ||
460 | #endif | 460 | #endif |
461 | GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, pos); | 461 | GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, pos); |
462 | GNUNET_CONTAINER_DLL_insert (h->queue_head, h->queue_tail, pos); | 462 | GNUNET_CONTAINER_DLL_insert (h->queue_head, h->queue_tail, pos); |
@@ -505,8 +505,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
505 | h->client = GNUNET_CLIENT_connect ("datastore", h->cfg); | 505 | h->client = GNUNET_CLIENT_connect ("datastore", h->cfg); |
506 | if (h->client == NULL) | 506 | if (h->client == NULL) |
507 | { | 507 | { |
508 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 508 | LOG (GNUNET_ERROR_TYPE_ERROR, "DATASTORE reconnect failed (fatally)\n"); |
509 | "DATASTORE reconnect failed (fatally)\n"); | ||
510 | return; | 509 | return; |
511 | } | 510 | } |
512 | GNUNET_STATISTICS_update (h->stats, | 511 | GNUNET_STATISTICS_update (h->stats, |
@@ -514,7 +513,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
514 | ("# datastore connections (re)created"), 1, | 513 | ("# datastore connections (re)created"), 1, |
515 | GNUNET_NO); | 514 | GNUNET_NO); |
516 | #if DEBUG_DATASTORE | 515 | #if DEBUG_DATASTORE |
517 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Reconnected to DATASTORE\n"); | 516 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Reconnected to DATASTORE\n"); |
518 | #endif | 517 | #endif |
519 | process_queue (h); | 518 | process_queue (h); |
520 | } | 519 | } |
@@ -532,8 +531,8 @@ do_disconnect (struct GNUNET_DATASTORE_Handle *h) | |||
532 | if (h->client == NULL) | 531 | if (h->client == NULL) |
533 | { | 532 | { |
534 | #if DEBUG_DATASTORE | 533 | #if DEBUG_DATASTORE |
535 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 534 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
536 | "client NULL in disconnect, will not try to reconnect\n"); | 535 | "client NULL in disconnect, will not try to reconnect\n"); |
537 | #endif | 536 | #endif |
538 | return; | 537 | return; |
539 | } | 538 | } |
@@ -564,7 +563,7 @@ receive_cb (void *cls, const struct GNUNET_MessageHeader *msg) | |||
564 | 563 | ||
565 | h->in_receive = GNUNET_NO; | 564 | h->in_receive = GNUNET_NO; |
566 | #if DEBUG_DATASTORE | 565 | #if DEBUG_DATASTORE |
567 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving reply from datastore\n"); | 566 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving reply from datastore\n"); |
568 | #endif | 567 | #endif |
569 | if (h->skip_next_messages > 0) | 568 | if (h->skip_next_messages > 0) |
570 | { | 569 | { |
@@ -602,8 +601,8 @@ transmit_request (void *cls, size_t size, void *buf) | |||
602 | return 0; /* no entry in queue */ | 601 | return 0; /* no entry in queue */ |
603 | if (buf == NULL) | 602 | if (buf == NULL) |
604 | { | 603 | { |
605 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 604 | LOG (GNUNET_ERROR_TYPE_WARNING, |
606 | _("Failed to transmit request to DATASTORE.\n")); | 605 | _("Failed to transmit request to DATASTORE.\n")); |
607 | GNUNET_STATISTICS_update (h->stats, | 606 | GNUNET_STATISTICS_update (h->stats, |
608 | gettext_noop ("# transmission request failures"), | 607 | gettext_noop ("# transmission request failures"), |
609 | 1, GNUNET_NO); | 608 | 1, GNUNET_NO); |
@@ -616,8 +615,8 @@ transmit_request (void *cls, size_t size, void *buf) | |||
616 | return 0; | 615 | return 0; |
617 | } | 616 | } |
618 | #if DEBUG_DATASTORE | 617 | #if DEBUG_DATASTORE |
619 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 618 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting %u byte request to DATASTORE\n", |
620 | "Transmitting %u byte request to DATASTORE\n", msize); | 619 | msize); |
621 | #endif | 620 | #endif |
622 | memcpy (buf, &qe[1], msize); | 621 | memcpy (buf, &qe[1], msize); |
623 | qe->was_transmitted = GNUNET_YES; | 622 | qe->was_transmitted = GNUNET_YES; |
@@ -648,28 +647,28 @@ process_queue (struct GNUNET_DATASTORE_Handle *h) | |||
648 | if (NULL == (qe = h->queue_head)) | 647 | if (NULL == (qe = h->queue_head)) |
649 | { | 648 | { |
650 | #if DEBUG_DATASTORE > 1 | 649 | #if DEBUG_DATASTORE > 1 |
651 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Queue empty\n"); | 650 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Queue empty\n"); |
652 | #endif | 651 | #endif |
653 | return; /* no entry in queue */ | 652 | return; /* no entry in queue */ |
654 | } | 653 | } |
655 | if (qe->was_transmitted == GNUNET_YES) | 654 | if (qe->was_transmitted == GNUNET_YES) |
656 | { | 655 | { |
657 | #if DEBUG_DATASTORE > 1 | 656 | #if DEBUG_DATASTORE > 1 |
658 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Head request already transmitted\n"); | 657 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Head request already transmitted\n"); |
659 | #endif | 658 | #endif |
660 | return; /* waiting for replies */ | 659 | return; /* waiting for replies */ |
661 | } | 660 | } |
662 | if (h->th != NULL) | 661 | if (h->th != NULL) |
663 | { | 662 | { |
664 | #if DEBUG_DATASTORE > 1 | 663 | #if DEBUG_DATASTORE > 1 |
665 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Pending transmission request\n"); | 664 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Pending transmission request\n"); |
666 | #endif | 665 | #endif |
667 | return; /* request pending */ | 666 | return; /* request pending */ |
668 | } | 667 | } |
669 | if (h->client == NULL) | 668 | if (h->client == NULL) |
670 | { | 669 | { |
671 | #if DEBUG_DATASTORE > 1 | 670 | #if DEBUG_DATASTORE > 1 |
672 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Not connected\n"); | 671 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Not connected\n"); |
673 | #endif | 672 | #endif |
674 | return; /* waiting for reconnect */ | 673 | return; /* waiting for reconnect */ |
675 | } | 674 | } |
@@ -679,8 +678,8 @@ process_queue (struct GNUNET_DATASTORE_Handle *h) | |||
679 | return; | 678 | return; |
680 | } | 679 | } |
681 | #if DEBUG_DATASTORE | 680 | #if DEBUG_DATASTORE |
682 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 681 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Queueing %u byte request to DATASTORE\n", |
683 | "Queueing %u byte request to DATASTORE\n", qe->message_size); | 682 | qe->message_size); |
684 | #endif | 683 | #endif |
685 | h->th = | 684 | h->th = |
686 | GNUNET_CLIENT_notify_transmit_ready (h->client, qe->message_size, | 685 | GNUNET_CLIENT_notify_transmit_ready (h->client, qe->message_size, |
@@ -799,8 +798,7 @@ process_status_message (void *cls, const struct GNUNET_MessageHeader *msg) | |||
799 | emsg = _("Invalid error message received from datastore service"); | 798 | emsg = _("Invalid error message received from datastore service"); |
800 | } | 799 | } |
801 | #if DEBUG_DATASTORE | 800 | #if DEBUG_DATASTORE |
802 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received status %d/%s\n", (int) status, | 801 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Received status %d/%s\n", (int) status, emsg); |
803 | emsg); | ||
804 | #endif | 802 | #endif |
805 | GNUNET_STATISTICS_update (h->stats, | 803 | GNUNET_STATISTICS_update (h->stats, |
806 | gettext_noop ("# status messages received"), 1, | 804 | gettext_noop ("# status messages received"), 1, |
@@ -856,10 +854,10 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid, | |||
856 | union QueueContext qc; | 854 | union QueueContext qc; |
857 | 855 | ||
858 | #if DEBUG_DATASTORE | 856 | #if DEBUG_DATASTORE |
859 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 857 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
860 | "Asked to put %u bytes of data under key `%s' for %llu ms\n", | 858 | "Asked to put %u bytes of data under key `%s' for %llu ms\n", size, |
861 | size, GNUNET_h2s (key), | 859 | GNUNET_h2s (key), |
862 | GNUNET_TIME_absolute_get_remaining (expiration).rel_value); | 860 | GNUNET_TIME_absolute_get_remaining (expiration).rel_value); |
863 | #endif | 861 | #endif |
864 | msize = sizeof (struct DataMessage) + size; | 862 | msize = sizeof (struct DataMessage) + size; |
865 | GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE); | 863 | GNUNET_assert (msize < GNUNET_SERVER_MAX_MESSAGE_SIZE); |
@@ -870,8 +868,7 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid, | |||
870 | if (qe == NULL) | 868 | if (qe == NULL) |
871 | { | 869 | { |
872 | #if DEBUG_DATASTORE | 870 | #if DEBUG_DATASTORE |
873 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 871 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Could not create queue entry for PUT\n"); |
874 | "Could not create queue entry for PUT\n"); | ||
875 | #endif | 872 | #endif |
876 | return NULL; | 873 | return NULL; |
877 | } | 874 | } |
@@ -930,9 +927,9 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, uint64_t amount, | |||
930 | if (cont == NULL) | 927 | if (cont == NULL) |
931 | cont = &drop_status_cont; | 928 | cont = &drop_status_cont; |
932 | #if DEBUG_DATASTORE | 929 | #if DEBUG_DATASTORE |
933 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 930 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
934 | "Asked to reserve %llu bytes of data and %u entries\n", | 931 | "Asked to reserve %llu bytes of data and %u entries\n", |
935 | (unsigned long long) amount, (unsigned int) entries); | 932 | (unsigned long long) amount, (unsigned int) entries); |
936 | #endif | 933 | #endif |
937 | qc.sc.cont = cont; | 934 | qc.sc.cont = cont; |
938 | qc.sc.cont_cls = cont_cls; | 935 | qc.sc.cont_cls = cont_cls; |
@@ -941,8 +938,7 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, uint64_t amount, | |||
941 | if (qe == NULL) | 938 | if (qe == NULL) |
942 | { | 939 | { |
943 | #if DEBUG_DATASTORE | 940 | #if DEBUG_DATASTORE |
944 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 941 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Could not create queue entry to reserve\n"); |
945 | "Could not create queue entry to reserve\n"); | ||
946 | #endif | 942 | #endif |
947 | return NULL; | 943 | return NULL; |
948 | } | 944 | } |
@@ -995,7 +991,7 @@ GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
995 | if (cont == NULL) | 991 | if (cont == NULL) |
996 | cont = &drop_status_cont; | 992 | cont = &drop_status_cont; |
997 | #if DEBUG_DATASTORE | 993 | #if DEBUG_DATASTORE |
998 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asked to release reserve %d\n", rid); | 994 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Asked to release reserve %d\n", rid); |
999 | #endif | 995 | #endif |
1000 | qc.sc.cont = cont; | 996 | qc.sc.cont = cont; |
1001 | qc.sc.cont_cls = cont_cls; | 997 | qc.sc.cont_cls = cont_cls; |
@@ -1005,8 +1001,8 @@ GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, | |||
1005 | if (qe == NULL) | 1001 | if (qe == NULL) |
1006 | { | 1002 | { |
1007 | #if DEBUG_DATASTORE | 1003 | #if DEBUG_DATASTORE |
1008 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1004 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1009 | "Could not create queue entry to release reserve\n"); | 1005 | "Could not create queue entry to release reserve\n"); |
1010 | #endif | 1006 | #endif |
1011 | return NULL; | 1007 | return NULL; |
1012 | } | 1008 | } |
@@ -1057,10 +1053,9 @@ GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, uint64_t uid, | |||
1057 | if (cont == NULL) | 1053 | if (cont == NULL) |
1058 | cont = &drop_status_cont; | 1054 | cont = &drop_status_cont; |
1059 | #if DEBUG_DATASTORE | 1055 | #if DEBUG_DATASTORE |
1060 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1056 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1061 | "Asked to update entry %llu raising priority by %u and expiration to %llu\n", | 1057 | "Asked to update entry %llu raising priority by %u and expiration to %llu\n", |
1062 | uid, (unsigned int) priority, | 1058 | uid, (unsigned int) priority, (unsigned long long) expiration.abs_value); |
1063 | (unsigned long long) expiration.abs_value); | ||
1064 | #endif | 1059 | #endif |
1065 | qc.sc.cont = cont; | 1060 | qc.sc.cont = cont; |
1066 | qc.sc.cont_cls = cont_cls; | 1061 | qc.sc.cont_cls = cont_cls; |
@@ -1069,8 +1064,7 @@ GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, uint64_t uid, | |||
1069 | if (qe == NULL) | 1064 | if (qe == NULL) |
1070 | { | 1065 | { |
1071 | #if DEBUG_DATASTORE | 1066 | #if DEBUG_DATASTORE |
1072 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1067 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Could not create queue entry for UPDATE\n"); |
1073 | "Could not create queue entry for UPDATE\n"); | ||
1074 | #endif | 1068 | #endif |
1075 | return NULL; | 1069 | return NULL; |
1076 | } | 1070 | } |
@@ -1126,9 +1120,8 @@ GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, | |||
1126 | if (cont == NULL) | 1120 | if (cont == NULL) |
1127 | cont = &drop_status_cont; | 1121 | cont = &drop_status_cont; |
1128 | #if DEBUG_DATASTORE | 1122 | #if DEBUG_DATASTORE |
1129 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1123 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Asked to remove %u bytes under key `%s'\n", |
1130 | "Asked to remove %u bytes under key `%s'\n", size, | 1124 | size, GNUNET_h2s (key)); |
1131 | GNUNET_h2s (key)); | ||
1132 | #endif | 1125 | #endif |
1133 | qc.sc.cont = cont; | 1126 | qc.sc.cont = cont; |
1134 | qc.sc.cont_cls = cont_cls; | 1127 | qc.sc.cont_cls = cont_cls; |
@@ -1139,8 +1132,7 @@ GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, | |||
1139 | if (qe == NULL) | 1132 | if (qe == NULL) |
1140 | { | 1133 | { |
1141 | #if DEBUG_DATASTORE | 1134 | #if DEBUG_DATASTORE |
1142 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1135 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Could not create queue entry for REMOVE\n"); |
1143 | "Could not create queue entry for REMOVE\n"); | ||
1144 | #endif | 1136 | #endif |
1145 | return NULL; | 1137 | return NULL; |
1146 | } | 1138 | } |
@@ -1189,8 +1181,8 @@ process_result_message (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1189 | free_queue_entry (qe); | 1181 | free_queue_entry (qe); |
1190 | if (was_transmitted == GNUNET_YES) | 1182 | if (was_transmitted == GNUNET_YES) |
1191 | { | 1183 | { |
1192 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1184 | LOG (GNUNET_ERROR_TYPE_WARNING, |
1193 | _("Failed to receive response from database.\n")); | 1185 | _("Failed to receive response from database.\n")); |
1194 | do_disconnect (h); | 1186 | do_disconnect (h); |
1195 | } | 1187 | } |
1196 | else | 1188 | else |
@@ -1210,9 +1202,8 @@ process_result_message (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1210 | GNUNET_assert (GNUNET_YES == qe->was_transmitted); | 1202 | GNUNET_assert (GNUNET_YES == qe->was_transmitted); |
1211 | free_queue_entry (qe); | 1203 | free_queue_entry (qe); |
1212 | #if DEBUG_DATASTORE | 1204 | #if DEBUG_DATASTORE |
1213 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1205 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1214 | "Received end of result set, new queue size is %u\n", | 1206 | "Received end of result set, new queue size is %u\n", h->queue_size); |
1215 | h->queue_size); | ||
1216 | #endif | 1207 | #endif |
1217 | if (rc.proc != NULL) | 1208 | if (rc.proc != NULL) |
1218 | rc.proc (rc.proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, | 1209 | rc.proc (rc.proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, |
@@ -1255,10 +1246,10 @@ process_result_message (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1255 | GNUNET_NO); | 1246 | GNUNET_NO); |
1256 | dm = (const struct DataMessage *) msg; | 1247 | dm = (const struct DataMessage *) msg; |
1257 | #if DEBUG_DATASTORE | 1248 | #if DEBUG_DATASTORE |
1258 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1249 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1259 | "Received result %llu with type %u and size %u with key %s\n", | 1250 | "Received result %llu with type %u and size %u with key %s\n", |
1260 | (unsigned long long) GNUNET_ntohll (dm->uid), ntohl (dm->type), | 1251 | (unsigned long long) GNUNET_ntohll (dm->uid), ntohl (dm->type), |
1261 | ntohl (dm->size), GNUNET_h2s (&dm->key)); | 1252 | ntohl (dm->size), GNUNET_h2s (&dm->key)); |
1262 | #endif | 1253 | #endif |
1263 | free_queue_entry (qe); | 1254 | free_queue_entry (qe); |
1264 | h->retry_time.rel_value = 0; | 1255 | h->retry_time.rel_value = 0; |
@@ -1304,9 +1295,8 @@ GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, | |||
1304 | 1295 | ||
1305 | GNUNET_assert (NULL != proc); | 1296 | GNUNET_assert (NULL != proc); |
1306 | #if DEBUG_DATASTORE | 1297 | #if DEBUG_DATASTORE |
1307 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1298 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Asked to get replication entry in %llu ms\n", |
1308 | "Asked to get replication entry in %llu ms\n", | 1299 | (unsigned long long) timeout.rel_value); |
1309 | (unsigned long long) timeout.rel_value); | ||
1310 | #endif | 1300 | #endif |
1311 | qc.rc.proc = proc; | 1301 | qc.rc.proc = proc; |
1312 | qc.rc.proc_cls = proc_cls; | 1302 | qc.rc.proc_cls = proc_cls; |
@@ -1316,8 +1306,8 @@ GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, | |||
1316 | if (qe == NULL) | 1306 | if (qe == NULL) |
1317 | { | 1307 | { |
1318 | #if DEBUG_DATASTORE | 1308 | #if DEBUG_DATASTORE |
1319 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1309 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1320 | "Could not create queue entry for GET REPLICATION\n"); | 1310 | "Could not create queue entry for GET REPLICATION\n"); |
1321 | #endif | 1311 | #endif |
1322 | return NULL; | 1312 | return NULL; |
1323 | } | 1313 | } |
@@ -1370,10 +1360,10 @@ GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, | |||
1370 | GNUNET_assert (NULL != proc); | 1360 | GNUNET_assert (NULL != proc); |
1371 | GNUNET_assert (type != GNUNET_BLOCK_TYPE_ANY); | 1361 | GNUNET_assert (type != GNUNET_BLOCK_TYPE_ANY); |
1372 | #if DEBUG_DATASTORE | 1362 | #if DEBUG_DATASTORE |
1373 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1363 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1374 | "Asked to get %llu-th zero-anonymity entry of type %d in %llu ms\n", | 1364 | "Asked to get %llu-th zero-anonymity entry of type %d in %llu ms\n", |
1375 | (unsigned long long) offset, type, | 1365 | (unsigned long long) offset, type, |
1376 | (unsigned long long) timeout.rel_value); | 1366 | (unsigned long long) timeout.rel_value); |
1377 | #endif | 1367 | #endif |
1378 | qc.rc.proc = proc; | 1368 | qc.rc.proc = proc; |
1379 | qc.rc.proc_cls = proc_cls; | 1369 | qc.rc.proc_cls = proc_cls; |
@@ -1383,8 +1373,8 @@ GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, | |||
1383 | if (qe == NULL) | 1373 | if (qe == NULL) |
1384 | { | 1374 | { |
1385 | #if DEBUG_DATASTORE | 1375 | #if DEBUG_DATASTORE |
1386 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1376 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1387 | "Could not create queue entry for zero-anonymity procation\n"); | 1377 | "Could not create queue entry for zero-anonymity procation\n"); |
1388 | #endif | 1378 | #endif |
1389 | return NULL; | 1379 | return NULL; |
1390 | } | 1380 | } |
@@ -1438,9 +1428,9 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, uint64_t offset, | |||
1438 | 1428 | ||
1439 | GNUNET_assert (NULL != proc); | 1429 | GNUNET_assert (NULL != proc); |
1440 | #if DEBUG_DATASTORE | 1430 | #if DEBUG_DATASTORE |
1441 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1431 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1442 | "Asked to look for data of type %u under key `%s'\n", | 1432 | "Asked to look for data of type %u under key `%s'\n", |
1443 | (unsigned int) type, GNUNET_h2s (key)); | 1433 | (unsigned int) type, GNUNET_h2s (key)); |
1444 | #endif | 1434 | #endif |
1445 | qc.rc.proc = proc; | 1435 | qc.rc.proc = proc; |
1446 | qc.rc.proc_cls = proc_cls; | 1436 | qc.rc.proc_cls = proc_cls; |
@@ -1449,8 +1439,8 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, uint64_t offset, | |||
1449 | if (qe == NULL) | 1439 | if (qe == NULL) |
1450 | { | 1440 | { |
1451 | #if DEBUG_DATASTORE | 1441 | #if DEBUG_DATASTORE |
1452 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Could not queue request for `%s'\n", | 1442 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Could not queue request for `%s'\n", |
1453 | GNUNET_h2s (key)); | 1443 | GNUNET_h2s (key)); |
1454 | #endif | 1444 | #endif |
1455 | return NULL; | 1445 | return NULL; |
1456 | } | 1446 | } |
@@ -1489,9 +1479,9 @@ GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe) | |||
1489 | GNUNET_assert (GNUNET_SYSERR != qe->was_transmitted); | 1479 | GNUNET_assert (GNUNET_SYSERR != qe->was_transmitted); |
1490 | h = qe->h; | 1480 | h = qe->h; |
1491 | #if DEBUG_DATASTORE | 1481 | #if DEBUG_DATASTORE |
1492 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1482 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1493 | "Pending DATASTORE request %p cancelled (%d, %d)\n", qe, | 1483 | "Pending DATASTORE request %p cancelled (%d, %d)\n", qe, |
1494 | qe->was_transmitted, h->queue_head == qe); | 1484 | qe->was_transmitted, h->queue_head == qe); |
1495 | #endif | 1485 | #endif |
1496 | if (GNUNET_YES == qe->was_transmitted) | 1486 | if (GNUNET_YES == qe->was_transmitted) |
1497 | { | 1487 | { |