aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo/peerinfo_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-02 13:48:08 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-02 13:48:08 +0000
commit45cb6dbbdd3a509e54f94eff3b4f96ed3734b7c9 (patch)
tree0135934d33225151bec614237c40ae0a991cba25 /src/peerinfo/peerinfo_api.c
parent8d69aeda86985616d001e8e18eb8d808edaf4fdb (diff)
downloadgnunet-45cb6dbbdd3a509e54f94eff3b4f96ed3734b7c9.tar.gz
gnunet-45cb6dbbdd3a509e54f94eff3b4f96ed3734b7c9.zip
-removing legacy ifdefs
Diffstat (limited to 'src/peerinfo/peerinfo_api.c')
-rw-r--r--src/peerinfo/peerinfo_api.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 124d55e42..fed577035 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -274,10 +274,8 @@ do_transmit (void *cls, size_t size, void *buf)
274 return 0; 274 return 0;
275 if (buf == NULL) 275 if (buf == NULL)
276 { 276 {
277#if DEBUG_PEERINFO
278 LOG (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, 277 LOG (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
279 _("Failed to transmit message to `%s' service.\n"), "PEERINFO"); 278 _("Failed to transmit message to `%s' service.\n"), "PEERINFO");
280#endif
281 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe); 279 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
282 reconnect (h); 280 reconnect (h);
283 if (tqe->cont != NULL) 281 if (tqe->cont != NULL)
@@ -288,10 +286,8 @@ do_transmit (void *cls, size_t size, void *buf)
288 ret = tqe->size; 286 ret = tqe->size;
289 GNUNET_assert (size >= ret); 287 GNUNET_assert (size >= ret);
290 memcpy (buf, &tqe[1], ret); 288 memcpy (buf, &tqe[1], ret);
291#if DEBUG_PEERINFO
292 LOG (GNUNET_ERROR_TYPE_DEBUG, 289 LOG (GNUNET_ERROR_TYPE_DEBUG,
293 "Transmitting request of size %u to `%s' service.\n", ret, "PEERINFO"); 290 "Transmitting request of size %u to `%s' service.\n", ret, "PEERINFO");
294#endif
295 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe); 291 GNUNET_CONTAINER_DLL_remove (h->tq_head, h->tq_tail, tqe);
296 if (tqe->cont != NULL) 292 if (tqe->cont != NULL)
297 tqe->cont (tqe->cont_cls, GNUNET_OK); 293 tqe->cont (tqe->cont_cls, GNUNET_OK);
@@ -349,15 +345,12 @@ GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
349{ 345{
350 uint16_t hs = GNUNET_HELLO_size (hello); 346 uint16_t hs = GNUNET_HELLO_size (hello);
351 struct TransmissionQueueEntry *tqe; 347 struct TransmissionQueueEntry *tqe;
352
353#if DEBUG_PEERINFO
354 struct GNUNET_PeerIdentity peer; 348 struct GNUNET_PeerIdentity peer;
355 349
356 GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (hello, &peer)); 350 GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_id (hello, &peer));
357 LOG (GNUNET_ERROR_TYPE_DEBUG, 351 LOG (GNUNET_ERROR_TYPE_DEBUG,
358 "Adding peer `%s' to PEERINFO database (%u bytes of `%s')\n", 352 "Adding peer `%s' to PEERINFO database (%u bytes of `%s')\n",
359 GNUNET_i2s (&peer), hs, "HELLO"); 353 GNUNET_i2s (&peer), hs, "HELLO");
360#endif
361 tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + hs); 354 tqe = GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + hs);
362 tqe->size = hs; 355 tqe->size = hs;
363 tqe->timeout = GNUNET_TIME_UNIT_FOREVER_ABS; 356 tqe->timeout = GNUNET_TIME_UNIT_FOREVER_ABS;
@@ -438,10 +431,8 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
438 } 431 }
439 if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END) 432 if (ntohs (msg->type) == GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END)
440 { 433 {
441#if DEBUG_PEERINFO
442 LOG (GNUNET_ERROR_TYPE_DEBUG, 434 LOG (GNUNET_ERROR_TYPE_DEBUG,
443 "Received end of list of peers from `%s' service\n", "PEERINFO"); 435 "Received end of list of peers from `%s' service\n", "PEERINFO");
444#endif
445 trigger_transmit (ic->h); 436 trigger_transmit (ic->h);
446 if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK) 437 if (ic->timeout_task != GNUNET_SCHEDULER_NO_TASK)
447 GNUNET_SCHEDULER_cancel (ic->timeout_task); 438 GNUNET_SCHEDULER_cancel (ic->timeout_task);
@@ -483,12 +474,10 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
483 return; 474 return;
484 } 475 }
485 } 476 }
486#if DEBUG_PEERINFO
487 LOG (GNUNET_ERROR_TYPE_DEBUG, 477 LOG (GNUNET_ERROR_TYPE_DEBUG,
488 "Received %u bytes of `%s' information about peer `%s' from `%s' service\n", 478 "Received %u bytes of `%s' information about peer `%s' from `%s' service\n",
489 (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), "HELLO", 479 (hello == NULL) ? 0 : (unsigned int) GNUNET_HELLO_size (hello), "HELLO",
490 GNUNET_i2s (&im->peer), "PEERINFO"); 480 GNUNET_i2s (&im->peer), "PEERINFO");
491#endif
492 ic->h->in_receive = GNUNET_YES; 481 ic->h->in_receive = GNUNET_YES;
493 if (ic->callback != NULL) 482 if (ic->callback != NULL)
494 ic->callback (ic->callback_cls, &im->peer, hello, NULL); 483 ic->callback (ic->callback_cls, &im->peer, hello, NULL);
@@ -524,10 +513,8 @@ iterator_start_receive (void *cls, int transmit_success)
524 GNUNET_free (ic); 513 GNUNET_free (ic);
525 return; 514 return;
526 } 515 }
527#if DEBUG_PEERINFO
528 LOG (GNUNET_ERROR_TYPE_DEBUG, "Waiting for response from `%s' service.\n", 516 LOG (GNUNET_ERROR_TYPE_DEBUG, "Waiting for response from `%s' service.\n",
529 "PEERINFO"); 517 "PEERINFO");
530#endif
531 ic->h->in_receive = GNUNET_YES; 518 ic->h->in_receive = GNUNET_YES;
532 ic->in_receive = GNUNET_YES; 519 ic->in_receive = GNUNET_YES;
533 ic->tqe = NULL; 520 ic->tqe = NULL;
@@ -590,10 +577,8 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
590 577
591 if (peer == NULL) 578 if (peer == NULL)
592 { 579 {
593#if DEBUG_PEERINFO
594 LOG (GNUNET_ERROR_TYPE_DEBUG, 580 LOG (GNUNET_ERROR_TYPE_DEBUG,
595 "Requesting list of peers from PEERINFO service\n"); 581 "Requesting list of peers from PEERINFO service\n");
596#endif
597 tqe = 582 tqe =
598 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + 583 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
599 sizeof (struct GNUNET_MessageHeader)); 584 sizeof (struct GNUNET_MessageHeader));
@@ -604,11 +589,9 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
604 } 589 }
605 else 590 else
606 { 591 {
607#if DEBUG_PEERINFO
608 LOG (GNUNET_ERROR_TYPE_DEBUG, 592 LOG (GNUNET_ERROR_TYPE_DEBUG,
609 "Requesting information on peer `%4s' from PEERINFO service\n", 593 "Requesting information on peer `%4s' from PEERINFO service\n",
610 GNUNET_i2s (peer)); 594 GNUNET_i2s (peer));
611#endif
612 tqe = 595 tqe =
613 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) + 596 GNUNET_malloc (sizeof (struct TransmissionQueueEntry) +
614 sizeof (struct ListPeerMessage)); 597 sizeof (struct ListPeerMessage));