-die ifdefs, die
authorChristian Grothoff <christian@grothoff.org>
Sat, 18 Feb 2012 18:57:46 +0000 (18:57 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 18 Feb 2012 18:57:46 +0000 (18:57 +0000)
src/dht/dht_api.c
src/dht/test_dht_api.c

index d53728fa9c32d2a493ce6ad33665cc89db00c4ea..3cb13b4f9998f41125506c5f6eaaf1a80bfc1bab 100644 (file)
@@ -34,8 +34,6 @@
 #include "gnunet_dht_service.h"
 #include "dht.h"
 
-#define DEBUG_DHT_API GNUNET_EXTRA_LOGGING
-
 #define LOG(kind,...) GNUNET_log_from (kind, "dht-api",__VA_ARGS__)
 
 /**
@@ -303,11 +301,9 @@ add_request_to_pending (void *cls, const GNUNET_HashCode * key, void *value)
 
   if (GNUNET_NO == rh->message->in_pending_queue)
   {
-#if DEBUG_DHT
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Retransmitting request related to %s to DHT %p\n", GNUNET_h2s (key),
          handle);
-#endif
     GNUNET_CONTAINER_DLL_insert (handle->pending_head, handle->pending_tail,
                                  rh->message);
     rh->message->in_pending_queue = GNUNET_YES;
@@ -335,9 +331,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_DHT_Handle *handle = cls;
 
-#if DEBUG_DHT
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Reconnecting with DHT %p\n", handle);
-#endif
   handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
   if (handle->retry_time.rel_value < GNUNET_CONSTANTS_SERVICE_RETRY.rel_value)
     handle->retry_time = GNUNET_CONSTANTS_SERVICE_RETRY;
@@ -348,9 +342,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
   if (GNUNET_YES != try_connect (handle))
   {
-#if DEBUG_DHT
     LOG (GNUNET_ERROR_TYPE_DEBUG, "dht reconnect failed(!)\n");
-#endif
     return;
   }
   GNUNET_CONTAINER_multihashmap_iterate (handle->active_requests,
@@ -435,11 +427,9 @@ transmit_pending (void *cls, size_t size, void *buf)
 
   handle->th = NULL;
   if (buf == NULL)
-  {
-#if DEBUG_DHT
+  {    
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Transmission to DHT service failed!  Reconnecting!\n");
-#endif
     do_disconnect (handle);
     return 0;
   }
@@ -470,15 +460,11 @@ transmit_pending (void *cls, size_t size, void *buf)
   if (GNUNET_YES == head->free_on_send)
     GNUNET_free (head);
   process_pending_messages (handle);
-#if DEBUG_DHT
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Forwarded request of %u bytes to DHT service\n", (unsigned int) tsize);
-#endif
   if (GNUNET_NO == handle->in_receive)
   {
-#if DEBUG_DHT
     LOG (GNUNET_ERROR_TYPE_DEBUG, "Starting to process replies from DHT\n");
-#endif
     handle->in_receive = GNUNET_YES;
     GNUNET_CLIENT_receive (handle->client, &service_message_handler, handle,
                            GNUNET_TIME_UNIT_FOREVER_REL);
@@ -514,11 +500,9 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
   if (dht_msg->unique_id != get_handle->unique_id)
   {
     /* UID mismatch */
-#if DEBUG_DHT
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Ignoring reply for %s: UID mismatch: %llu/%llu\n", GNUNET_h2s (key),
          dht_msg->unique_id, get_handle->unique_id);
-#endif
     return GNUNET_YES;
   }
   msize = ntohs (dht_msg->header.size);
@@ -537,10 +521,8 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value)
     return GNUNET_NO;
   }
   data_length = msize - meta_length;
-#if DEBUG_DHT
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Giving %u byte reply for %s to application\n",
        (unsigned int) data_length, GNUNET_h2s (key));
-#endif
   put_path = (const struct GNUNET_PeerIdentity *) &dht_msg[1];
   get_path = &put_path[put_path_length];
   data = &get_path[get_path_length];
@@ -623,10 +605,8 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
 
   if (msg == NULL)
   {
-#if DEBUG_DHT
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Error receiving data from DHT service, reconnecting\n");
-#endif
     do_disconnect (handle);
     return;
   }
@@ -649,10 +629,8 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
     return;
   }
   dht_msg = (const struct GNUNET_DHT_ClientResultMessage *) msg;
-#if DEBUG_DHT
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Received reply for `%s' from DHT service %p\n",
        GNUNET_h2s (&dht_msg->key), handle);
-#endif
   GNUNET_CONTAINER_multihashmap_get_multiple (handle->active_requests,
                                               &dht_msg->key, &process_reply,
                                               (void *) dht_msg);
@@ -856,10 +834,8 @@ GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle,
     GNUNET_break (0);
     return NULL;
   }
-#if DEBUG_DHT
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Sending query for %s to DHT %p\n",
        GNUNET_h2s (key), handle);
-#endif
   pending = GNUNET_malloc (sizeof (struct PendingMessage) + msize);
   get_msg = (struct GNUNET_DHT_ClientGetMessage *) &pending[1];
   pending->msg = &get_msg->header;
@@ -905,10 +881,8 @@ GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle)
   handle = get_handle->message->handle;
   get_msg =
       (const struct GNUNET_DHT_ClientGetMessage *) get_handle->message->msg;
-#if DEBUG_DHT
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Sending STOP for %s to DHT via %p\n",
        GNUNET_h2s (&get_msg->key), handle);
-#endif
   /* generate STOP */
   pending =
       GNUNET_malloc (sizeof (struct PendingMessage) +
index 4ec2f2ae9664a3a95367ec59fc12ac903f6b6205..b31cd1a72198c15e4423d6ebc9fcf85defd96223 100644 (file)
@@ -34,9 +34,9 @@
 #include "gnunet_dht_service.h"
 #include "gnunet_hello_lib.h"
 
-#define VERBOSE GNUNET_EXTRA_LOGGING
+#define VERBOSE GNUNET_NO
 
-#define VERBOSE_ARM GNUNET_EXTRA_LOGGING
+#define VERBOSE_ARM GNUNET_NO
 
 #define START_ARM GNUNET_YES