-removing legacy ifdefs
authorChristian Grothoff <christian@grothoff.org>
Mon, 2 Apr 2012 13:48:08 +0000 (13:48 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 2 Apr 2012 13:48:08 +0000 (13:48 +0000)
src/peerinfo/gnunet-service-peerinfo.c
src/peerinfo/peerinfo.h
src/peerinfo/peerinfo_api.c
src/peerinfo/peerinfo_api_notify.c

index 2a5921b5d0b6ef8412ad5838775a4167fa716b16..2dbdc9f837f344f5737ec37b9f3591e387e0437d 100644 (file)
@@ -534,10 +534,8 @@ handle_hello (void *cls, struct GNUNET_SERVER_Client *client,
     GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
     return;
   }
-#if DEBUG_PEERINFO
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n",
               "HELLO", GNUNET_i2s (&pid));
-#endif
   bind_address (&pid, hello);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 }
@@ -559,10 +557,8 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
 
   lpm = (const struct ListPeerMessage *) message;
   GNUNET_break (0 == ntohl (lpm->reserved));
-#if DEBUG_PEERINFO
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received for peer `%4s'\n",
               "GET", GNUNET_i2s (&lpm->peer));
-#endif
   tc = GNUNET_SERVER_transmit_context_create (client);
   GNUNET_CONTAINER_multihashmap_get_multiple (hostmap, &lpm->peer.hashPubKey,
                                               &add_to_tc, tc);
@@ -585,9 +581,7 @@ handle_get_all (void *cls, struct GNUNET_SERVER_Client *client,
 {
   struct GNUNET_SERVER_TransmitContext *tc;
 
-#if DEBUG_PEERINFO
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL");
-#endif
   tc = GNUNET_SERVER_transmit_context_create (client);
   GNUNET_CONTAINER_multihashmap_iterate (hostmap, &add_to_tc, tc);
   GNUNET_SERVER_transmit_context_append_data (tc, NULL, 0,
@@ -625,9 +619,7 @@ static void
 handle_notify (void *cls, struct GNUNET_SERVER_Client *client,
                const struct GNUNET_MessageHeader *message)
 {
-#if DEBUG_PEERINFO
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "NOTIFY");
-#endif
   GNUNET_SERVER_notification_context_add (notify_list, client);
   GNUNET_CONTAINER_multihashmap_iterate (hostmap, &do_notify_entry, client);
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
index bf5677477cc66e9531738e7b5929e38eb6d5d72a..919645e17d69fa9983db6ee40f942d3f218fb7c4 100644 (file)
@@ -27,7 +27,6 @@
 #include "gnunet_time_lib.h"
 #include "gnunet_peerinfo_service.h"
 
-#define DEBUG_PEERINFO GNUNET_EXTRA_LOGGING
 
 GNUNET_NETWORK_STRUCT_BEGIN
 
index 124d55e42c94a48094ae80c8f5ac338eb5312950..fed577035787a83989c17a7b8a340bedb24a4ed5 100644 (file)
@@ -274,10 +274,8 @@ do_transmit (void *cls, size_t size, void *buf)
     return 0;
   if (buf == NULL)
   {
-#if DEBUG_PEERINFO
     LOG (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
          _("Failed to transmit message to `%s' service.\n"), "PEERINFO");
-#endif
     GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
     reconnect (h);
     if (tqe->cont != NULL)
@@ -288,10 +286,8 @@ do_transmit (void *cls, size_t size, void *buf)
   ret = tqe->size;
   GNUNET_assert (size >= ret);
   memcpy (buf, &tqe[1], ret);
-#if DEBUG_PEERINFO
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Transmitting request of size %u to `%s' service.\n", ret, "PEERINFO");
-#endif
   GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
   if (tqe->cont != NULL)
     tqe->cont (tqe->cont_cls, GNUNET_OK);
@@ -349,15 +345,12 @@ GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
 {
   uint16_t hs = GNUNET_HELLO_size (hello);
   struct TransmissionQueueEntry *tqe;
-
-#if DEBUG_PEERINFO
   struct GNUNET_PeerIdentity peer;
 
   GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (hello, &peer));
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Adding peer `%s' to PEERINFO database (%u bytes of `%s')\n",
        GNUNET_i2s (&peer), hs, "HELLO");
-#endif
   tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + hs);
   tqe->size = hs;
   tqe->timeout = GNUNET_TIME_UNIT_FOREVER_ABS;
@@ -438,10 +431,8 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
   }
   if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END)
   {
-#if DEBUG_PEERINFO
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Received end of list of peers from `%s' service\n", "PEERINFO");
-#endif
     trigger_transmit (ic->h);
     if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK)
       GNUNET_SCHEDULER_cancel (ic->timeout_task);
@@ -483,12 +474,10 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
       return;
     }
   }
-#if DEBUG_PEERINFO
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Received %u bytes of `%s' information about peer `%s' from `%s' service\n",
        (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), "HELLO",
        GNUNET_i2s (&im->peer), "PEERINFO");
-#endif
   ic->h->in_receive = GNUNET_YES;
   if (ic->callback != NULL)
     ic->callback (ic->callback_cls, &im->peer, hello, NULL);
@@ -524,10 +513,8 @@ iterator_start_receive (void *cls, int transmit_success)
     GNUNET_free (ic);
     return;
   }
-#if DEBUG_PEERINFO
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Waiting for response from `%s' service.\n",
        "PEERINFO");
-#endif
   ic->h->in_receive = GNUNET_YES;
   ic->in_receive = GNUNET_YES;
   ic->tqe = NULL;
@@ -590,10 +577,8 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
 
   if (peer == NULL)
   {
-#if DEBUG_PEERINFO
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Requesting list of peers from PEERINFO service\n");
-#endif
     tqe =
         GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
                        sizeof (struct GNUNET_MessageHeader));
@@ -604,11 +589,9 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
   }
   else
   {
-#if DEBUG_PEERINFO
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Requesting information on peer `%4s' from PEERINFO service\n",
          GNUNET_i2s (peer));
-#endif
     tqe =
         GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
                        sizeof (struct ListPeerMessage));
index a0588db3defcba76beffcef38a493880faa75c71..2557cdfde783a9a2f40fdd21e243cd61a2c4511d 100644 (file)
@@ -161,11 +161,9 @@ process_notification (void *cls, const struct GNUNET_MessageHeader *msg)
       return;
     }
   }
-#if DEBUG_PEERINFO
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Received information about peer `%s' from peerinfo database\n",
        GNUNET_i2s (&im->peer));
-#endif
   nc->callback (nc->callback_cls, &im->peer, hello, NULL);
   receive_notifications (nc);
 }