aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-10 13:40:47 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-10 13:40:47 +0000
commit6d995ee0957535b2cb71a8e529fb47de54870346 (patch)
tree899a1ca8a7857d2cfa3e2345614d1ad5122b9cca /src/peerinfo
parentf777b26daef27327d4ef692cef1612d5d30ae0ea (diff)
downloadgnunet-6d995ee0957535b2cb71a8e529fb47de54870346.tar.gz
gnunet-6d995ee0957535b2cb71a8e529fb47de54870346.zip
use LOG macro in peerinfo_api.c
Diffstat (limited to 'src/peerinfo')
-rw-r--r--src/peerinfo/peerinfo_api.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 28828f3a3..831cd9240 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -31,6 +31,8 @@
31#include "gnunet_time_lib.h" 31#include "gnunet_time_lib.h"
32#include "peerinfo.h" 32#include "peerinfo.h"
33 33
34#define LOG(kind,...) GNUNET_log_from (kind, "nse-api",__VA_ARGS__)
35
34/** 36/**
35 * Function to call after transmission has succeeded. 37 * Function to call after transmission has succeeded.
36 * 38 *
@@ -272,8 +274,8 @@ do_transmit (void *cls, size_t size, void *buf)
272 return 0; 274 return 0;
273 if (buf == NULL) 275 if (buf == NULL)
274 { 276 {
275 GNUNET_log (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, 277 LOG (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,
276 _("Failed to transmit message to `%s' service.\n"), "PEERINFO"); 278 _("Failed to transmit message to `%s' service.\n"), "PEERINFO");
277 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe); 279 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
278 reconnect (h); 280 reconnect (h);
279 if (tqe->cont != NULL) 281 if (tqe->cont != NULL)
@@ -285,9 +287,8 @@ do_transmit (void *cls, size_t size, void *buf)
285 GNUNET_assert (size >= ret); 287 GNUNET_assert (size >= ret);
286 memcpy (buf, &tqe[1], ret); 288 memcpy (buf, &tqe[1], ret);
287#if DEBUG_PEERINFO 289#if DEBUG_PEERINFO
288 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 290 LOG (GNUNET_ERROR_TYPE_DEBUG,
289 "Transmitting request of size %u to `%s' service.\n", ret, 291 "Transmitting request of size %u to `%s' service.\n", ret, "PEERINFO");
290 "PEERINFO");
291#endif 292#endif
292 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe); 293 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
293 if (tqe->cont != NULL) 294 if (tqe->cont != NULL)
@@ -351,9 +352,9 @@ GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
351 struct GNUNET_PeerIdentity peer; 352 struct GNUNET_PeerIdentity peer;
352 353
353 GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (hello, &peer)); 354 GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (hello, &peer));
354 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 355 LOG (GNUNET_ERROR_TYPE_DEBUG,
355 "Adding peer `%s' to PEERINFO database (%u bytes of `%s')\n", 356 "Adding peer `%s' to PEERINFO database (%u bytes of `%s')\n",
356 GNUNET_i2s (&peer), hs, "HELLO"); 357 GNUNET_i2s (&peer), hs, "HELLO");
357#endif 358#endif
358 tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + hs); 359 tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + hs);
359 tqe->size = hs; 360 tqe->size = hs;
@@ -436,9 +437,8 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
436 if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END) 437 if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END)
437 { 438 {
438#if DEBUG_PEERINFO 439#if DEBUG_PEERINFO
439 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 440 LOG (GNUNET_ERROR_TYPE_DEBUG,
440 "Received end of list of peers from `%s' service\n", 441 "Received end of list of peers from `%s' service\n", "PEERINFO");
441 "PEERINFO");
442#endif 442#endif
443 trigger_transmit (ic->h); 443 trigger_transmit (ic->h);
444 if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK) 444 if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK)
@@ -482,10 +482,10 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
482 } 482 }
483 } 483 }
484#if DEBUG_PEERINFO 484#if DEBUG_PEERINFO
485 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 485 LOG (GNUNET_ERROR_TYPE_DEBUG,
486 "Received %u bytes of `%s' information about peer `%s' from `%s' service\n", 486 "Received %u bytes of `%s' information about peer `%s' from `%s' service\n",
487 (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), 487 (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), "HELLO",
488 "HELLO", GNUNET_i2s (&im->peer), "PEERINFO"); 488 GNUNET_i2s (&im->peer), "PEERINFO");
489#endif 489#endif
490 ic->h->in_receive = GNUNET_YES; 490 ic->h->in_receive = GNUNET_YES;
491 if (ic->callback != NULL) 491 if (ic->callback != NULL)
@@ -523,8 +523,8 @@ iterator_start_receive (void *cls, int transmit_success)
523 return; 523 return;
524 } 524 }
525#if DEBUG_PEERINFO 525#if DEBUG_PEERINFO
526 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 526 LOG (GNUNET_ERROR_TYPE_DEBUG, "Waiting for response from `%s' service.\n",
527 "Waiting for response from `%s' service.\n", "PEERINFO"); 527 "PEERINFO");
528#endif 528#endif
529 ic->h->in_receive = GNUNET_YES; 529 ic->h->in_receive = GNUNET_YES;
530 ic->in_receive = GNUNET_YES; 530 ic->in_receive = GNUNET_YES;
@@ -589,8 +589,8 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
589 if (peer == NULL) 589 if (peer == NULL)
590 { 590 {
591#if DEBUG_PEERINFO 591#if DEBUG_PEERINFO
592 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 592 LOG (GNUNET_ERROR_TYPE_DEBUG,
593 "Requesting list of peers from PEERINFO service\n"); 593 "Requesting list of peers from PEERINFO service\n");
594#endif 594#endif
595 tqe = 595 tqe =
596 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + 596 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
@@ -603,9 +603,9 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
603 else 603 else
604 { 604 {
605#if DEBUG_PEERINFO 605#if DEBUG_PEERINFO
606 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 606 LOG (GNUNET_ERROR_TYPE_DEBUG,
607 "Requesting information on peer `%4s' from PEERINFO service\n", 607 "Requesting information on peer `%4s' from PEERINFO service\n",
608 GNUNET_i2s (peer)); 608 GNUNET_i2s (peer));
609#endif 609#endif
610 tqe = 610 tqe =
611 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + 611 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +