From 815a39088f8f33eece015c371cd4f3a9115f4cc8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 10 Oct 2011 12:48:35 +0000 Subject: [PATCH] cleaner --- src/core/core.h | 10 +++++----- src/core/gnunet-service-core.h | 4 +--- src/core/gnunet-service-core_clients.c | 10 +++++----- src/core/gnunet-service-core_sessions.c | 5 ++--- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/core/core.h b/src/core/core.h index abbe9acc0..8c97f6177 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -23,7 +23,11 @@ * @brief common internal definitions for core service * @author Christian Grothoff */ +#ifndef CORE_H +#define CORE_H + #include "gnunet_bandwidth_lib.h" +#include "gnunet_transport_service.h" #include "gnunet_crypto_lib.h" #include "gnunet_time_lib.h" @@ -32,11 +36,6 @@ */ #define DEBUG_CORE GNUNET_EXTRA_LOGGING -/** - * Debugging interaction core-clients. - */ -#define DEBUG_CORE_CLIENT GNUNET_EXTRA_LOGGING - /** * Definition of bits in the InitMessage's options field that specify * which events this client cares about. Note that inbound messages @@ -383,4 +382,5 @@ struct ConnectMessage }; +#endif /* end of core.h */ diff --git a/src/core/gnunet-service-core.h b/src/core/gnunet-service-core.h index 2d5156efe..d4e43a457 100644 --- a/src/core/gnunet-service-core.h +++ b/src/core/gnunet-service-core.h @@ -27,9 +27,7 @@ #define GNUNET_SERVICE_CORE_H #include "gnunet_statistics_service.h" - - -#define DEBUG_CORE GNUNET_EXTRA_LOGGING +#include "core.h" /** * Opaque handle to a client. diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c index c9eb587b5..0b1616c97 100644 --- a/src/core/gnunet-service-core_clients.c +++ b/src/core/gnunet-service-core_clients.c @@ -141,7 +141,7 @@ send_to_client (struct GSC_Client *client, const struct GNUNET_MessageHeader *msg, int can_drop) { -#if DEBUG_CORE_CLIENT +#if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Preparing to send %u bytes of message of type %u to client.\n", (unsigned int) ntohs (msg->size), @@ -220,7 +220,7 @@ send_to_all_clients (const struct GNUNET_MessageHeader *msg, ( (0 != (options & GNUNET_CORE_OPTION_SEND_FULL_INBOUND)) && (GNUNET_YES == type_match (type, c)) ) ) ) continue; /* skip */ -#if DEBUG_CORE_CLIENT > 1 +#if DEBUG_CORE > 1 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending message of type %u to client.\n", (unsigned int) ntohs (msg->type)); @@ -280,7 +280,7 @@ handle_client_init (void *cls, struct GNUNET_SERVER_Client *client, GNUNET_CONTAINER_DLL_insert (client_head, client_tail, c); -#if DEBUG_CORE_CLIENT +#if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client connecting to core service is interested in %u message types\n", (unsigned int) c->tcnt); @@ -504,7 +504,7 @@ handle_client_disconnect (void *cls, if (client == NULL) return; -#if DEBUG_CORE_CLIENT +#if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Client %p has disconnected from core service.\n", client); #endif @@ -619,7 +619,7 @@ GDS_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client, sizeof (struct GNUNET_TRANSPORT_ATS_Information) * atsi_count); a[atsi_count].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); a[atsi_count].value = htonl (0); -#if DEBUG_CORE_CLIENT +#if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message to client.\n", "NOTIFY_CONNECT"); diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c index a1b40129c..5ea3210c7 100644 --- a/src/core/gnunet-service-core_sessions.c +++ b/src/core/gnunet-service-core_sessions.c @@ -32,7 +32,6 @@ #include "gnunet-service-core_clients.h" #include "gnunet_constants.h" - /** * Message ready for encryption. This struct is followed by the * actual content of the message. @@ -301,7 +300,7 @@ GSC_SESSIONS_queue_request (struct GSC_ClientActiveRequest *car) /* neighbour must have disconnected since request was issued, * ignore (client will realize it once it processes the * disconnect notification) */ -#if DEBUG_CORE_CLIENT +#if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Dropped client request for transmission (am disconnected)\n"); #endif @@ -318,7 +317,7 @@ GSC_SESSIONS_queue_request (struct GSC_ClientActiveRequest *car) GSC_CLIENTS_reject_request (car); return; } -#if DEBUG_CORE_CLIENT +#if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received client transmission request. queueing\n"); #endif -- 2.25.1