From d6cf94d0e01acaef84292a052c2cc045dfd7d0b2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 20 Oct 2010 13:17:43 +0000 Subject: [PATCH] logging --- src/datastore/datastore_api.c | 40 ++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index 58340ed6c..abc8c7645 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c @@ -799,7 +799,13 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, queue_priority, max_queue_size, timeout, &process_status_message, &qc); if (qe == NULL) - return NULL; + { +#if DEBUG_DATASTORE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Could not create queue entry for PUT\n"); +#endif + return NULL; + } dm = (struct DataMessage* ) &qe[1]; dm->header.type = htons(GNUNET_MESSAGE_TYPE_DATASTORE_PUT); dm->header.size = htons(msize); @@ -864,7 +870,13 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, queue_priority, max_queue_size, timeout, &process_status_message, &qc); if (qe == NULL) - return NULL; + { +#if DEBUG_DATASTORE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Could not create queue entry to reserve\n"); +#endif + return NULL; + } rm = (struct ReserveMessage*) &qe[1]; rm->header.type = htons(GNUNET_MESSAGE_TYPE_DATASTORE_RESERVE); rm->header.size = htons(sizeof (struct ReserveMessage)); @@ -922,7 +934,13 @@ GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, queue_priority, max_queue_size, timeout, &process_status_message, &qc); if (qe == NULL) - return NULL; + { +#if DEBUG_DATASTORE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Could not create queue entry to release reserve\n"); +#endif + return NULL; + } rrm = (struct ReleaseReserveMessage*) &qe[1]; rrm->header.type = htons(GNUNET_MESSAGE_TYPE_DATASTORE_RELEASE_RESERVE); rrm->header.size = htons(sizeof (struct ReleaseReserveMessage)); @@ -979,7 +997,13 @@ GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, queue_priority, max_queue_size, timeout, &process_status_message, &qc); if (qe == NULL) - return NULL; + { +#if DEBUG_DATASTORE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Could not create queue entry for UPDATE\n"); +#endif + return NULL; + } um = (struct UpdateMessage*) &qe[1]; um->header.type = htons(GNUNET_MESSAGE_TYPE_DATASTORE_UPDATE); um->header.size = htons(sizeof (struct UpdateMessage)); @@ -1256,7 +1280,13 @@ GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, queue_priority, max_queue_size, timeout, &process_result_message, &qc); if (qe == NULL) - return NULL; + { +#if DEBUG_DATASTORE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Could not create queue entry for zero-anonymity iteration\n"); +#endif + return NULL; + } m = (struct GetZeroAnonymityMessage*) &qe[1]; m->header.type = htons(GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM); m->header.size = htons(sizeof (struct GetZeroAnonymityMessage)); -- 2.25.1